From patchwork Thu Aug 17 14:44:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9906503 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 E392C6038C for ; Thu, 17 Aug 2017 14:48:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D580A28B2C for ; Thu, 17 Aug 2017 14:48:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA38428B38; Thu, 17 Aug 2017 14:48:47 +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 7516528B2C for ; Thu, 17 Aug 2017 14:48:47 +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 1diM4H-0001t0-JQ; Thu, 17 Aug 2017 14:46:41 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diM4G-0001re-MZ for xen-devel@lists.xenproject.org; Thu, 17 Aug 2017 14:46:40 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id A7/13-02181-F4CA5995; Thu, 17 Aug 2017 14:46:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRWlGSWpSXmKPExsXitHRDpK7/mqm RBu3tohbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bPQ4eZCs5KVOy7co69gXGfUBcjJ4eEgL/E 4187mEFsNgFliZ+dvWwgtoiAnkTTgeeMXYxcHMwCcxglps7tYgRJCAu4Syw/8BmsgUVAVeLJ6 hNgNq+ApUTP1I2MEEPlJXa1XWQFsTmB4ocmLQarERKwkJj9oZ0dwlaQ6Jh+jAmiV1Di5MwnLC A2s4CExMEXL5gnMPLOQpKahSS1gJFpFaNGcWpRWWqRrpGhXlJRZnpGSW5iZo6uoYGxXm5qcXF iempOYlKxXnJ+7iZGYPjUMzAw7mDs2et3iFGSg0lJlPf3rCmRQnxJ+SmVGYnFGfFFpTmpxYcY ZTg4lCR4C1dPjRQSLEpNT61Iy8wBBjJMWoKDR0mEdz1Imre4IDG3ODMdInWKUZfj1YT/35iEW PLy81KlxHkjQYoEQIoySvPgRsCi6hKjrJQwLyMDA4MQT0FqUW5mCar8K0ZxDkYlYV5fkCk8mX klcJteAR3BBHTElfZJIEeUJCKkpBoYq46bFTY3HbmlfLHGN+do3YUdSh+9l+xwW524aLPhTYW /8qu5+6xDVe9s2bXuQ+bS9Q0OERuZ71Yy1iU7N2Qp/rC+F5Q399zfIrs1p/ZGBtzqs0nYr5n5 UKRmuwlfuQev1dzgZYr7diVOMckwffXiYerCB18Ke5RrojdfaZ58LOztO5301+LxSizFGYmGW sxFxYkAO/TCyaUCAAA= X-Env-Sender: prvs=395e6b081=wei.liu2@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1502981187!106404907!4 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 33876 invoked from network); 17 Aug 2017 14:46:39 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 17 Aug 2017 14:46:39 -0000 X-IronPort-AV: E=Sophos;i="5.41,388,1498521600"; d="scan'208";a="435893584" From: Wei Liu To: Xen-devel Date: Thu, 17 Aug 2017 15:44:47 +0100 Message-ID: <20170817144456.18989-23-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170817144456.18989-1-wei.liu2@citrix.com> References: <20170817144456.18989-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: George Dunlap , Andrew Cooper , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH v4 22/31] x86: add pv_ prefix to {alloc, free}_page_type 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP They are only useful for PV guests. Also change preemptible to bool. Signed-off-by: Wei Liu --- xen/arch/x86/domain.c | 2 +- xen/arch/x86/mm.c | 12 ++++++------ xen/include/asm-x86/mm.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 9a25c04f6c..8fae38485c 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1806,7 +1806,7 @@ static int relinquish_memory( if ( likely(y == x) ) { /* No need for atomic update of type_info here: noone else updates it. */ - switch ( ret = free_page_type(page, x, 1) ) + switch ( ret = pv_free_page_type(page, x, true) ) { case 0: break; diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 928f4330e7..1fdae6e1e6 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2006,8 +2006,8 @@ static void get_page_light(struct page_info *page) while ( unlikely(y != x) ); } -static int alloc_page_type(struct page_info *page, unsigned long type, - int preemptible) +static int pv_alloc_page_type(struct page_info *page, unsigned long type, + bool preemptible) { struct domain *owner = page_get_owner(page); int rc; @@ -2079,8 +2079,8 @@ static int alloc_page_type(struct page_info *page, unsigned long type, } -int free_page_type(struct page_info *page, unsigned long type, - int preemptible) +int pv_free_page_type(struct page_info *page, unsigned long type, + bool preemptible) { struct domain *owner = page_get_owner(page); unsigned long gmfn; @@ -2137,7 +2137,7 @@ int free_page_type(struct page_info *page, unsigned long type, static int __put_final_page_type( struct page_info *page, unsigned long type, int preemptible) { - int rc = free_page_type(page, type, preemptible); + int rc = pv_free_page_type(page, type, preemptible); /* No need for atomic update of type_info here: noone else updates it. */ if ( rc == 0 ) @@ -2353,7 +2353,7 @@ static int __get_page_type(struct page_info *page, unsigned long type, page->nr_validated_ptes = 0; page->partial_pte = 0; } - rc = alloc_page_type(page, type, preemptible); + rc = pv_alloc_page_type(page, type, preemptible); } if ( (x & PGT_partial) && !(nx & PGT_partial) ) diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 521a8b1b7b..a5662f327b 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -302,8 +302,8 @@ static inline void *__page_to_virt(const struct page_info *pg) (PAGE_SIZE / (sizeof(*pg) & -sizeof(*pg)))); } -int free_page_type(struct page_info *page, unsigned long type, - int preemptible); +int pv_free_page_type(struct page_info *page, unsigned long type, + bool preemptible); bool_t fill_ro_mpt(unsigned long mfn); void zap_ro_mpt(unsigned long mfn);