From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 3/4] EFI: support default attributes to map Runtime service areas with none given Date: Tue, 9 Jun 2015 15:08:55 +0100 Message-ID: <5576F377.2020505@citrix.com> References: <55770B190200007800082A2C@mail.emea.novell.com> <55770C070200007800082A47@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2742438144937698999==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z2KE9-0008Aa-Oz for xen-devel@lists.xenproject.org; Tue, 09 Jun 2015 14:10:05 +0000 In-Reply-To: <55770C070200007800082A47@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org --===============2742438144937698999== Content-Type: multipart/alternative; boundary="------------000708060809090200000109" --------------000708060809090200000109 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit On 09/06/15 14:53, Jan Beulich wrote: > From: Konrad Rzeszutek Wilk > > 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 > Signed-off-by: Jan Beulich > > --- a/docs/misc/xen-command-line.markdown > +++ b/docs/misc/xen-command-line.markdown > @@ -617,12 +617,24 @@ Either force retrieval of monitor EDID i > disable it (edid=no). This option should not normally be required > except for debugging purposes. > > -### efi-rs > -> `= ` > +### 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` `false` would be more consistent with the rest of the rest of the document. Otherwise, Reviewed-by: Andrew Cooper > + > +>> Allows mapping of RuntimeServices which have no cachability attribute > +>> set as UC. > > ### extra\_guest\_irqs > > `= [][,]` > --- a/xen/common/efi/boot.c > +++ b/xen/common/efi/boot.c > @@ -1100,7 +1100,31 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY > #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, > @@ -1198,9 +1222,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 ) > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------000708060809090200000109 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: 7bit
On 09/06/15 14:53, Jan Beulich wrote:
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>

--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -617,12 +617,24 @@ Either force retrieval of monitor EDID i
 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`

`false` would be more consistent with the rest of the rest of the document.

Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

+
+>> Allows mapping of RuntimeServices which have no cachability attribute
+>> set as UC.
 
 ### extra\_guest\_irqs
 > `= [<domU number>][,<dom0 number>]`
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1100,7 +1100,31 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
 #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,
@@ -1198,9 +1222,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 )





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------000708060809090200000109-- --===============2742438144937698999== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2742438144937698999==--