From patchwork Mon Sep 11 04:37:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9946581 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 A1D5A6035D for ; Mon, 11 Sep 2017 04:41:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98B37289DE for ; Mon, 11 Sep 2017 04:41:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D65028AD9; Mon, 11 Sep 2017 04:41:43 +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 1A64C289DE for ; Mon, 11 Sep 2017 04:41:43 +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 1drGUk-00016K-Vo; Mon, 11 Sep 2017 04:38:50 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drGUk-000163-7R for xen-devel@lists.xen.org; Mon, 11 Sep 2017 04:38:50 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id DF/FB-03422-95316B95; Mon, 11 Sep 2017 04:38:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsXS1tYhohsuvC3 S4O8sE4slHxezODB6HN39mymAMYo1My8pvyKBNeP79o+MBcs5KvqPHGJtYPzJ1sXIxSEkMJ1R 4u33tyxdjJwcEgK8EkeWzWCFsAMkFj56yQJR1Mso0dqzhRkkwSagL7Hi8UGwIhEBaYlrny8zg tjMAg1MEm//FoHYwgI5EvvfrQEbyiKgKtH16Tg7iM0rYCvx99trqGXyErvaLoLN4RSwkzj48h 3YfCGgmgWnF7BOYORdwMiwilGjOLWoLLVI19hYL6koMz2jJDcxM0fX0MBMLze1uDgxPTUnMal YLzk/dxMjMCAYgGAH4871gYcYJTmYlER53x3fEinEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgldF aFukkGBRanpqRVpmDjA0YdISHDxKIryLBIHSvMUFibnFmekQqVOMuhwdN+/+YRJiycvPS5US5 5UDmSEAUpRRmgc3AhYnlxhlpYR5GYGOEuIpSC3KzSxBlX/FKM7BqCTMew9kFU9mXgncpldARz ABHcFzaQvIESWJCCmpBkZLE3eVhbwRE//+Fjga03jJ9FFOllKdRfribccr5rUW+6hL/kvjc7+ 71/Y4z3XVN0UC0yZYc6R6MUeqXmRKmtnF5z7l/btG49+u+dUdBvNM+u+n77namsDzeoMVd8WG uOtBnG/4ph5R/KdVUnG3k61bvW7vwcit3+/ceZmUvcryf2tujNMdbyWW4oxEQy3mouJEAPT3M wqOAgAA X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1505104724!103626684!2 X-Originating-IP: [134.134.136.20] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzU1MzU4\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64174 invoked from network); 11 Sep 2017 04:38:47 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 11 Sep 2017 04:38:47 -0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2017 21:38:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,376,1500966000"; d="scan'208"; a="1217078238" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.142]) by fmsmga002.fm.intel.com with ESMTP; 10 Sep 2017 21:38:44 -0700 From: Haozhong Zhang To: xen-devel@lists.xen.org Date: Mon, 11 Sep 2017 12:37:43 +0800 Message-Id: <20170911043820.14617-3-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170911043820.14617-1-haozhong.zhang@intel.com> References: <20170911043820.14617-1-haozhong.zhang@intel.com> Cc: Haozhong Zhang , Andrew Cooper , Jan Beulich , Chao Peng , Dan Williams Subject: [Xen-devel] [RFC XEN PATCH v3 02/39] x86_64/mm: drop redundant MFN to page conventions in cleanup_frame_table() 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 Replace pdx_to_page(pfn_to_pdx(pfn)) by mfn_to_page(pfn), which is identical to the former. Signed-off-by: Haozhong Zhang Reviewed-by: Andrew Cooper --- Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/x86_64/mm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 6c5221f90c..c93383d7d9 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -720,12 +720,11 @@ static void cleanup_frame_table(struct mem_hotadd_info *info) spfn = info->spfn; epfn = info->epfn; - sva = (unsigned long)pdx_to_page(pfn_to_pdx(spfn)); - eva = (unsigned long)pdx_to_page(pfn_to_pdx(epfn)); + sva = (unsigned long)mfn_to_page(spfn); + eva = (unsigned long)mfn_to_page(epfn); /* Intialize all page */ - memset(mfn_to_page(spfn), -1, - (unsigned long)mfn_to_page(epfn) - (unsigned long)mfn_to_page(spfn)); + memset((void *)sva, -1, eva - sva); while (sva < eva) {