summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2016-07-03 13:52:20 +0200
committerMichael Brown2016-07-03 13:52:20 +0200
commit3bb61c33c2d77ac9a1a512d809576f3444b6b1ed (patch)
treee3de22abca94db6d351f793cc0c5e085ba161762 /src/arch
parent[bios] Do not enable interrupts when printing to the console (diff)
downloadipxe-3bb61c33c2d77ac9a1a512d809576f3444b6b1ed.tar.gz
ipxe-3bb61c33c2d77ac9a1a512d809576f3444b6b1ed.tar.xz
ipxe-3bb61c33c2d77ac9a1a512d809576f3444b6b1ed.zip
[pxe] Disable interrupts on the PIC before starting NBP
Some BIOSes (observed with an HP Gen9) seem to spuriously enable interrupts at the PIC. This causes problems with NBPs such as GRUB which use the UNDI API (thereby enabling interrupts on the NIC) without first hooking an interrupt service routine. In this situation, the interrupt will end up being handled by the default BIOS ISR, which will typically just send an EOI and return. Since nothing in this handler causes the NIC to deassert the interrupt, this will result in an interrupt storm. Entertainingly, some BIOSes are immune to this problem because the default ISR sends the EOI only to the slave PIC; this effectively disables the interrupt. Work around this problem by disabling the interrupt on the PIC before invoking the PXE NBP. An NBP that expects to make use of interrupts will need to be configuring the PIC anyway, so it is probably safe to assume that it will explicitly reenable the interrupt. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/image/pxe_image.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/arch/x86/image/pxe_image.c b/src/arch/x86/image/pxe_image.c
index 297a618b..b6bcb18b 100644
--- a/src/arch/x86/image/pxe_image.c
+++ b/src/arch/x86/image/pxe_image.c
@@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <pxe.h>
#include <pxe_call.h>
+#include <pic8259.h>
#include <ipxe/uaccess.h>
#include <ipxe/image.h>
#include <ipxe/segment.h>
@@ -87,6 +88,10 @@ static int pxe_exec ( struct image *image ) {
/* Reset console since PXE NBP will probably use it */
console_reset();
+ /* Disable IRQ, if applicable */
+ if ( netdev_irq_supported ( netdev ) && netdev->dev->desc.irq )
+ disable_irq ( netdev->dev->desc.irq );
+
/* Start PXE NBP */
rc = pxe_start_nbp();