Re: [PATCH] [8/8] RFC: Fix some EFI problems

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Gleixner
Date: Tuesday, February 12, 2008 - 1:48 pm

On Tue, 12 Feb 2008, Andi Kleen wrote:


No, it does not. Please go back and read my mail.
 
The code had exactly two bugs:

1) the logic of checking EFI_MEMORY_WB was wrong
2) the uninitialized variable

The fix is:

 arch/x86/kernel/efi.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/x86/kernel/efi.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/efi.c
+++ linux-2.6/arch/x86/kernel/efi.c
@@ -428,9 +428,6 @@ void __init efi_enter_virtual_mode(void)
 		else
 			va = efi_ioremap(md->phys_addr, size);
 
-		if (md->attribute & EFI_MEMORY_WB)
-			set_memory_uc(md->virt_addr, size);
-
 		md->virt_addr = (u64) (unsigned long) va;
 
 		if (!va) {
@@ -439,6 +436,9 @@ void __init efi_enter_virtual_mode(void)
 			continue;
 		}
 
+		if (!(md->attribute & EFI_MEMORY_WB))
+			set_memory_uc(md->virt_addr, size);
+
 		systab = (u64) (unsigned long) efi_phys.systab;
 		if (md->phys_addr <= systab && systab < end) {
 			systab += md->virt_addr - md->phys_addr;

The reordering of code is completely irrelevant. It can be done, but
in a separate patch.

Thanks,

	tglx
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/8] Various kernel mapping bug fixes, Andi Kleen, (Mon Feb 11, 2:34 am)
[PATCH] [4/8] CPA: Fix set_memory_x for ioremap, Andi Kleen, (Mon Feb 11, 2:34 am)
[PATCH] [5/8] Fix logic error in 64bit memory hotadd, Andi Kleen, (Mon Feb 11, 2:34 am)
[PATCH] [8/8] RFC: Fix some EFI problems, Andi Kleen, (Mon Feb 11, 2:34 am)
Re: [PATCH] [4/8] CPA: Fix set_memory_x for ioremap, Ingo Molnar, (Mon Feb 11, 5:27 am)
Re: [PATCH] [4/8] CPA: Fix set_memory_x for ioremap, Andi Kleen, (Mon Feb 11, 5:45 am)
Re: [PATCH] [6/8] Account overlapped mappings in end_pfn_map, Arjan van de Ven, (Mon Feb 11, 8:12 am)
Re: [PATCH] [5/8] Fix logic error in 64bit memory hotadd, Yasunori Goto, (Tue Feb 12, 3:35 am)
Re: [PATCH] [7/8] Implement true end_pfn_mapped for 32bit, Thomas Gleixner, (Tue Feb 12, 12:39 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Thomas Gleixner, (Tue Feb 12, 1:04 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Andi Kleen, (Tue Feb 12, 1:23 pm)
Re: [PATCH] [7/8] Implement true end_pfn_mapped for 32bit, Thomas Gleixner, (Tue Feb 12, 1:25 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Thomas Gleixner, (Tue Feb 12, 1:48 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Andi Kleen, (Wed Feb 13, 4:05 am)