From patchwork Fri Aug 5 23:04:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9265787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED99C60839 for ; Fri, 5 Aug 2016 23:08:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBB0228462 for ; Fri, 5 Aug 2016 23:08:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D008C284A2; Fri, 5 Aug 2016 23:08:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5DBB628462 for ; Fri, 5 Aug 2016 23:08:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVoBh-0003Q5-9i; Fri, 05 Aug 2016 23:05:57 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVoBf-0003OX-Po for xen-devel@lists.xenproject.org; Fri, 05 Aug 2016 23:05:55 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id 40/B7-19922-3DB15A75; Fri, 05 Aug 2016 23:05:55 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsXSO6nOVfeS9NJ wgznzRS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyZ9z4xFpwTq5ixVKWB8YVgFyMXh5BAO5PE tbcNLBDOV0aJuUueMHUxcgI5GxglzrbZQ9gTGSWa+1xBbDYBHYmLXx6yg9giAkoS91ZNZgJpZ hY4yiTxf/JjVpCEsECkRO/m+0BTOThYBFQlVj5PBAnzCrhL9KzpAeuVEFCU6H42gQ3E5gSKz9 v4nA1il5vEx+75rBA1xhJ9s/pYJjDyLWBkWMWoXpxaVJZapGusl1SUmZ5RkpuYmaNraGCql5t aXJyYnpqTmFSsl5yfu4kRGCQMQLCDce8/p0OMkhxMSqK85y8vCRfiS8pPqcxILM6ILyrNSS0+ xCjDwaEkwTtVamm4kGBRanpqRVpmDjBcYdISHDxKIryzQNK8xQWJucWZ6RCpU4yKUuK850ASA iCJjNI8uDZYjFxilJUS5mUEOkSIpyC1KDezBFX+FaM4B6OSMMR4nsy8Erjpr4AWMwEt/mi1BG RxSSJCSqqBUbUq5lup8JaeUqOTM7cErmTM35c8VzzA+5a2tbVBSpvf/egJnv3bagwvz5y5TM/ p47P2B3KnZL9Mv/I4RuV0vG7gVpk1ciLMPvd2NT/j9X/3++hCg2mXmm7dFD3/0EpN1NvtrXzW xeNVQeGL1JxP3gqQkvo+3e/0fpvWyMM7d07O+Llx7tOZ1UosxRmJhlrMRcWJAK0HUriMAgAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1470438353!52950447!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64458 invoked from network); 5 Aug 2016 23:05:54 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Aug 2016 23:05:54 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u75N5l8b005492 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Aug 2016 23:05:47 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u75N5kcZ026933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Aug 2016 23:05:47 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u75N5k4i003511; Fri, 5 Aug 2016 23:05:46 GMT Received: from olila.local.net-space.pl (/10.175.255.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 05 Aug 2016 16:05:45 -0700 From: Daniel Kiper To: xen-devel@lists.xenproject.org Date: Sat, 6 Aug 2016 01:04:35 +0200 Message-Id: <1470438282-4226-13-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1470438282-4226-1-git-send-email-daniel.kiper@oracle.com> References: <1470438282-4226-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: jgross@suse.com, sstabellini@kernel.org, andrew.cooper3@citrix.com, cardoe@cardoe.com, pgnet.dev@gmail.com, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org Subject: [Xen-devel] [PATCH v4 12/19] efi: introduce EFI_RS to ease control on runtime services usage X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper --- xen/arch/x86/domain_page.c | 2 +- xen/arch/x86/shutdown.c | 2 +- xen/arch/x86/time.c | 2 +- xen/common/efi/boot.c | 4 ++++ xen/include/xen/efi.h | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c index 71ade05..7541b91 100644 --- a/xen/arch/x86/domain_page.c +++ b/xen/arch/x86/domain_page.c @@ -36,7 +36,7 @@ static inline struct vcpu *mapcache_current_vcpu(void) * domain's page tables but current may point at another domain's VCPU. * Return NULL as though current is not properly set up yet. */ - if ( efi_enabled(EFI_BOOT) && efi_rs_using_pgtables() ) + if ( efi_enabled(EFI_RS) && efi_rs_using_pgtables() ) return NULL; /* diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c index 7ce3761..b429fd0 100644 --- a/xen/arch/x86/shutdown.c +++ b/xen/arch/x86/shutdown.c @@ -119,7 +119,7 @@ void machine_halt(void) static void default_reboot_type(void) { if ( reboot_type == BOOT_INVALID ) - reboot_type = efi_enabled(EFI_BOOT) ? BOOT_EFI + reboot_type = efi_enabled(EFI_RS) ? BOOT_EFI : acpi_disabled ? BOOT_KBD : BOOT_ACPI; } diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index b2ecc8e..8d94530 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -686,7 +686,7 @@ static unsigned long get_cmos_time(void) static bool_t __read_mostly cmos_rtc_probe; boolean_param("cmos-rtc-probe", cmos_rtc_probe); - if ( efi_enabled(EFI_BOOT) ) + if ( efi_enabled(EFI_RS) ) { res = efi_get_time(); if ( res ) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index edd0434..dd6b0a8 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -936,6 +936,10 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) __set_bit(EFI_BOOT, &efi.flags); +#ifndef CONFIG_ARM /* Disabled until runtime services implemented. */ + __set_bit(EFI_RS, &efi.flags); +#endif + efi_init(ImageHandle, SystemTable); use_cfg_file = efi_arch_use_config_file(SystemTable); diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h index be18e4d..ba14472 100644 --- a/xen/include/xen/efi.h +++ b/xen/include/xen/efi.h @@ -12,6 +12,7 @@ struct efi { unsigned long flags; /* Bit fields representing available EFI features/properties */ #define EFI_BOOT 0 /* Were we booted from EFI? */ +#define EFI_RS 2 /* Can we use runtime services? */ unsigned long mps; /* MPS table */ unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ unsigned long acpi20; /* ACPI table (ACPI 2.0) */