From: Konrad Rzeszutek Wilk Subject: [PATCH v1 3/3] efi: Implement 'efi=attr' Xen command line to map Runtime services with no attributes. Date: Fri, 24 Apr 2015 16:47:20 -0400 Message-ID: <1429908440-13923-4-git-send-email-konrad.wilk@oracle.com> References: <1429908440-13923-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YlkVc-0005ly-Pk for xen-devel@lists.xenproject.org; Fri, 24 Apr 2015 20:47:36 +0000 Received: by qkx62 with SMTP id 62so37723476qkx.0 for ; Fri, 24 Apr 2015 13:47:34 -0700 (PDT) In-Reply-To: <1429908440-13923-1-git-send-email-konrad.wilk@oracle.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@lists.xenproject.org, olaf@aepfle.de, andrew.cooper3@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org 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 WB. We also alter the 'efi-rs' to be 'efi=rs' or 'efi=no-rs'. Signed-off-by: Konrad Rzeszutek Wilk --- docs/misc/xen-command-line.markdown | 18 +++++++++++++++--- xen/common/efi/boot.c | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index 1dda1f0..baf0a84 100644 --- a/docs/misc/xen-command-line.markdown +++ b/docs/misc/xen-command-line.markdown @@ -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 -> `= ` +### 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` + +> Default: `false` + +>> Allows mapping of RuntimeServices which have no cachability attribute +>> set as UC. ### extra\_guest\_irqs > `= [][,]` diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index cf3464b..753df91 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1105,7 +1105,33 @@ 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_attr; + +static void __init parse_efi_param(char *s) +{ + char *ss; + int val; + + do { + val = !!strncmp(s, "no-", 3); + if ( !val ) + s += 3; + + ss = strchr(s, ','); + if ( ss ) + *ss = '\0'; + + if ( !parse_bool(s) ) + efi_rs_enable = 0; + else if ( !strcmp(s, "rs") ) + efi_rs_enable = val; + else if ( !strcmp(s, "attr") ) + efi_attr = 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, @@ -1209,9 +1235,10 @@ 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 ? "assuming WB" : ""); + if ( !efi_attr ) + continue; } if ( desc->Attribute & EFI_MEMORY_WP ) -- 2.1.0