NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Qemu/nvmm - time in NetBSD guest system lags behind (with estd on host)



Hello all,

I have a NetBSD 9.3 host that hosts multiple virtual machines (Qemu with nvmm acceleration). One peculiarity: I use estd on the host to control down the power consumption of the whole system via frequency scaling when there is no load.

The time of the host is synchronized via ntpd (with default settings), as well as the guests.

The host's time is correct.

The guests' time increasingly lags behind with continued operation. Also the ntpd seems to have no compensating effect in the guests here.

What could be the reason for this? Can estd be a source of interference?

I start the Qemu instances like this:

```
nohup qemu-system-x86_64 -machine pc-q35-7.0 -smp $VM_CORES -m $VM_RAM -accel nvmm \
                        -device virtio-balloon-pci,id=balloon0 \
                        -k de -boot cd -cdrom $VM_CDROM \
                        -machine graphics=off -display none -vga none \
-object rng-random,filename=/dev/urandom,id=viornd0 \
                        -device virtio-rng-pci,rng=viornd0 \
                        -object iothread,id=t0 \
                        $BLK \
                        -device virtio-net-pci,netdev=vioif0,mac=$VM_MAC \
-netdev tap,id=vioif0,ifname=$VM_NETIF,script=no,downscript=no \ -chardev socket,id=monitor,path=$MONITOR_SOCKET,server=on,wait=off \
                        -monitor chardev:monitor \
-chardev socket,id=serial0,path=$CONSOLE_SOCKET,server=on,wait=off \
                        -serial chardev:serial0 \
                        -pidfile /tmp/$VM_ID.pid \
                        2>&1 | logger -p local0.notice &
```

Timecounter settings in the guests:

```
net$ sysctl -a |grep timecounter
kern.timecounter.choice = TSC(q=3000, f=1996800000 Hz) clockinterrupt(q=0, f=100 Hz) ichlpcib0(q=1000, f=3579545 Hz) hpet0(q=2000, f=100000000 Hz) ACPI-Safe(q=900, f=3579545 Hz) lapic(q=-100, f=19200000 Hz) i8254(q=100, f=1193182 Hz) dummy(q=-1000000, f=1000000 Hz)
kern.timecounter.hardware = TSC
kern.timecounter.timestepwarnings = 0
```

All I could find so far is [1]. It is recommended to add the rtc switch to the qemu command. Is there any recommendation here in the meantime which setting works best with NetBSD?

I would be very happy about a short recommendation or a field report. As it is, this is the last remaining problem on my new virtual host, powered by NetBSD, Qemu, NVMM and ZFS ZVOLS.

Kind regards
Matthias


[1] http://mail-index.netbsd.org/port-amd64/2021/05/09/msg003459.html


Home | Main Index | Thread Index | Old Index