From patchwork Tue Jun 10 09:57:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 31619 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 471412054B for ; Tue, 10 Jun 2014 10:00:04 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id bj1sf1927119pad.10 for ; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=OLgZlZIWQVmiqZDAFHqGCHboHD7OATNC6tb64xZ//5s=; b=ly9TiuMRyNIDU5OhXoTNYp+5Ipl/O428KxtE6HZTDBG/Z2Y/QJmo40L3fy6/zzkg5N b15gp7YlOW5ZI0ALOZGNVj98JV/CUI2qO2Tqh/qn+DB2ueAFq9U/6ILLkE3s7WkR9cq0 kVTyXwJFy6BW0GextHiOGubIJQ/8Fe0VogeRyBLj4xVsEDwgr58z2lJx+t3slbedVAFQ XZ2dc7icl94pjiu04cUGG5BT4T1r4mFhE/5i9gLWfSwFmAOjmI+mPaP9FdQ0VF19JRs8 PdF7PpgeS21lpObw85qtBKuaGtg45Lr6GyQsTY8dTHr5k/NS8gLz32oXzgv+c5Rvtk/X HLHA== X-Gm-Message-State: ALoCoQn2PLB+q9kxDWBAQLxNEY4/pMeTvQG8GNy4Uf/AlhxwHPtbQ+/FXfO+XuBry+7bWSuy/T5o X-Received: by 10.66.66.163 with SMTP id g3mr1266372pat.3.1402394403608; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.131 with SMTP id d3ls1985207qge.52.gmail; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) X-Received: by 10.58.132.70 with SMTP id os6mr3089452veb.36.1402394403415; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id vr7si11628332vcb.93.2014.06.10.03.00.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 03:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hy4so3269125vcb.34 for ; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) X-Received: by 10.58.120.195 with SMTP id le3mr11006615veb.7.1402394403331; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp212656vcb; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) X-Received: by 10.221.42.135 with SMTP id ty7mr31595800vcb.14.1402394403017; Tue, 10 Jun 2014 03:00:03 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ni9si12908371veb.58.2014.06.10.03.00.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 03:00:03 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WuIoh-0007ip-WB; Tue, 10 Jun 2014 09:58:08 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WuIof-0007go-RM for xen-devel@lists.xen.org; Tue, 10 Jun 2014 09:58:06 +0000 Received: from [85.158.143.35:9398] by server-2.bemta-4.messagelabs.com id 67/D0-06539-DA6D6935; Tue, 10 Jun 2014 09:58:05 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1402394282!10021315!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25229 invoked from network); 10 Jun 2014 09:58:04 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 10 Jun 2014 09:58:04 -0000 X-IronPort-AV: E=Sophos; i="4.98,1008,1392163200"; d="scan'208"; a="141868041" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 10 Jun 2014 09:58:00 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Tue, 10 Jun 2014 05:57:59 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=marilith-n13.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WuIoZ-000207-EX; Tue, 10 Jun 2014 09:57:59 +0000 From: Ian Campbell To: Date: Tue, 10 Jun 2014 10:57:57 +0100 Message-ID: <1402394278-9850-5-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402394127.29980.52.camel@kazak.uk.xensource.com> References: <1402394127.29980.52.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 5/6] xen: arm: add some helpers for assessing p2m pte X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Not terribly helpful right now, since they aren't widely used, but makes future patches easier to read. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/p2m.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 5d654ce..233df72 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -14,6 +14,11 @@ #define P2M_FIRST_ORDER 1 #define P2M_FIRST_ENTRIES (LPAE_ENTRIES<arch.p2m; @@ -139,13 +144,13 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t) mask = FIRST_MASK; pte = first[first_table_offset(paddr)]; - if ( !pte.p2m.valid || !pte.p2m.table ) + if ( !p2m_table(pte) ) goto done; mask = SECOND_MASK; second = map_domain_page(pte.p2m.base); pte = second[second_table_offset(paddr)]; - if ( !pte.p2m.valid || !pte.p2m.table ) + if ( !p2m_table(pte) ) goto done; mask = THIRD_MASK; @@ -156,11 +161,11 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t) pte = third[third_table_offset(paddr)]; /* This bit must be one in the level 3 entry */ - if ( !pte.p2m.table ) + if ( !p2m_table(pte) ) pte.bits = 0; done: - if ( pte.p2m.valid ) + if ( p2m_valid(pte) ) { ASSERT(pte.p2m.type != p2m_invalid); maddr = (pte.bits & PADDR_MASK & mask) | (paddr & ~mask); @@ -367,7 +372,7 @@ static int apply_p2m_changes(struct domain *d, cur_first_page = p2m_first_level_index(addr); } - if ( !first[first_table_offset(addr)].p2m.valid ) + if ( !p2m_valid(first[first_table_offset(addr)]) ) { if ( !populate ) { @@ -384,7 +389,7 @@ static int apply_p2m_changes(struct domain *d, } } - BUG_ON(!first[first_table_offset(addr)].p2m.valid); + BUG_ON(!p2m_valid(first[first_table_offset(addr)])); if ( cur_first_offset != first_table_offset(addr) ) { @@ -394,7 +399,7 @@ static int apply_p2m_changes(struct domain *d, } /* else: second already valid */ - if ( !second[second_table_offset(addr)].p2m.valid ) + if ( !p2m_valid(second[second_table_offset(addr)]) ) { if ( !populate ) {