From patchwork Thu Dec 5 15:42:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22072 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2DBED202E0 for ; Thu, 5 Dec 2013 15:42:30 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wo20sf56074980obc.5 for ; Thu, 05 Dec 2013 07:42:29 -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=jXWwcEIZ6Kz8GMBwVT3U5Aq4YQ5+si6QjhOoUtFFXiw=; b=V9NxGiFF0bCWtiyMCDi3BNo8znILSJM6rODHTFdRaNO8swvNH1QT1jo2I0FEdWnUF9 u6QijBdQa3+HjrAlKkNU5amXj+261jOjBDOukHoa4xzqvxyFUH9UAC1bp8CmkFWGcyOd 384sgFRr0peUUwb/XHMI3P7LmmEbbECBHgCD7XdFMGynfKt/lc5dgpJ+1Pa6pYKAFD9n pklt45/jYO5wi2qORmHIH5toow6/ieJegAA5HfTEa+dBBlqfBK6790XbVtzbsRhBgSCO Hnrp5d3zV/asyMdOQUl77cUs54lG1iOcUvrtqc5FV7Ty+0dq7wXWJk05e9M696OaAbcr hG0A== X-Gm-Message-State: ALoCoQkMnGcytEA77TZqlCHo521EFElPFPdcvyASF5dEobmFjfUd/PgKb63dvGVB+YLFDys36/49 X-Received: by 10.182.19.164 with SMTP id g4mr13007918obe.21.1386258149510; Thu, 05 Dec 2013 07:42:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.5 with SMTP id ky5ls805851qeb.26.gmail; Thu, 05 Dec 2013 07:42:29 -0800 (PST) X-Received: by 10.52.166.47 with SMTP id zd15mr1090530vdb.77.1386258149355; Thu, 05 Dec 2013 07:42:29 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id a6si34796096vdp.13.2013.12.05.07.42.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:42:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 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.178; Received: by mail-ve0-f178.google.com with SMTP id c14so13721082vea.23 for ; Thu, 05 Dec 2013 07:42:29 -0800 (PST) X-Received: by 10.52.72.100 with SMTP id c4mr1037720vdv.86.1386258149116; Thu, 05 Dec 2013 07:42:29 -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 u4csp24831vcz; Thu, 5 Dec 2013 07:42:28 -0800 (PST) X-Received: by 10.180.73.70 with SMTP id j6mr12554889wiv.47.1386258148387; Thu, 05 Dec 2013 07:42:28 -0800 (PST) Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by mx.google.com with ESMTPS id q10si778749wie.31.2013.12.05.07.42.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:42:28 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.169 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.169; Received: by mail-we0-f169.google.com with SMTP id w61so11246247wes.0 for ; Thu, 05 Dec 2013 07:42:28 -0800 (PST) X-Received: by 10.180.90.65 with SMTP id bu1mr12716420wib.15.1386258147227; Thu, 05 Dec 2013 07:42:27 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id w20sm7350575wia.5.2013.12.05.07.42.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2013 07:42:25 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, time@xen.org, stefano.stabellini@citrix.com, Julien Grall Subject: [PATCH 2/8] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Date: Thu, 5 Dec 2013 15:42:05 +0000 Message-Id: <1386258131-755-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386258131-755-1-git-send-email-julien.grall@linaro.org> References: <1386258131-755-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.178 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. Acked-by: Ian Campbell Signed-off-by: Julien Grall --- 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 1d5c841..8f8b47e 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -124,6 +124,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)