From patchwork Mon Dec 16 17:37:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22531 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B5AE23FF1 for ; Mon, 16 Dec 2013 17:37:41 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf18511168obc.7 for ; Mon, 16 Dec 2013 09:37:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=tZuxUtM9PDloPADkPC/3qDd2CfCCmASpUZodHXiB2t0=; b=VUJbRI8bMabPsWQvDI/mAoCOepkipUCo2cC2Gtpik1wkTrT7jqWMSJJArGqv5Hn9U6 gb5yxDwM6fxboVbojrzK92l6dl1fhk8+g5x49dF9by3kFm9wRZhrHqxhG05tsN17m2rD W9dcqdszPfNz+1NnXCb6gpKpAnsCwXmUc23wtTXOHJLgJ9Z/GzMGIN+XdP/pRj71hEo+ lXFA+2rQV+sGQE9kHyNO7d4MfJPZnTSUKOL+Pj8WdCdaaMMqqe8t+XkTYJLeE+gkesF6 bLQcCJPUdhYEILTPSLi5fSXKfI8M5qNMmFpdfPhcg2u5WEMSQkc/isX8ZNaa8SvM382m 8amQ== X-Gm-Message-State: ALoCoQlY0+vf+RlDSHpOZQamxAPYlUmeb2GdKoBWYRxp1Y/2KY93gYrm1OpTaQ6M2BfqbK09tIMX X-Received: by 10.182.33.6 with SMTP id n6mr6424125obi.6.1387215461054; Mon, 16 Dec 2013 09:37:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.110.198 with SMTP id ic6ls2294333qeb.29.gmail; Mon, 16 Dec 2013 09:37:40 -0800 (PST) X-Received: by 10.221.29.8 with SMTP id rw8mr820495vcb.56.1387215460938; Mon, 16 Dec 2013 09:37:40 -0800 (PST) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id a6si4149311vdp.52.2013.12.16.09.37.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 09:37:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ie18so3368992vcb.38 for ; Mon, 16 Dec 2013 09:37:40 -0800 (PST) X-Received: by 10.52.165.131 with SMTP id yy3mr7482505vdb.25.1387215460850; Mon, 16 Dec 2013 09:37:40 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp6109vcz; Mon, 16 Dec 2013 09:37:40 -0800 (PST) X-Received: by 10.14.9.68 with SMTP id 44mr10014657ees.105.1387215459894; Mon, 16 Dec 2013 09:37:39 -0800 (PST) Received: from mail-ea0-f181.google.com (mail-ea0-f181.google.com [209.85.215.181]) by mx.google.com with ESMTPS id t6si1754644eeh.45.2013.12.16.09.37.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 09:37:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.181 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.181; Received: by mail-ea0-f181.google.com with SMTP id m10so2371885eaj.26 for ; Mon, 16 Dec 2013 09:37:39 -0800 (PST) X-Received: by 10.14.215.67 with SMTP id d43mr10176010eep.108.1387215459259; Mon, 16 Dec 2013 09:37:39 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id e3sm44674680eeg.11.2013.12.16.09.37.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2013 09:37:38 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, tim@xen.org, stefano.stabellini@citrix.com, Julien Grall Subject: [PATCH v5 02/10] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Date: Mon, 16 Dec 2013 17:37:24 +0000 Message-Id: <1387215452-10951-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> References: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The function mfn_to_p2m_entry will be extended in a following patch to handle p2m_type_t. It will break compilation because p2m_type_t is not defined (interdependence between includes). It's easier to move the function in arch/arm/p2m.c and it's not harmful as the function is only used in this file. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/p2m.c | 22 ++++++++++++++++++++++ xen/include/asm-arm/page.h | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 083f8bf..74636df 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -128,6 +128,28 @@ int p2m_pod_decrease_reservation(struct domain *d, return -ENOSYS; } +static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr) +{ + paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT; + lpae_t e = (lpae_t) { + .p2m.xn = 0, + .p2m.af = 1, + .p2m.sh = LPAE_SH_OUTER, + .p2m.read = 1, + .p2m.write = 1, + .p2m.mattr = mattr, + .p2m.table = 1, + .p2m.valid = 1, + }; + + ASSERT(!(pa & ~PAGE_MASK)); + ASSERT(!(pa & ~PADDR_MASK)); + + e.bits |= pa; + + return e; +} + /* Allocate a new page table page and hook it in via the given entry */ static int p2m_create_table(struct domain *d, lpae_t *entry) diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h index d468418..0625464 100644 --- a/xen/include/asm-arm/page.h +++ b/xen/include/asm-arm/page.h @@ -213,28 +213,6 @@ static inline lpae_t mfn_to_xen_entry(unsigned long mfn) return e; } -static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr) -{ - paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT; - lpae_t e = (lpae_t) { - .p2m.xn = 0, - .p2m.af = 1, - .p2m.sh = LPAE_SH_OUTER, - .p2m.write = 1, - .p2m.read = 1, - .p2m.mattr = mattr, - .p2m.table = 1, - .p2m.valid = 1, - }; - - ASSERT(!(pa & ~PAGE_MASK)); - ASSERT(!(pa & ~PADDR_MASK)); - - e.bits |= pa; - - return e; -} - #if defined(CONFIG_ARM_32) # include #elif defined(CONFIG_ARM_64)