From patchwork Tue Jun 10 09:57:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 31614 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 CBA352054B for ; Tue, 10 Jun 2014 09:59:17 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id j17sf21021042oag.4 for ; Tue, 10 Jun 2014 02:59:17 -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=etdXsE5lhC0Zpyo/LUpLxfqjXwbe12cZC5yBdzXVhCk=; b=FWtaMWyjpFli+z6jwKBb93PLI5cL8ZbG66pijvre4wMfwLeeFHfgxS56jpsBSdZm20 3md0Y6FfD6cS8z/SG9NRuG5f+Il3WROvWceYmAaKa54RaOG/Wkbw82FEURQnhKdBH70G OD5iMa4l/3OgfP2+su07vpY2VYx+3w9Jp4iMqgnHUj/3neUcAaPKZEGSMMD1GQNl0ViI ioh8HOJRrV6UUao1FuxURBVewjg3MpFJ79ttZV0xUGfOwARTG7/yrn9yVLsueywCis00 PF91zjmjRLD1OwCtq+vpY+Mbq+JiEjOwrPWtqrDpryCgAkZDhJhPSFDHiWjewZpBu75p suKA== X-Gm-Message-State: ALoCoQm/yWSBvH+wNGbZ3YqbehzLzR0fHniR3sK6hMKy1TlVriYhWAP6xrZSMrFQQgD0Zr4UGi2C X-Received: by 10.182.120.129 with SMTP id lc1mr15131333obb.21.1402394357342; Tue, 10 Jun 2014 02:59:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.40 with SMTP id m37ls2141909qgd.18.gmail; Tue, 10 Jun 2014 02:59:17 -0700 (PDT) X-Received: by 10.220.69.72 with SMTP id y8mr30933101vci.21.1402394357143; Tue, 10 Jun 2014 02:59:17 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id uy14si8968338veb.28.2014.06.10.02.59.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 02:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id oz11so3188809veb.8 for ; Tue, 10 Jun 2014 02:59:17 -0700 (PDT) X-Received: by 10.52.191.68 with SMTP id gw4mr623654vdc.65.1402394357054; Tue, 10 Jun 2014 02:59:17 -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 vs6csp212613vcb; Tue, 10 Jun 2014 02:59:16 -0700 (PDT) X-Received: by 10.58.29.234 with SMTP id n10mr32100520veh.16.1402394356659; Tue, 10 Jun 2014 02:59:16 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id hy3si12874921vdb.52.2014.06.10.02.59.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 02:59:16 -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 1WuIof-0007gy-TD; Tue, 10 Jun 2014 09:58:05 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WuIof-0007gV-1b for xen-devel@lists.xen.org; Tue, 10 Jun 2014 09:58:05 +0000 Received: from [85.158.143.35:9328] by server-1.bemta-4.messagelabs.com id C0/41-09853-CA6D6935; Tue, 10 Jun 2014 09:58:04 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1402394282!10021315!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 25139 invoked from network); 10 Jun 2014 09:58:03 -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:03 -0000 X-IronPort-AV: E=Sophos; i="4.98,1008,1392163200"; d="scan'208"; a="141868040" 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-Bz; Tue, 10 Jun 2014 09:57:59 +0000 From: Ian Campbell To: Date: Tue, 10 Jun 2014 10:57:56 +0100 Message-ID: <1402394278-9850-4-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 4/6] xen: arm: handle superpage mappings in p2m_lookup 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.128.177 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: Currently none are actually created, but they will be shortly. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/p2m.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 830a9f9..5d654ce 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -123,6 +123,7 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t) struct p2m_domain *p2m = &d->arch.p2m; lpae_t pte, *first = NULL, *second = NULL, *third = NULL; paddr_t maddr = INVALID_PADDR; + paddr_t mask; p2m_type_t _t; /* Allow t to be NULL */ @@ -136,15 +137,21 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t) if ( !first ) goto err; + mask = FIRST_MASK; pte = first[first_table_offset(paddr)]; if ( !pte.p2m.valid || !pte.p2m.table ) 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 ) goto done; + mask = THIRD_MASK; + + BUILD_BUG_ON(THIRD_MASK != PAGE_MASK); + third = map_domain_page(pte.p2m.base); pte = third[third_table_offset(paddr)]; @@ -156,7 +163,7 @@ done: if ( pte.p2m.valid ) { ASSERT(pte.p2m.type != p2m_invalid); - maddr = (pte.bits & PADDR_MASK & PAGE_MASK) | (paddr & ~PAGE_MASK); + maddr = (pte.bits & PADDR_MASK & mask) | (paddr & ~mask); *t = pte.p2m.type; }