]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
EFI: support default attributes to map Runtime service areas with none given
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 10 Jun 2015 10:04:07 +0000 (12:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 10 Jun 2015 10:04:07 +0000 (12:04 +0200)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

For example on Dell machines we see:

(XEN)  00000fed18000-00000fed19fff type=11 attr=8000000000000000
(XEN) Unknown cachability for MFNs 0xfed18-0xfed19

Let's allow them to be mapped as UC.

We also alter the 'efi-rs' to be 'efi=rs' or 'efi=no-rs'.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
docs/misc/xen-command-line.markdown
xen/common/efi/boot.c

index 4889e27626d43ba5339d71e6d7da6dbdec7c3aa7..aa684c0747527d92ad955e359377273f5ee6cc31 100644 (file)
@@ -617,12 +617,24 @@ Either force retrieval of monitor EDID information via VESA DDC, or
 disable it (edid=no). This option should not normally be required
 except for debugging purposes.
 
-### efi-rs
-> `= <boolean>`
+### efi
+> `= List of [ rs | attr ]`
+
+All options are of boolean kind and can be prefixed with `no-` to
+effect the inverse meaning.
+
+> `rs`
 
 > Default: `true`
 
-Force or disable use of EFI runtime services.
+>> Force or disable use of EFI runtime services.
+
+> `attr=uc`
+
+> Default: `off`
+
+>> Allows mapping of RuntimeServices which have no cachability attribute
+>> set as UC.
 
 ### extra\_guest\_irqs
 > `= [<domU number>][,<dom0 number>]`
index 6ce554db83b1635d46cd0e7e787d657ad041c864..bba434520b91643c45a158e2b8a4c0587d1ffc37 100644 (file)
@@ -1107,7 +1107,31 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 #ifndef CONFIG_ARM /* TODO - runtime service support */
 
 static bool_t __initdata efi_rs_enable = 1;
-boolean_param("efi-rs", efi_rs_enable);
+static bool_t __initdata efi_map_uc;
+
+static void __init parse_efi_param(char *s)
+{
+    char *ss;
+
+    do {
+        bool_t val = !!strncmp(s, "no-", 3);
+
+        if ( !val )
+            s += 3;
+
+        ss = strchr(s, ',');
+        if ( ss )
+            *ss = '\0';
+
+        if ( !strcmp(s, "rs") )
+            efi_rs_enable = val;
+        else if ( !strcmp(s, "attr=uc") )
+            efi_map_uc = val;
+
+        s = ss + 1;
+    } while ( ss );
+}
+custom_param("efi", parse_efi_param);
 
 #ifndef USE_SET_VIRTUAL_ADDRESS_MAP
 static __init void copy_mapping(unsigned long mfn, unsigned long end,
@@ -1205,9 +1229,11 @@ 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_map_uc ? ", assuming UC" : "");
+            if ( !efi_map_uc )
+                continue;
+            prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
         }
 
         if ( desc->Attribute & EFI_MEMORY_WP )