rumpkernel and bhyve: triple faults

Fabian Freyer fabian.freyer at physik.tu-berlin.de
Tue Mar 6 09:50:28 UTC 2018


(un-CC’ing rumpkernel-users@, since this part of the
discussion is getting very bhyve-specific)

On 6 Mar 2018, at 10:18, Rodney W. Grimes wrote:

>> On 6 Mar 2018, at 9:28, Rodney W. Grimes wrote:
>>
>>>> bios_crtc_base would be part of the isa legacy vga
>>>> controller card.  Bhyve does not, at this time, or
>>>> in the near future expect to have, support for this
>>>> legacy device.
>>>
>>> I am wrong on this, the framebuffer device does
>>> infact have support for the legacy i/o addresses
>>> that this should point to.  You should see the
>>> "vgaconf" section of the FrameBuffer section
>>> of the bhyve(8) manpage.
>>>
>>> I believe you need to be running bhyve with the
>>> uefi bios options, the with CMS version, and
>>> have vgaconf=on to get your code to work as is.
>>
>> For diskless multiboot kernels I?m going with a
>> separate userboot.so-compatible loader. Specifying
>> a UEFI bootrom implicitly resets the CPU.
>> (See usr.sbin/bhyve/bhyverun.c:960)
>
> Well in that case my original claim that there
> is not a legacy isa vga device avaliable would
> be correct for this environment, and you should
> just eliminate anything that tries to use it,
> or make it understand that this device may not
> exist.  I am not sure if bhyve maps any of these
> legacy addresses if your not using bhyveloader
> or uefi bios code.  0x400 and 0x483 being
> unmapped could lead to your tripple fault.

According to lib/libvmmapi/vmmapi.c:409, (and some
code / comments in grub2-bhyve), bhyve maps up to
two memory segments: [0, lowmem) and if more than
3 GiB of memory is given, [4GiB, 4GiB + highmem).

According to the comments in
grub2-bhyve/grub-core/kern/emu/bhyve_hostif.c:149
The area from 640kiB to 1MiB is reserved as the
vga hole and BIOS.

0x400 and 0x463 are in the bios data area [1], which is
mapped, but zeroed out:

   40:00	 word COM1 port address
   40:63	 word Base port address for active 6845 CRT controller

I’m not sure whether it might not be useful for
bhyve to populate the bios data area with the
information that it does have available (e.g. serial
ports).

On a related note, I saw that there is a relevant
GSoC Project idea [2] to be mentored by tychon@ (CC’d)
that mentions VGA/VESA device emulation independent
of the UEFI frame buffer. I’ll try to look into that
more, and possibly submit a proposal :).

Fabian

[1] http://stanislavs.org/helppc/bios_data_area.html
[2] 
https://wiki.freebsd.org/SummerOfCodeIdeas#VGA_emulation_improvements_for_bhyve


More information about the freebsd-virtualization mailing list