On Fri, May 22, 2020 at 6:15 AM Pratik Vyas <m...@pd.io> wrote:
> Hi Sivaram and Renato,
>
> I have been looking at this issue this week with Dave.  (funnily Dave
> and I independently also decided to write a linux patch to attach
> pvclock and debugging these crashes).

My hacky "vmm-clock" implementation is here if you'd like to compare
notes: https://git.sr.ht/~voutilad/linux/log/linux-5.4-obsd

My goal is to strip down the implementation to the bare minimum needed
for an OpenBSD guest similar to what I did with my vmmci(4)
implementation: https://github.com/voutilad/virtio_vmmci

One thing I've found is (at least with busybox's top(1)), the
accounting for cpu utilization is wrong if you just wire up the
kvm-clock clocksource.

>
> If you have your linux vm with kvm-clock around, can you try this rather
> crude patch and see if it still crashes?  This might also fix the '100%
> cpu when using alpine via console' problem.

>From my quick testing, with both the standard Linux 5.4 kernel with
Alpine 3.11 and my 5.4.40 fork, it resolves the CPU utilization issue
from the serial console, but doesn't resolve the serial console lockup
when spamming the return key. I haven't dug into why yet.

> For ref, this is my linux side patch to attach kvm-clock http://ix.io/2lzK
>
> @@ -96,7 +103,7 @@ ns8250_init(int fd, uint32_t vmid)
>          */
>         com1_dev.pause_ct = (com1_dev.baudrate / 8) / 1000 * 10;
>
> -       event_set(&com1_dev.event, com1_dev.fd, EV_READ | EV_PERSIST,
> +       event_set(&com1_dev.event, com1_dev.fd, EV_READ,
>             com_rcv_event, (void *)(intptr_t)vmid);

pd@ I think you're missing the analogous code in ns8250_restore().

-- 
Dave Voutila

Reply via email to