From patchwork Mon Dec 9 03:33:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22149 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F62625E0B for ; Mon, 9 Dec 2013 03:34:18 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id lx4sf12155248iec.6 for ; Sun, 08 Dec 2013 19:34:17 -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=/oM5Ohhn7Gpy+H0oa19VLVoSdoTJsQr+QwK4JEn/wls=; b=Os/Z9izdgf789cVL/y5skfCUNtBMu218Pq1HgJV7LTXKv14ZLUpHLI4fU9ZdId7daw /vQV3N827MPgoonNJvZpEa4QXrxMwlZEfIaU+ERcXhe8vIPbnFAuPP3y3guV/ogeJo4p epDazaKqUXKR5HZv9I7WGekLJGi60NIxbgBs+DgBsoV6gyeIWziGl5+VbLFvHKReAQS8 C9cX744hqJWlw2B1MQW87/iEytkyVaPiWsRuRbS+V+FIPqhbsLnEUDZIXXTAglPAmXXH etaRimC2FQ8W7Z+gnIUCuYEu0QCSqQZ0GOyVmK3GduWdcf0Jery01i6sddvKqFe5g91H y8IQ== X-Gm-Message-State: ALoCoQnz8QdDRtgx0cbZk5UIsSg/i8aD1Ol844YLx8lsRCGFhCRXhK0NEy+h8dB8R8PyxVl8CFoh X-Received: by 10.182.243.166 with SMTP id wz6mr5657075obc.19.1386560057792; Sun, 08 Dec 2013 19:34:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.49 with SMTP id f17ls1969026qey.54.gmail; Sun, 08 Dec 2013 19:34:17 -0800 (PST) X-Received: by 10.52.118.98 with SMTP id kl2mr633302vdb.30.1386560057681; Sun, 08 Dec 2013 19:34:17 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id ph5si3190423veb.14.2013.12.08.19.34.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Dec 2013 19:34:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so3159189veb.13 for ; Sun, 08 Dec 2013 19:34:17 -0800 (PST) X-Received: by 10.52.164.16 with SMTP id ym16mr661964vdb.39.1386560057524; Sun, 08 Dec 2013 19:34:17 -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 u4csp75721vcz; Sun, 8 Dec 2013 19:34:17 -0800 (PST) X-Received: by 10.15.32.73 with SMTP id z49mr11057621eeu.27.1386560056952; Sun, 08 Dec 2013 19:34:16 -0800 (PST) Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by mx.google.com with ESMTPS id f8si7746126eep.15.2013.12.08.19.34.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Dec 2013 19:34:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.173 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.173; Received: by mail-ea0-f173.google.com with SMTP id o10so1265598eaj.18 for ; Sun, 08 Dec 2013 19:34:16 -0800 (PST) X-Received: by 10.14.127.132 with SMTP id d4mr11068948eei.66.1386560056415; Sun, 08 Dec 2013 19:34:16 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id g7sm23681234eet.12.2013.12.08.19.34.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Dec 2013 19:34:15 -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 v2 02/10] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Date: Mon, 9 Dec 2013 03:33:59 +0000 Message-Id: <1386560047-17500-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386560047-17500-1-git-send-email-julien.grall@linaro.org> References: <1386560047-17500-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.182 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 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)