summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/interface
diff options
context:
space:
mode:
authorMichael Brown2014-04-28 21:20:44 +0200
committerMichael Brown2014-04-29 19:24:10 +0200
commite4593909a8a21c4a9d5766bf6a0770bcf6ee6911 (patch)
tree4831a67764ab2ea8e9aa5210b3c9c0d3bd7e7f3a /src/arch/i386/interface
parent[comboot] Use built-in interrupt reflector (diff)
downloadipxe-e4593909a8a21c4a9d5766bf6a0770bcf6ee6911.tar.gz
ipxe-e4593909a8a21c4a9d5766bf6a0770bcf6ee6911.tar.xz
ipxe-e4593909a8a21c4a9d5766bf6a0770bcf6ee6911.zip
[pcbios] Do not switch to real mode to check for timer interrupt
The currticks() function is called at least once per TCP packet, and so is performance-critical. Switching to real mode just to allow the timer interrupt to fire is expensive when running inside a virtual machine, and imposes a significant performance cost. Fix by enabling interrupts without switching to real mode. This results in an approximately 100% increase in download speed when running under KVM. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/interface')
-rw-r--r--src/arch/i386/interface/pcbios/bios_timer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/i386/interface/pcbios/bios_timer.c b/src/arch/i386/interface/pcbios/bios_timer.c
index 3cb8756f7..65bbf9e01 100644
--- a/src/arch/i386/interface/pcbios/bios_timer.c
+++ b/src/arch/i386/interface/pcbios/bios_timer.c
@@ -44,10 +44,10 @@ static unsigned long bios_currticks ( void ) {
uint8_t midnight;
/* Re-enable interrupts so that the timer interrupt can occur */
- __asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
- "nop\n\t"
- "nop\n\t"
- "cli\n\t" ) : : );
+ __asm__ __volatile__ ( "sti\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "cli\n\t" );
get_real ( ticks, BDA_SEG, 0x006c );
get_real ( midnight, BDA_SEG, 0x0070 );