On Wed, Jul 01, 2026 at 02:47:30PM +0800, Moeko Tomita wrote:
> pci_patch_ids() is only called for ROMs flagged rom_need_patch_id
> (only ipxe roms
> and IGD), the scope is still limited and won't potentially impact
> other existing functions,
> it's safe doing it here.
> 
> The fix is targeted on IGD romfile, which can't easily go in vfio.
> vfio_pci_size_rom()
> simply lets PCI core to handle the romfile and never touches or sees the 
> romfile
> itself. Adding a hook in vfio brings extra code duplication and complexity.
> 
> Moeko

IMHO this can all too easily break working setups.
What about multi-image roms, for example?
What about a padded rom file?

If someone gave me a broken rom I would normally just say "so don't do
this". 


If vfio wants to work around broken firmware, it's up to vfio.
Maybe it makes sense, I would not know.
You can keep the patching code in pci, just invoke from vfio
after pci_register_bar.

Not a big deal imho, and safer.

-- 
MST


Reply via email to