From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH 3/4] EFI: support default attributes to map Runtime service areas with none given Date: Tue, 09 Jun 2015 14:53:42 +0100 Message-ID: <55770C070200007800082A47@mail.emea.novell.com> References: <55770B190200007800082A2C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part52667CF6.0__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z2JyP-0005id-8Y for xen-devel@lists.xenproject.org; Tue, 09 Jun 2015 13:53:49 +0000 In-Reply-To: <55770B190200007800082A2C@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: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part52667CF6.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline From: Konrad Rzeszutek Wilk For example on Dell machines we see: (XEN) 00000fed18000-00000fed19fff type=3D11 attr=3D8000000000000000 (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=3Drs' or 'efi=3Dno-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=3Dno). This option should not normally be required except for debugging purposes. =20 -### efi-rs -> `=3D ` +### efi +> `=3D List of [ rs | attr ]` + +All options are of boolean kind and can be prefixed with `no-` to +effect the inverse meaning. + +> `rs` =20 > Default: `true` =20 -Force or disable use of EFI runtime services. +>> Force or disable use of EFI runtime services. + +> `attr=3Duc` + +> Default: `off` + +>> Allows mapping of RuntimeServices which have no cachability attribute +>> set as UC. =20 ### extra\_guest\_irqs > `=3D [][,]` --- 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 */ =20 static bool_t __initdata efi_rs_enable =3D 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 =3D !!strncmp(s, "no-", 3); + + if ( !val ) + s +=3D 3; + + ss =3D strchr(s, ','); + if ( ss ) + *ss =3D '\0'; + + if ( !strcmp(s, "rs") ) + efi_rs_enable =3D val; + else if ( !strcmp(s, "attr=3Duc") ) + efi_map_uc =3D val; + + s =3D ss + 1; + } while ( ss ); +} +custom_param("efi", parse_efi_param); =20 #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 |=3D _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 |=3D _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES; } =20 if ( desc->Attribute & EFI_MEMORY_WP ) --=__Part52667CF6.0__= Content-Type: text/plain; name="EFI-default-map-attr.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="EFI-default-map-attr.patch" EFI: support default attributes to map Runtime service areas with none = given=0A=0AFrom: Konrad Rzeszutek Wilk =0A=0AFor = example on Dell machines we see:=0A=0A(XEN) 00000fed18000-00000fed19fff = type=3D11 attr=3D8000000000000000=0A(XEN) Unknown cachability for MFNs = 0xfed18-0xfed19=0A=0ALet's allow them to be mapped as UC.=0A=0AWe also = alter the 'efi-rs' to be 'efi=3Drs' or 'efi=3Dno-rs'.=0A=0ASigned-off-by: = Konrad Rzeszutek Wilk =0ASigned-off-by: Jan = Beulich =0A=0A--- a/docs/misc/xen-command-line.markdown= =0A+++ b/docs/misc/xen-command-line.markdown=0A@@ -617,12 +617,24 @@ = Either force retrieval of monitor EDID i=0A disable it (edid=3Dno). This = option should not normally be required=0A except for debugging purposes.=0A= =0A-### efi-rs=0A-> `=3D `=0A+### efi=0A+> `=3D List of [ rs | = attr ]`=0A+=0A+All options are of boolean kind and can be prefixed with = `no-` to=0A+effect the inverse meaning.=0A+=0A+> `rs`=0A =0A > Default: = `true`=0A =0A-Force or disable use of EFI runtime services.=0A+>> Force or = disable use of EFI runtime services.=0A+=0A+> `attr=3Duc`=0A+=0A+> = Default: `off`=0A+=0A+>> Allows mapping of RuntimeServices which have no = cachability attribute=0A+>> set as UC.=0A =0A ### extra\_guest\_irqs=0A > = `=3D [][,]`=0A--- a/xen/common/efi/boot.c=0A+++ = b/xen/common/efi/boot.c=0A@@ -1100,7 +1100,31 @@ efi_start(EFI_HANDLE = ImageHandle, EFI_SY=0A #ifndef CONFIG_ARM /* TODO - runtime service = support */=0A =0A static bool_t __initdata efi_rs_enable =3D 1;=0A-boolean_= param("efi-rs", efi_rs_enable);=0A+static bool_t __initdata efi_map_uc;=0A+= =0A+static void __init parse_efi_param(char *s)=0A+{=0A+ char = *ss;=0A+=0A+ do {=0A+ bool_t val =3D !!strncmp(s, "no-", = 3);=0A+=0A+ if ( !val )=0A+ s +=3D 3;=0A+=0A+ ss = =3D strchr(s, ',');=0A+ if ( ss )=0A+ *ss =3D = '\0';=0A+=0A+ if ( !strcmp(s, "rs") )=0A+ efi_rs_enable = =3D val;=0A+ else if ( !strcmp(s, "attr=3Duc") )=0A+ = efi_map_uc =3D val;=0A+=0A+ s =3D ss + 1;=0A+ } while ( ss = );=0A+}=0A+custom_param("efi", parse_efi_param);=0A =0A #ifndef USE_SET_VIR= TUAL_ADDRESS_MAP=0A static __init void copy_mapping(unsigned long mfn, = unsigned long end,=0A@@ -1198,9 +1222,11 @@ void __init efi_init_memory(voi= d)=0A prot |=3D _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;=0A = else=0A {=0A- printk(XENLOG_ERR "Unknown cachabilit= y for MFNs %#lx-%#lx\n",=0A- smfn, emfn - 1);=0A- = continue;=0A+ printk(XENLOG_ERR "Unknown cachability for = MFNs %#lx-%#lx%s\n",=0A+ smfn, emfn - 1, efi_map_uc ? ", = assuming UC" : "");=0A+ if ( !efi_map_uc )=0A+ = continue;=0A+ prot |=3D _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;= =0A }=0A =0A if ( desc->Attribute & EFI_MEMORY_WP )=0A --=__Part52667CF6.0__= 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 --=__Part52667CF6.0__=--