From patchwork Sun Jul 30 15:43:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9870537 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 D7A3560353 for ; Sun, 30 Jul 2017 15:46:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD8A12856D for ; Sun, 30 Jul 2017 15:46:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1812285A0; Sun, 30 Jul 2017 15:46:29 +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 25C6B2856D for ; Sun, 30 Jul 2017 15:46:28 +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 1dbqNc-0006MI-GE; Sun, 30 Jul 2017 15:43:44 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbqNa-0006LE-JA for xen-devel@lists.xenproject.org; Sun, 30 Jul 2017 15:43:42 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id F6/C7-22472-DAEFD795; Sun, 30 Jul 2017 15:43:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsXitHSDve6af7W RBm83alh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBm7Zi9mLTgrUfHj8TH2BsZ9Ql2MnBwSAv4S t89MYwSx2QSUJX529rKB2CICehJNB54Dxbk4mAXmMEpMndsF5HBwCAv4SnxY7AdSwyKgKnHn2 hFmEJtXwELi4/onbBAz5SV2tV1kBbE5BSwlNi3pYgKxhQRSJc4cW8EOYStIdEw/xgTRKyhxcu YTFhCbWUBC4uCLF8wTGHlnIUnNQpJawMi0ilGjOLWoLLVI18hML6koMz2jJDcxM0fX0MBYLze 1uDgxPTUnMalYLzk/dxMjMHjqGRgYdzA27PU7xCjJwaQkyruOuzZSiC8pP6UyI7E4I76oNCe1 +BCjDAeHkgTvh79AOcGi1PTUirTMHGAYw6QlOHiURHh5gKEsxFtckJhbnJkOkTrFqMvxasL/b 0xCLHn5ealS4ry/QGYIgBRllObBjYDF1CVGWSlhXkYGBgYhnoLUotzMElT5V4ziHIxKwryLQK bwZOaVwG16BXQEE9ARkqVgR5QkIqSkGhhn5HFvUIhp+qwmcz91g5tZU3Tt9/qHVyI1655bXMn OWPDQ+ctv3wVPv/ndrbtUcWbttew4Uw/bA282VLzZ6zZl5qmNIgGc5T8TV03glD3Qdcf10eW2 qGVF/HZPJmbbX9vf9yO++nvgKSkOvxs/Ztc81Ilp+ZNr+/zkispzgslx7ja1l0x/2cxWYinOS DTUYi4qTgQAYDhFTqQCAAA= X-Env-Sender: prvs=37723ee83=wei.liu2@citrix.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1501429419!103196474!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47792 invoked from network); 30 Jul 2017 15:43:40 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-13.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 30 Jul 2017 15:43:40 -0000 X-IronPort-AV: E=Sophos;i="5.40,437,1496102400"; d="scan'208";a="441941021" From: Wei Liu To: Xen-devel Date: Sun, 30 Jul 2017 16:43:25 +0100 Message-ID: <20170730154335.24313-2-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170730154335.24313-1-wei.liu2@citrix.com> References: <20170720160426.2343-1-wei.liu2@citrix.com> <20170730154335.24313-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: George Dunlap , Andrew Cooper , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH v3 extra 01/11] 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 93014d9bbc..d92a930d29 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1807,7 +1807,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 9b6871ab04..a908d70dea 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2010,8 +2010,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; @@ -2083,8 +2083,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; @@ -2141,7 +2141,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 ) @@ -2357,7 +2357,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);