mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] EFI: Only set regions uncacheable if they support it
@ 2012-03-15 13:56 Matthew Garrett
  2012-03-15 14:00 ` H. Peter Anvin
  0 siblings, 1 reply; 13+ messages in thread
From: Matthew Garrett @ 2012-03-15 13:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: hpa, x86, matt.fleming, Matthew Garrett

The EFI memory region attributes field indicates whether the region can
be mapped with various cache attributes. Our current implementation always
marks regions uncacheable if they don't have the writeback support flag.
This causes us to mark some regions uncacheable even if they don't
indicate support for being uncacheable, triggering a clflush that may cause
an MCE. Ensure we only do this for regions which support it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 arch/x86/platform/efi/efi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 4cf9bd0..12f78e1 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -682,7 +682,8 @@ void __init efi_enter_virtual_mode(void)
 			continue;
 		}
 
-		if (!(md->attribute & EFI_MEMORY_WB)) {
+		if (md->attribute & EFI_MEMORY_UC &&
+		    !(md->attribute & EFI_MEMORY_WB)) {
 			addr = md->virt_addr;
 			npages = md->num_pages;
 			memrange_efi_to_native(&addr, &npages);
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-03-15 14:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-15 13:56 [PATCH] EFI: Only set regions uncacheable if they support it Matthew Garrett
2012-03-15 14:00 ` H. Peter Anvin
2012-03-15 14:07   ` Matthew Garrett
2012-03-15 14:17     ` H. Peter Anvin
2012-03-15 14:24       ` Matthew Garrett
2012-03-15 14:28         ` H. Peter Anvin
2012-03-15 14:33           ` Matthew Garrett
2012-03-15 14:36             ` H. Peter Anvin
2012-03-15 14:42               ` Matthew Garrett
2012-03-15 14:47                 ` H. Peter Anvin
2012-03-15 14:54                   ` Matthew Garrett
2012-03-15 14:51                 ` Alan Cox
2012-03-15 14:54                 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®