From patchwork Sat Jan 23 08:00:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 60232 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp326350lbb; Sat, 23 Jan 2016 00:03:01 -0800 (PST) X-Received: by 10.28.142.8 with SMTP id q8mr7466462wmd.47.1453536181741; Sat, 23 Jan 2016 00:03:01 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id g23si9522278wmi.89.2016.01.23.00.03.01 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Jan 2016 00:03:01 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMt8Z-00024u-R1; Sat, 23 Jan 2016 08:01:35 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMt8Y-000245-1q for xen-devel@lists.xen.org; Sat, 23 Jan 2016 08:01:34 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 67/2C-02940-D5333A65; Sat, 23 Jan 2016 08:01:33 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-16.tower-31.messagelabs.com!1453536086!10169083!1 X-Originating-IP: [58.251.152.64] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31946 invoked from network); 23 Jan 2016 08:01:31 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-16.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jan 2016 08:01:31 -0000 Received: from 172.24.1.49 (EHLO szxeml433-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DDP78224; Sat, 23 Jan 2016 16:00:51 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml433-hub.china.huawei.com (10.82.67.210) with Microsoft SMTP Server id 14.3.235.1; Sat, 23 Jan 2016 16:00:39 +0800 From: Shannon Zhao To: Date: Sat, 23 Jan 2016 16:00:15 +0800 Message-ID: <1453536020-16196-4-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1453536020-16196-1-git-send-email-zhaoshenglong@huawei.com> References: <1453536020-16196-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.56A33333.0032, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: bc58f8a97d4f2d758a08d1416b25c72c Cc: ian.campbell@citrix.com, peter.huangpeng@huawei.com, julien.grall@citrix.com, stefano.stabellini@citrix.com, shannon.zhao@linaro.org, Jan Beulich Subject: [Xen-devel] [PATCH v5 3/8] acpi: Refactor acpi_os_map_memory to be architecturally independent X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org From: Shannon Zhao The first Mb handling is not necessary and the attribute of __vmap() is different for ARM. Factor the first Mb handling only for x86 and define a mapping attribute for each architecture. Cc: Jan Beulich Signed-off-by: Shannon Zhao --- v5: only factor the first Mb handling and the attribute of __vmap() --- xen/drivers/acpi/osl.c | 11 +++++++---- xen/include/asm-x86/acpi.h | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) -- 2.0.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c index a2fc8c4..63a4b1f 100644 --- a/xen/drivers/acpi/osl.c +++ b/xen/drivers/acpi/osl.c @@ -92,11 +92,14 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size) mfn_t mfn = _mfn(PFN_DOWN(phys)); unsigned int offs = phys & (PAGE_SIZE - 1); - /* The low first Mb is always mapped. */ - if ( !((phys + size - 1) >> 20) ) - return __va(phys); + if (IS_ENABLED(CONFIG_X86)) { + /* The low first Mb is always mapped. */ + if ( !((phys + size - 1) >> 20) ) + return __va(phys); + } + return __vmap(&mfn, PFN_UP(offs + size), 1, 1, - PAGE_HYPERVISOR_NOCACHE) + offs; + ACPI_MAP_MEM_ATTR) + offs; } return __acpi_map_table(phys, size); } diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index d3bde78..d532e3d 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -163,4 +163,6 @@ void hvm_acpi_sleep_button(struct domain *d); void save_rest_processor_state(void); void restore_rest_processor_state(void); +#define ACPI_MAP_MEM_ATTR PAGE_HYPERVISOR_NOCACHE + #endif /*__X86_ASM_ACPI_H*/