|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/EFI: fix boot for pre-UEFI systems
commit 47f71a8ccb0c881cf3d9e0b917ef5f0dc084b062
Author: Eric Shelton <eshelton@xxxxxxxxx>
AuthorDate: Thu May 23 13:08:51 2013 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu May 23 13:08:51 2013 +0200
x86/EFI: fix boot for pre-UEFI systems
efi/boot.c makes a call to QueryVariableInfo on all systems. However,
as it is only promised for UEFI 2.0+ systems, pre-UEFI systems can
hang or crash on this call. The below patch adds a version check, a
technique used in other parts of the Xen EFI codebase.
Signed-off-by: Eric Shelton <eshelton@xxxxxxxxx>
Check runtime services version instead of EFI version (while generally
they would be in sync, nothing requires them to be).
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/arch/x86/efi/boot.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 117a5cb..9718bd7 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -1241,12 +1241,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE
*SystemTable)
setup_efi_pci();
/* Get snapshot of variable store parameters. */
- status = efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+ status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
+ efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
&efi_boot_max_var_store_size,
&efi_boot_remain_var_store_size,
- &efi_boot_max_var_size);
+ &efi_boot_max_var_size) :
+ EFI_INCOMPATIBLE_VERSION;
if ( EFI_ERROR(status) )
{
efi_boot_max_var_store_size = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |