# HG changeset patch # Parent 2c92985dc53fbc62d1a2975aed968a8bb021c8ef rombios/ata: Do not wait for BSY to be set I can't find any guarantee in the ATA specification that this will happen, and it certainly does not with Qemu. SeaBIOS has replaced it with a call to udelay(5) instead. As rombios does not have an equivalent udelay(), replace the wait with a write to port 0x80 which is whitelisted by Xen for 'a small delay'. This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the number of traps during boot of a Win7 guest. Signed-off-by: Andrew Cooper diff -r 2c92985dc53f tools/firmware/rombios/rombios.c --- a/tools/firmware/rombios/rombios.c +++ b/tools/firmware/rombios/rombios.c @@ -2914,8 +2914,8 @@ Bit16u device; // 8.2.1 (a) -- set SRST in DC outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST); -// 8.2.1 (b) -- wait for BSY - await_ide(BSY, iobase1, 20); +// 8.2.1 (b) -- wait + outb(0x80, 0x00); // 8.2.1 (f) -- clear SRST outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);