From patchwork Fri Dec 13 19:37:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22356 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 495C0202E2 for ; Fri, 13 Dec 2013 19:38:10 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id jw12sf4472472veb.11 for ; Fri, 13 Dec 2013 11:38:10 -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=NQoHpv2q2sTAUyVhqwrCYySQMqm2BZif+rhn1juckOh1sQ0hJs4ata7y6W6LC7gmdY 9N42j+z3Ky9UE7bzioa3zCz3GP2J9bFFWmDWS2D1GAfuvl0a4h6bvSEEtudICIsfCpOB WHw7bu7OKC4TN7a6O3V34RAHrP3moGCz/SLYfCg+Y96pbqrdFofFUrSK9l02mPbKCOqY GyHJ351Qg5hCeCmEMV9yiNf7+7RriEIaB/Fs3LXa3GtLWiOdu7KOVTOdtiDGxnGqGqNG lkrq9Za/vqDiZdjE1bZipMMTy2tM1IM/1g8rRxOi+zxKz0AC65FMBnEoWm0e8j7gLBjN NXDQ== X-Gm-Message-State: ALoCoQmRMRULJhF05mw2Onw5XKO3ONKG47OcL7cGBumiTj0zbF1s126tR07+uIuQPP7SW2/C3exe X-Received: by 10.236.20.114 with SMTP id o78mr1388204yho.8.1386963490114; Fri, 13 Dec 2013 11:38:10 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.99 with SMTP id nf3ls1166329qeb.30.gmail; Fri, 13 Dec 2013 11:38:10 -0800 (PST) X-Received: by 10.58.37.67 with SMTP id w3mr2005614vej.22.1386963489980; Fri, 13 Dec 2013 11:38:09 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id 8si1082410vct.18.2013.12.13.11.38.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:38:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so1710774veb.35 for ; Fri, 13 Dec 2013 11:38:09 -0800 (PST) X-Received: by 10.220.199.5 with SMTP id eq5mr2019025vcb.16.1386963489900; Fri, 13 Dec 2013 11:38:09 -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 u4csp64187vcz; Fri, 13 Dec 2013 11:38:09 -0800 (PST) X-Received: by 10.14.9.131 with SMTP id 3mr4568622eet.45.1386963489057; Fri, 13 Dec 2013 11:38:09 -0800 (PST) Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by mx.google.com with ESMTPS id e2si3129990eeg.198.2013.12.13.11.38.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:38:09 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.49 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.49; Received: by mail-ee0-f49.google.com with SMTP id c41so1064309eek.22 for ; Fri, 13 Dec 2013 11:38:08 -0800 (PST) X-Received: by 10.14.32.132 with SMTP id o4mr4697362eea.14.1386963488639; Fri, 13 Dec 2013 11:38:08 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id m1sm10199792eeg.0.2013.12.13.11.38.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2013 11:38:07 -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 v4 03/11] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Date: Fri, 13 Dec 2013 19:37:33 +0000 Message-Id: <1386963461-6520-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386963461-6520-1-git-send-email-julien.grall@linaro.org> References: <1386963461-6520-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.128.176 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)