From patchwork Wed Aug 30 18:32:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergej Proskurin X-Patchwork-Id: 9930577 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 0EB706032A for ; Wed, 30 Aug 2017 18:35:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06B0E285C8 for ; Wed, 30 Aug 2017 18:35:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFC8128717; Wed, 30 Aug 2017 18:35:40 +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 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 8BB79285C8 for ; Wed, 30 Aug 2017 18:35:40 +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 1dn7nx-0001ro-2M; Wed, 30 Aug 2017 18:33:33 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn7nu-0001hy-Oz for xen-devel@lists.xenproject.org; Wed, 30 Aug 2017 18:33:30 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 4E/41-02225-AF407A95; Wed, 30 Aug 2017 18:33:30 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRWlGSWpSXmKPExsXSPJ+BQ/cny/J Igwm7ZSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozOr/fYCnYpVfzs2szYwLhCsouRi0NIYCOj xOaHK9kgnE2MEhc73zN1MXJysAkYSEx5vZIVxBYRUJK4t2oyE0gRs0ATo8S9xgdsIAlhAVeJt z2X2UFsFgFViZ1N35lBbF4BW4nZz16xgNgSAvIS5x7cBotzAsXPHJgBNlRIwEbi3tzzzBMYuR cwMqxi1ChOLSpLLdI1NNBLKspMzyjJTczMAfKM9XJTi4sT01NzEpOK9ZLzczcxAn1cz8DAuIN xW5fzIUZJDiYlUd4VzMsjhfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwzgLJCRalpqdWpGXmAIMN Ji3BwaMkwtsNkuYtLkjMLc5Mh0idYlSUEuddDJIQAElklObBtcEC/BKjrJQwLyMDA4MQT0FqU W5mCar8K0ZxDkYlYd4TIFN4MvNK4Ka/AlrMBLQ41mspyOKSRISUVAPjwcPzJRtKFtpuubWSQW pNZO/WL8qaEQIidhMMTkl1iK+PXvrjxsVeIa69+syL9nduK4z6ct1gc+uLyU5+N3ltV/m47Jj mcCTuy5PY6bkXq0VPv9Y5G7f1MuNsp77p7zm4DRQ3l277aKfDeoeRg/3BItfND0IO5RdejxCY MGvOsuOv3L+fYDjlqcRSnJFoqMVcVJwIAOego/NrAgAA X-Env-Sender: proskurin@sec.in.tum.de X-Msg-Ref: server-13.tower-31.messagelabs.com!1504118009!107801001!1 X-Originating-IP: [131.159.0.8] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11310 invoked from network); 30 Aug 2017 18:33:29 -0000 Received: from mail-out1.informatik.tu-muenchen.de (HELO mail-out1.informatik.tu-muenchen.de) (131.159.0.8) by server-13.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Aug 2017 18:33:29 -0000 Received: from files.sec.in.tum.de (files.sec.in.tum.de [131.159.50.1]) by services.sec.in.tum.de (Postfix) with ESMTP id E475C10CB7DF8; Wed, 30 Aug 2017 20:33:08 +0200 (CEST) Received: from thanatos.sec.in.tum.de (thanatos.sec.in.tum.de [131.159.50.57]) by files.sec.in.tum.de (Postfix) with ESMTP id D6E03491F7; Wed, 30 Aug 2017 20:33:08 +0200 (CEST) From: Sergej Proskurin To: xen-devel@lists.xenproject.org Date: Wed, 30 Aug 2017 20:32:42 +0200 Message-Id: <20170830183258.14612-24-proskurin@sec.in.tum.de> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170830183258.14612-1-proskurin@sec.in.tum.de> References: <20170830183258.14612-1-proskurin@sec.in.tum.de> Cc: Sergej Proskurin , Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v4 23/39] arm/p2m: Cosmetic fix - function prototypes 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 This commit changes the prototypes of the following functions: - p2m_insert_mapping - p2m_remove_mapping These changes are required as our implementation reuses most of the existing ARM p2m implementation to set page table attributes of the individual altp2m views. Therefore, exiting function prototypes have been extended to hold another argument (of type struct p2m_domain *). This allows to specify the p2m/altp2m domain that should be processed by the individual function -- instead of accessing the host's default p2m domain. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Adoption of the functions "__p2m_lookup" and "__p2m_get_mem_access" have been moved out of this commit. --- xen/arch/arm/p2m.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 20d7784708..c5bf64aee0 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1012,13 +1012,12 @@ int p2m_set_entry(struct p2m_domain *p2m, return rc; } -static inline int p2m_insert_mapping(struct domain *d, +static inline int p2m_insert_mapping(struct p2m_domain *p2m, gfn_t start_gfn, unsigned long nr, mfn_t mfn, p2m_type_t t) { - struct p2m_domain *p2m = p2m_get_hostp2m(d); int rc; p2m_write_lock(p2m); @@ -1028,12 +1027,11 @@ static inline int p2m_insert_mapping(struct domain *d, return rc; } -static inline int p2m_remove_mapping(struct domain *d, +static inline int p2m_remove_mapping(struct p2m_domain *p2m, gfn_t start_gfn, unsigned long nr, mfn_t mfn) { - struct p2m_domain *p2m = p2m_get_hostp2m(d); int rc; p2m_write_lock(p2m); @@ -1050,7 +1048,7 @@ int map_regions_p2mt(struct domain *d, mfn_t mfn, p2m_type_t p2mt) { - return p2m_insert_mapping(d, gfn, nr, mfn, p2mt); + return p2m_insert_mapping(p2m_get_hostp2m(d), gfn, nr, mfn, p2mt); } int unmap_regions_p2mt(struct domain *d, @@ -1058,7 +1056,7 @@ int unmap_regions_p2mt(struct domain *d, unsigned long nr, mfn_t mfn) { - return p2m_remove_mapping(d, gfn, nr, mfn); + return p2m_remove_mapping(p2m_get_hostp2m(d), gfn, nr, mfn); } int map_mmio_regions(struct domain *d, @@ -1066,7 +1064,7 @@ int map_mmio_regions(struct domain *d, unsigned long nr, mfn_t mfn) { - return p2m_insert_mapping(d, start_gfn, nr, mfn, p2m_mmio_direct_dev); + return p2m_insert_mapping(p2m_get_hostp2m(d), start_gfn, nr, mfn, p2m_mmio_direct_dev); } int unmap_mmio_regions(struct domain *d, @@ -1074,7 +1072,7 @@ int unmap_mmio_regions(struct domain *d, unsigned long nr, mfn_t mfn) { - return p2m_remove_mapping(d, start_gfn, nr, mfn); + return p2m_remove_mapping(p2m_get_hostp2m(d), start_gfn, nr, mfn); } int map_dev_mmio_region(struct domain *d, @@ -1087,7 +1085,7 @@ int map_dev_mmio_region(struct domain *d, if ( !(nr && iomem_access_permitted(d, mfn_x(mfn), mfn_x(mfn) + nr - 1)) ) return 0; - res = p2m_insert_mapping(d, gfn, nr, mfn, p2m_mmio_direct_c); + res = p2m_insert_mapping(p2m_get_hostp2m(d), gfn, nr, mfn, p2m_mmio_direct_c); if ( res < 0 ) { printk(XENLOG_G_ERR "Unable to map MFNs [%#"PRI_mfn" - %#"PRI_mfn" in Dom%d\n", @@ -1104,13 +1102,13 @@ int guest_physmap_add_entry(struct domain *d, unsigned long page_order, p2m_type_t t) { - return p2m_insert_mapping(d, gfn, (1 << page_order), mfn, t); + return p2m_insert_mapping(p2m_get_hostp2m(d), gfn, (1 << page_order), mfn, t); } int guest_physmap_remove_page(struct domain *d, gfn_t gfn, mfn_t mfn, unsigned int page_order) { - return p2m_remove_mapping(d, gfn, (1 << page_order), mfn); + return p2m_remove_mapping(p2m_get_hostp2m(d), gfn, (1 << page_order), mfn); } static int p2m_alloc_table(struct p2m_domain *p2m)