From patchwork Tue Dec 17 16:27:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22599 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA27D23FC6 for ; Tue, 17 Dec 2013 16:28:14 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id h16sf23766905oag.4 for ; Tue, 17 Dec 2013 08:28:14 -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=QcVzAi5Y89krEtkPSIe3Cu6y18V8T+C9VZEdPpYaMYfEiLmIzLTYue8f2JsyA+H2UJ 5EPcBLp+y2beqqcakvYD+3QuNsJnCdLIoR0Iw5Ck5YTfeMAcFbYQFUc82isXuhE9I629 AxAcX76R5DfDM4UKSEQgq3V4ageKLFQ1pIBUl4eILC7u1le9wjXYve6yKo4r4waDU+Vw QUsurY8rSBSW4jXWec0FdBcpwPesInGPCvu7Gnk1LgIueyYG3Qkh2LRbvdrWafaEfJ4I 8ZR+L3gXKI/ZHumWP/WkBwteA2j4cntNSIO0uDxeWjre8AZsrgJrIuTxPu5R5q1/xgow Zfwg== X-Gm-Message-State: ALoCoQmyKpupacEVFwuFrA5DuCwvwdEX+SxCHBsgmhXLSLVNNfPEDPVs5Ba0bx20VPDuJ60g2btx X-Received: by 10.182.104.200 with SMTP id gg8mr1064330obb.45.1387297694154; Tue, 17 Dec 2013 08:28:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.101.39 with SMTP id fd7ls2553047qeb.16.gmail; Tue, 17 Dec 2013 08:28:14 -0800 (PST) X-Received: by 10.52.168.4 with SMTP id zs4mr1385409vdb.59.1387297694023; Tue, 17 Dec 2013 08:28:14 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id xn8si5031775vdc.48.2013.12.17.08.28.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 08:28:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id oz11so4544973veb.32 for ; Tue, 17 Dec 2013 08:28:13 -0800 (PST) X-Received: by 10.220.159.4 with SMTP id h4mr11255597vcx.1.1387297693929; Tue, 17 Dec 2013 08:28:13 -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 u4csp79559vcz; Tue, 17 Dec 2013 08:28:13 -0800 (PST) X-Received: by 10.14.87.195 with SMTP id y43mr13038941eee.32.1387297692685; Tue, 17 Dec 2013 08:28:12 -0800 (PST) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by mx.google.com with ESMTPS id t6si5676981eeh.192.2013.12.17.08.28.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 08:28:12 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.44 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.44; Received: by mail-ee0-f44.google.com with SMTP id b57so2972826eek.31 for ; Tue, 17 Dec 2013 08:28:12 -0800 (PST) X-Received: by 10.14.88.5 with SMTP id z5mr15774693eee.101.1387297692245; Tue, 17 Dec 2013 08:28:12 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id e3sm54411471eeg.11.2013.12.17.08.28.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2013 08:28:08 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, ian.jackson@eu.citrix.com, Julien Grall Subject: [PATCH v6 02/10] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Date: Tue, 17 Dec 2013 16:27:50 +0000 Message-Id: <1387297678-17762-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387297678-17762-1-git-send-email-julien.grall@linaro.org> References: <1387297678-17762-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.173 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)