[SeaBIOS] [PATCH] optionrom: disallow int19 redirect for pnp roms.

Kevin O'Connor kevin at koconnor.net
Wed Dec 5 23:48:15 CET 2018


On Wed, Dec 05, 2018 at 07:55:58AM +0100, Gerd Hoffmann wrote:
> On Fri, Nov 30, 2018 at 12:53:38PM +0100, Gerd Hoffmann wrote:
> >   Hi,
> > 
> > > Do you know, for this particular optionrom, if int19 is recaptured and
> > > the user then chooses it from the boot menu, does it continue to work?
> > 
> > I've asked them to test that.
> 
> Feedback arrived:  Yes, picking a nic from the boot menu continues to
> work with recaptured int19.

Okay, thanks.  If you think recapturing int19 is the best way forward
then I'm okay with that.

I do think it may be prudent to limit the test a little more (just in
an abundance of caution).  For example, something like the below.

-Kevin


--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -327,8 +334,12 @@ init_pcirom(struct pci_device *pci, int isvga, u64 *sources)
     if (! rom)
         // No ROM present.
         return;
+    int irq_was_captured = boot_irq_captured();
     setRomSource(sources, rom, RS_PCIROM | (u32)pci);
     init_optionrom(rom, pci->bdf, isvga);
+    if (boot_irq_captured() && !irq_was_captured && !file && !isvga)
+        // This PCI rom is misbehaving - recapture the boot irqs
+        recapture_boot_irq();
 }
 
 



More information about the SeaBIOS mailing list