From patchwork Thu Sep 18 00:09:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 37559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4CCCD2057E for ; Thu, 18 Sep 2014 00:11:37 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c41sf128526eek.5 for ; Wed, 17 Sep 2014 17:11:36 -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=qvARdtLGOy+kxYbGGOhG2PRS0JUaGvSlZSVjB9hn468=; b=elWioz0RFTwYGqMLVrdA6RvxoZHlN/v7mhgazPxm35CBSxLi8A9oJUtSrqwQpWhUQX j6ljGKt0icnm2eH/NrI7Z+a6HBX+KxPXHyAd9Ea8VY9zSYMQ/zuqEmkKhOk8JUmvMkgF 2VmkhYOpxhdythGfxGzhv4FNrG258I6kBvl7eY+HQ+SbCOUSOiRTv1VA0Vtmnlz4JF37 6Eu4jT/nWYrAz2vL4wGyTaK4VlBBDjL8WbWBifxnww2anGd3Wwd1krQszLM6oHPjopcC v8QKZB0zaFN1t2EJxk73Q2BRbfpRbtB003jb2yy18ByX8J0JtBu/wvRA1I2q0WQ007p9 uW0w== X-Gm-Message-State: ALoCoQm+PZgzsq96kk+TQjyCzrOj2L/aN7dH5PfsOYFuxsS8bV8uEAPn34YeHt2k9lQ9LVhK5pTN X-Received: by 10.152.26.225 with SMTP id o1mr188691lag.4.1410999096048; Wed, 17 Sep 2014 17:11:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.165 with SMTP id f5ls179548lam.33.gmail; Wed, 17 Sep 2014 17:11:35 -0700 (PDT) X-Received: by 10.152.1.6 with SMTP id 6mr1091399lai.22.1410999095880; Wed, 17 Sep 2014 17:11:35 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx.google.com with ESMTPS id og9si20491122lbc.114.2014.09.17.17.11.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 17:11:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id l4so127972lbv.2 for ; Wed, 17 Sep 2014 17:11:35 -0700 (PDT) X-Received: by 10.152.28.230 with SMTP id e6mr1041311lah.62.1410999095560; Wed, 17 Sep 2014 17:11:35 -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.112.130.169 with SMTP id of9csp673199lbb; Wed, 17 Sep 2014 17:11:34 -0700 (PDT) X-Received: by 10.224.73.132 with SMTP id q4mr1760587qaj.78.1410999094336; Wed, 17 Sep 2014 17:11:34 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w9si24319935qcj.42.2014.09.17.17.11.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Sep 2014 17:11:34 -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 1XUPIi-0006f2-Gu; Thu, 18 Sep 2014 00:10:20 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XUPIf-0006eD-EB for xen-devel@lists.xen.org; Thu, 18 Sep 2014 00:10:17 +0000 Received: from [193.109.254.147:19963] by server-4.bemta-14.messagelabs.com id C8/C3-01677-8E22A145; Thu, 18 Sep 2014 00:10:16 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1410999014!16266718!1 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 2764 invoked from network); 18 Sep 2014 00:10:16 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 18 Sep 2014 00:10:16 -0000 X-IronPort-AV: E=Sophos;i="5.04,542,1406592000"; d="scan'208";a="172653374" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Wed, 17 Sep 2014 20:09:56 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1XUPIJ-0000su-Eq; Thu, 18 Sep 2014 01:09:56 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Thu, 18 Sep 2014 01:09:55 +0100 From: Ian Campbell To: Date: Thu, 18 Sep 2014 01:09:47 +0100 Message-ID: <1410998995-27449-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1410998960.1920.2.camel@citrix.com> References: <1410998960.1920.2.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, Ian Campbell , vijay.kilari@gmail.com, stefano.stabellini@eu.citrix.com, Vijaya Kumar K , Ian Campbell , tim@xen.org Subject: [Xen-devel] [PATCH v3 for-4.5 1/9] xen: arm: rename p2m->first_level to p2m->root. 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.217.171 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: From: Ian Campbell This was previously part of Vijaya's "xen/arm: Add 4-level page table for stage 2 translation" but is split out here to make that patch easier to read. I went with ->root rather than ->root_level as the original did. Signed-off-by: Ian Campbell Reviewed-by: Julien Grall Cc: Vijaya Kumar K --- v3: Spell Vijaya's name correctly v2: Clarified commit log --- xen/arch/arm/p2m.c | 24 ++++++++++++------------ xen/drivers/passthrough/arm/smmu.c | 2 +- xen/include/asm-arm/p2m.h | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index a7dcdf5..8061e06 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -12,8 +12,8 @@ #include /* First level P2M is 2 consecutive pages */ -#define P2M_FIRST_ORDER 1 -#define P2M_FIRST_ENTRIES (LPAE_ENTRIES<first_level, page_to_mfn(p2m->first_level)); + p2m->root, page_to_mfn(p2m->root)); - first = __map_domain_page(p2m->first_level); + first = __map_domain_page(p2m->root); dump_pt_walk(first, addr); unmap_domain_page(first); } @@ -141,10 +141,10 @@ static lpae_t *p2m_map_first(struct p2m_domain *p2m, paddr_t addr) { struct page_info *page; - if ( first_linear_offset(addr) >= P2M_FIRST_ENTRIES ) + if ( first_linear_offset(addr) >= P2M_ROOT_ENTRIES ) return NULL; - page = p2m->first_level + p2m_first_level_index(addr); + page = p2m->root + p2m_first_level_index(addr); return __map_domain_page(page); } @@ -958,7 +958,7 @@ int p2m_alloc_table(struct domain *d) struct p2m_domain *p2m = &d->arch.p2m; struct page_info *page; - page = alloc_domheap_pages(NULL, P2M_FIRST_ORDER, 0); + page = alloc_domheap_pages(NULL, P2M_ROOT_ORDER, 0); if ( page == NULL ) return -ENOMEM; @@ -968,9 +968,9 @@ int p2m_alloc_table(struct domain *d) clear_and_clean_page(page); clear_and_clean_page(page + 1); - p2m->first_level = page; + p2m->root = page; - d->arch.vttbr = page_to_maddr(p2m->first_level) + d->arch.vttbr = page_to_maddr(p2m->root) | ((uint64_t)p2m->vmid&0xff)<<48; /* Make sure that all TLBs corresponding to the new VMID are flushed @@ -1047,9 +1047,9 @@ void p2m_teardown(struct domain *d) while ( (pg = page_list_remove_head(&p2m->pages)) ) free_domheap_page(pg); - free_domheap_pages(p2m->first_level, P2M_FIRST_ORDER); + free_domheap_pages(p2m->root, P2M_ROOT_ORDER); - p2m->first_level = NULL; + p2m->root = NULL; p2m_free_vmid(d); @@ -1073,7 +1073,7 @@ int p2m_init(struct domain *d) d->arch.vttbr = 0; - p2m->first_level = NULL; + p2m->root = NULL; p2m->max_mapped_gfn = 0; p2m->lowest_mapped_gfn = ULONG_MAX; diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c index 21b4572..3cbd206 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -937,7 +937,7 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain_cfg *cfg) paddr_t p2maddr; ASSERT(cfg->domain != NULL); - p2maddr = page_to_maddr(cfg->domain->arch.p2m.first_level); + p2maddr = page_to_maddr(cfg->domain->arch.p2m.root); gr1_base = SMMU_GR1(smmu); cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, cfg->cbndx); diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index 97cbae4..5bf7946 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -20,7 +20,7 @@ struct p2m_domain { struct page_list_head pages; /* Root of p2m page tables, 2 contiguous pages */ - struct page_info *first_level; + struct page_info *root; /* Current VMID in use */ uint8_t vmid;