From patchwork Sat Jan 30 09:47:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8170501 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 79A939FBE9 for ; Sat, 30 Jan 2016 09:54:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABB5620398 for ; Sat, 30 Jan 2016 09:54:24 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDF2A20396 for ; Sat, 30 Jan 2016 09:54:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aPSBs-0005Xn-6m; Sat, 30 Jan 2016 09:51:36 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aPSBq-0005XV-GU for xen-devel@lists.xen.org; Sat, 30 Jan 2016 09:51:34 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 3B/54-12072-5A78CA65; Sat, 30 Jan 2016 09:51:33 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1454147489!18628205!1 X-Originating-IP: [119.145.14.66] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NiA9PiA4NTI3\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12827 invoked from network); 30 Jan 2016 09:51:32 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-11.tower-31.messagelabs.com with SMTP; 30 Jan 2016 09:51:32 -0000 Received: from 172.24.1.50 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.50]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BVL85776; Sat, 30 Jan 2016 17:48:11 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Sat, 30 Jan 2016 17:48:04 +0800 From: Shannon Zhao To: Date: Sat, 30 Jan 2016 17:47:30 +0800 Message-ID: <1454147250-7704-4-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1454147250-7704-1-git-send-email-zhaoshenglong@huawei.com> References: <1454147250-7704-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.0A020203.56AC86DC.005B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a92f01f0bb28b400bc93c8b957d3b258 Cc: shannon.zhao@linaro.org, jbeulich@suse.com, peter.huangpeng@huawei.com Subject: [Xen-devel] [PATCH v6 3/3] 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Stefano Stabellini --- xen/drivers/acpi/osl.c | 6 +++--- xen/include/asm-x86/acpi.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c index 2f1d723..8a28d87 100644 --- a/xen/drivers/acpi/osl.c +++ b/xen/drivers/acpi/osl.c @@ -93,11 +93,11 @@ 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) ) + /* The low first Mb is always mapped on x86. */ + if (IS_ENABLED(CONFIG_X86) && !((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*/