[Bug 260148] passthru stopped working

2022-06-20 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260148

--- Comment #16 from mario felicioni  ---
Good for you. I'm not lucky as you. I can't use bhyve on FreeBSD
14-CURRENT,because it does not have some bug fixes that I need that are only in
the 13.1-RELEASE modified by Corvin. I can only wait and hope that he
understand what's wrong in his code and that have been already patched on the
14-CURRENT.

-- 
You are receiving this mail because:
You are the assignee for the bug.


Re: bhyve GPU passthrough + romfile

2022-06-20 Thread John Nielsen
> On Jun 20, 2022, at 12:08 AM, Corvin Köhne  wrote:
> 
> first of all, the ROM is only required for Linux/BSD amdgpu driver. Windows 
> works without a ROM file. Additionally, the ROM is required for pre-OS 
> graphics (e.g. EFI boot, bootloader, etc.).
> 
> Currently, OVMF doesn't processes the ROM file. Processing the ROM would 
> include:
> - executing the ROM
> - shadowing the ROM
> 
> The amdgpu driver searches for the shadowed ROM. So, for Linux/BSD guest, a 
> patched OVMF is required. If you like to try a patched OVMF, please apply 
> following commits to BhyveX64.dsc:
> https://github.com/Beckhoff/edk2/commit/bed77d4bb374fa6450fa2781eeddfbc3604edf6a
> https://github.com/Beckhoff/edk2/commit/aeaa9c4c1d1222723cbf9c1c7dd7f5ff3911deac
> https://github.com/Beckhoff/edk2/commit/a7b01394682874508d65c6f4b5815cdbb6c6eb6c

Thank you for the detailed response. I will try these for my own curiosity. Is 
there a reason these patches aren’t in the upstream project or otherwise 
available as a FreeBSD port/package?

> As said, Windows requires no ROM. So, that's not the issue. For many years 
> AMD GPUs have issues to reset themselves. It's a well known hardware bug. You 
> didn't mention which AMD GPU your using so I can't check if your GPU is 
> affected too. A possible workaround is descripted at:
> https://curtisshoward.com/post/fixing-amd-gpu-passthrough-reset-issues-in-windows/

 I have a Radeon RX 580 FWIW. Disabling the card in Windows for every boot is a 
pretty ugly hack but I might play around with it. Too bad Windows Update is so 
heavy handed in the consumer editions of Windows.

> Btw: On Linux there's some work to solve the GPU reset bug by hardware 
> specific reset routines (https://github.com/gnif/vendor-reset) but I don't 
> think that such kind of work will be merged soon into FreeBSD.
> 
>> PS: Is there a known/supported way to get a GPU ROM file from FreeBSD? The 
>> one I have I obtained from a Linux host where this GPU was secondary.
> 
> No, there's no known/supported way yet. The best way is to boot another OS.




RE: bhyve GPU passthrough + romfile

2022-06-20 Thread Corvin Köhne
Hi John,

> Thank you for the detailed response. I will try these for my own curiosity. 
> Is there a reason these patches aren’t in the upstream project or otherwise 
> available as a FreeBSD port/package?

I already sent the patches upstream. There wasn't much feedback on it but the 
feedback I got rejected the change. 
https://docs.freebsd.org/cgi/getmsg.cgi?fetch=25822+0+/usr/local/www/mailindex/archive/2021/freebsd-virtualization/20210620.freebsd-virtualization

I'm not sure if it makes sense to create a new port/package for my changes. I'm 
working on some improvements to bhyve to support QEMU's OVMF.
QEMU's OVMF supports bus enumeration. So, it might be easier to just switch to 
QEMU's OVMF when it's supported.

> I have a Radeon RX 580 FWIW. Disabling the card in Windows for every boot is 
> a pretty ugly hack but I might play around with it. Too bad Windows Update is 
> so heavy handed in the consumer editions of Windows.

This GPU seems to be affected by the reset bug. It can't be fixed because it's 
a hardware bug, sry.

Btw: On my AMD system, linux is able to reboot. The driver throws some errors 
on restart but it seems to work.


Best regards
Corvin

Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans Beckhoff
Registered office: Verl, Germany | Register court: Guetersloh HRA 7075