Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 2024 08:52:09 +1000
From:      Peter Grehan <grehan@freebsd.org>
To:        Vasily Postnicov <shamaz.mazum@gmail.com>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: Running Mezzano in bhyve
Message-ID:  <106b8500-a0ef-4095-af20-8c0f110ea739@freebsd.org>
In-Reply-To: <CADnZ6BmjGzHygqJSNY=wpuy-6Z4YiAMpt-gBx0f%2Bi%2BrXBfBvaQ@mail.gmail.com>
References:  <CADnZ6B=ex24mbGN3du6UuS84akJZAxTcG5xqt0HB0RN5S262cQ@mail.gmail.com> <17f4077d-647d-4848-9d6f-97f9886ef636@freebsd.org> <CADnZ6BkWd-v=y0L9%2BGiu=ys_Cuk5nm6djApSXYLufYuv=WnQWQ@mail.gmail.com> <CADnZ6B=LwZyiBTvXGek37e23t_e3ub4K%2BE96QaahukPbobkHhg@mail.gmail.com> <8b249b64-d041-4f12-b6cb-fdb528837f22@freebsd.org> <CADnZ6BkKh5V9_Y%2BTGrGpc=vTW2q81pdWJn8MUVvWNOiV35nBFw@mail.gmail.com> <CADnZ6BkHkNBD5LaEZCeSy7QnfquwB-Wv3sYu4S=P58ZyVGrDQQ@mail.gmail.com> <e395fc30-0582-4d51-b1b3-cf5157bdd3a9@freebsd.org> <CADnZ6BmjGzHygqJSNY=wpuy-6Z4YiAMpt-gBx0f%2Bi%2BrXBfBvaQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 1) The problem with PIT. Can be solved as you proposed or by
> patching Mezzano. The bhyve patch would be the best option for that: it's useful for
other older o/s's (DOS).

> 2) Mezzano assumes that Intel AHCI controllers report no more than 6 
> ports. Can be solved by patching Mezzano or defining MAX_PORTS to be 
> 6 in usr.sbin/bhyve/pci_ahci.c

  A Mezzano patch would be best for that. The bhyve man page has an
example with 8 disks attached so reducing the limit to 6 could hit
existing users.

> 3) According to 
> https://wiki.osdev.org/PCI#Message_Signaled_Interrupts 
> <https://wiki.osdev.org/PCI#Message_Signaled_Interrupts>, interrupt 
> line config register must be RW. Bhyve does not support writing to 
> it. I do not know a correct fix, this [1] workaround helps, however.

  Bhyve does support writing to that - your patch disables that, and my
guess is that when Mezzano sees this as zero (ie invalid) it then looks
for the irq line via the ACPI MADT (or other means).

  A quick look at Mezzano shows that it is still using the 8259 PIC for
interrupts. At the minimum it should be using the IOAPIC, or excessive
interrupt sharing will result, and possibly incorrect behaviour when
this happens. I think IOAPIC support could be added without a large
amount of effort, compared to e.g. MSI/MSI-x.

> 4) Finally, I had a random deadlock in interrupt handling for the 
> virtio-net device. Likewise, I do not know how to fix it correctly, 
> but this [2] patch helped.

  Hmmm that seems strange: MSI interrupts aren't generated if they
haven't been setup/enabled by a guest. Commenting out the lock/unlock
code would seem to indicate a larger bug in play. Would it possible to
get some tracing on that segment of code e.g. a dtrace log ?

> Do you have any ideas how to make proper patches for bhyve from
> these workarounds?

  The first one can be put in a phab diff, which I'll do. I think there's
still some more work involved for the others.

later,

Peter.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?106b8500-a0ef-4095-af20-8c0f110ea739>