From 9e7d26786c006f7fa5eb8165b4fad182f75f988e Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Tue, 3 Feb 2015 15:57:54 -0500 Subject: [PATCH 3/3] efi: Implement 'efi-attr-uc=1' Xen command line to map Runtime services with no attribute. For example on Dell machines we see: (XEN) 00000fed18000-00000fed19fff type=11 attr=8000000000000000 (XEN) Unknown cachability for MFNs 0xfed18-0xfed19 Lets allow them to be mapped as UC with said attribute. Signed-off-by: Konrad Rzeszutek Wilk --- xen/common/efi/boot.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index ec98914..724f75c 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1264,6 +1264,9 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) static bool_t __initdata efi_rs_enable = 1; boolean_param("efi-rs", efi_rs_enable); +static bool_t __initdata efi_attr_uc = 1; +boolean_param("efi-attr-uc", efi_attr_uc); + #ifndef USE_SET_VIRTUAL_ADDRESS_MAP static __init void copy_mapping(unsigned long mfn, unsigned long end, bool_t (*is_valid)(unsigned long smfn, @@ -1373,9 +1376,12 @@ void __init efi_init_memory(void) prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES; else { - printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx\n", - smfn, emfn - 1); - continue; + printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx %s\n", + smfn, emfn - 1, efi_attr_uc ? "assuming UC" : ""); + if ( efi_attr_uc ) + prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES; + else + continue; } if ( desc->Attribute & EFI_MEMORY_WP ) -- 2.1.0