diff options
author | Matt Fleming <matt.fleming@intel.com> | 2014-02-24 13:07:26 -0500 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-03-04 16:44:00 -0500 |
commit | 18c46461d9e42d398536055f31f58cdcd2c6347e (patch) | |
tree | b719e1cb7c2e3637104ef753be46916603359078 /arch | |
parent | 108d3f44b16be2ecf0e44c2f2863752918eb7bce (diff) |
x86/efi: Re-disable interrupts after calling firmware services
Some firmware appears to enable interrupts during boot service calls,
even if we've explicitly disabled them prior to the call. This is
actually allowed per the UEFI spec because boottime services expect to
be called with interrupts enabled.
So that's fine, we just need to ensure that we disable them again in
efi_enter32() before switching to a 64-bit GDT, otherwise an interrupt
may fire causing a 32-bit IRQ handler to run after we've left
compatibility mode.
Despite efi_enter32() being called both for boottime and runtime
services, this really only affects boottime because the runtime services
callchain is executed with interrupts disabled. See efi_thunk().
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/platform/efi/efi_stub_64.S | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S index e811514beeac..65b787a9fc4e 100644 --- a/arch/x86/platform/efi/efi_stub_64.S +++ b/arch/x86/platform/efi/efi_stub_64.S | |||
@@ -261,6 +261,12 @@ ENTRY(efi_enter32) | |||
261 | /* We must preserve return value */ | 261 | /* We must preserve return value */ |
262 | movl %eax, %edi | 262 | movl %eax, %edi |
263 | 263 | ||
264 | /* | ||
265 | * Some firmware will return with interrupts enabled. Be sure to | ||
266 | * disable them before we switch GDTs. | ||
267 | */ | ||
268 | cli | ||
269 | |||
264 | movl 44(%esp), %eax | 270 | movl 44(%esp), %eax |
265 | movl %eax, 2(%eax) | 271 | movl %eax, 2(%eax) |
266 | lgdtl (%eax) | 272 | lgdtl (%eax) |