lkml.org 
[lkml]   [2011]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] x86, efi: Only print warning when desc_size is smaller than defined one.

One system get warning:
Kernel-defined memdesc doesn't match the one from EFI!

UEFI spec allows GetMemoryMap() return bigger desc_size and desc_ver for future
extension.
And desc_size is already used to get offset of next memory entry.

Only need to check if desc_size is smaller than defined struct.

Also print the size in warning if it happens.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
arch/x86/platform/efi/efi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/x86/platform/efi/efi.c
===================================================================
--- linux-2.6.orig/arch/x86/platform/efi/efi.c
+++ linux-2.6/arch/x86/platform/efi/efi.c
@@ -448,9 +448,10 @@ void __init efi_init(void)
printk(KERN_ERR "Could not map the EFI memory map!\n");
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);

- if (memmap.desc_size != sizeof(efi_memory_desc_t))
+ if (memmap.desc_size < sizeof(efi_memory_desc_t))
printk(KERN_WARNING
- "Kernel-defined memdesc doesn't match the one from EFI!\n");
+ "Kernel-defined memdesc size is bigger than the one from EFI! %ld > %ld\n",
+ sizeof(efi_memory_desc_t), memmap.desc_size);

if (add_efi_memmap)
do_add_efi_memmap();

\
 
 \ /
  Last update: 2011-04-27 00:45    [W:0.227 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site