From: Michal Schmidt <mschmidt@redhat.com> Subject: [PATCH RHEL-5] EFI: only warn on pre-1.00 version Date: Thu, 26 Apr 2007 15:31:42 +0200 Bugzilla: 223282 Message-Id: <4630A9BE.4020705@redhat.com> Changelog: [misc] EFI: only warn on pre-1.00 version Currently the kernel prints out a warning if EFI system table major revision is not exactly 1. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=223282 The patch is from Bjorn Helgaas <bjorn.helgaas@hp.com> and it's now in -mm. The kernel builds OK with the patch on all architectures. I don't have a machine with EFI 2.0, so I haven't tested it myself. There's not much room for breakage here though. Michal diff -Nurp linux-2.6.18.i686.orig/arch/i386/kernel/efi.c linux-2.6.18.i686/arch/i386/kernel/efi.c --- linux-2.6.18.i686.orig/arch/i386/kernel/efi.c 2007-04-26 12:52:37.000000000 +0200 +++ linux-2.6.18.i686/arch/i386/kernel/efi.c 2007-04-26 12:54:34.000000000 +0200 @@ -340,14 +340,12 @@ void __init efi_init(void) printk(KERN_ERR PFX "Woah! Couldn't map the EFI system table.\n"); if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) printk(KERN_ERR PFX "Woah! EFI system table signature incorrect\n"); - if ((efi.systab->hdr.revision ^ EFI_SYSTEM_TABLE_REVISION) >> 16 != 0) - printk(KERN_ERR PFX - "Warning: EFI system table major version mismatch: " - "got %d.%02d, expected %d.%02d\n", + if ((efi.systab->hdr.revision >> 16) == 0) + printk(KERN_ERR PFX "Warning: EFI system table version " + "%d.%02d, expected 1.00 or greater\n", efi.systab->hdr.revision >> 16, - efi.systab->hdr.revision & 0xffff, - EFI_SYSTEM_TABLE_REVISION >> 16, - EFI_SYSTEM_TABLE_REVISION & 0xffff); + efi.systab->hdr.revision & 0xffff); + /* * Grab some details from the system table */ diff -Nurp linux-2.6.18.i686.orig/arch/ia64/hp/sim/boot/fw-emu.c linux-2.6.18.i686/arch/ia64/hp/sim/boot/fw-emu.c --- linux-2.6.18.i686.orig/arch/ia64/hp/sim/boot/fw-emu.c 2006-09-20 05:42:06.000000000 +0200 +++ linux-2.6.18.i686/arch/ia64/hp/sim/boot/fw-emu.c 2007-04-26 12:54:34.000000000 +0200 @@ -287,7 +287,7 @@ sys_fw_init (const char *args, int argle memset(efi_systab, 0, sizeof(efi_systab)); efi_systab->hdr.signature = EFI_SYSTEM_TABLE_SIGNATURE; - efi_systab->hdr.revision = EFI_SYSTEM_TABLE_REVISION; + efi_systab->hdr.revision = ((1 << 16) | 00); efi_systab->hdr.headersize = sizeof(efi_systab->hdr); efi_systab->fw_vendor = __pa("H\0e\0w\0l\0e\0t\0t\0-\0P\0a\0c\0k\0a\0r\0d\0\0"); efi_systab->fw_revision = 1; diff -Nurp linux-2.6.18.i686.orig/arch/ia64/kernel/efi.c linux-2.6.18.i686/arch/ia64/kernel/efi.c --- linux-2.6.18.i686.orig/arch/ia64/kernel/efi.c 2007-04-26 12:52:15.000000000 +0200 +++ linux-2.6.18.i686/arch/ia64/kernel/efi.c 2007-04-26 12:54:34.000000000 +0200 @@ -445,11 +445,11 @@ efi_init (void) panic("Woah! Can't find EFI system table.\n"); if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) panic("Woah! EFI system table signature incorrect\n"); - if ((efi.systab->hdr.revision ^ EFI_SYSTEM_TABLE_REVISION) >> 16 != 0) - printk(KERN_WARNING "Warning: EFI system table major version mismatch: " - "got %d.%02d, expected %d.%02d\n", - efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, - EFI_SYSTEM_TABLE_REVISION >> 16, EFI_SYSTEM_TABLE_REVISION & 0xffff); + if ((efi.systab->hdr.revision >> 16) == 0) + printk(KERN_WARNING "Warning: EFI system table version " + "%d.%02d, expected 1.00 or greater\n", + efi.systab->hdr.revision >> 16, + efi.systab->hdr.revision & 0xffff); config_tables = __va(efi.systab->tables); diff -Nurp linux-2.6.18.i686.orig/include/linux/efi.h linux-2.6.18.i686/include/linux/efi.h --- linux-2.6.18.i686.orig/include/linux/efi.h 2007-04-26 12:52:37.000000000 +0200 +++ linux-2.6.18.i686/include/linux/efi.h 2007-04-26 12:54:34.000000000 +0200 @@ -213,7 +213,6 @@ typedef struct { } efi_config_table_t; #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) -#define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00) typedef struct { efi_table_hdr_t hdr;