From patchwork Tue Jun 13 16:13:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 105398 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp486484qgd; Tue, 13 Jun 2017 09:15:33 -0700 (PDT) X-Received: by 10.107.59.213 with SMTP id i204mr825148ioa.94.1497370532966; Tue, 13 Jun 2017 09:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497370532; cv=none; d=google.com; s=arc-20160816; b=McqGQdIiU40XGprMzHxj+QOmGLADdtre2mbeLccr0NY246OpuwSa5PSzmTQv1Ve0BL s0MvLycpy9us+n2fRiAIJbY+yJTgtYqcP8NGRqwqUTC8Ah4aHmrUfVm9JXu2MYjusPBO 9aykLFeeFoWD082SrcNzirGoRXvTBqfBar0KGGzhG90T0gL0GWKfw6mVjjgiwosPHtOt y/cTB4DJk7NHPAznupOaUBDpHbIYmUZ/ddaR5x3uxbUVBWSt+ccdldaniY+7ugS9r7JY ++jiJqZs9dj0WxnIfvPfKQkbWB5paGNX6Tjnd0lT6Voy2J4tc2v0Re4uZvmKGPQUVK88 ymEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=nMP5+A10j3xiv7VRTQm+YNqRdga+en7AP7/HPClL2UU=; b=LwaVfPS+3S8t7WHZw6hgmOVKsJW2V+YK6YRJ8HqvF7X/HN8S149Jwu4G0BMEkOby+a ST2eVUSMoPmOsKLMKETO2FfDIgcDS4olTDuUp4X+23CTSJqd15zk/TpbltNeENZw/3th Hh2kNs5PbCG0dFVyZs6MUV02xlGwlKvvWMnSx0rVKsgUw43mAwapP4vhMKx8EFgqF0Ci takExn/Hmp1UjIxC/sda3Hx9c/IM+eS1gXawUihLe9Gfw38kGYzSZdzZYDNp7XyqBjAe LArDDhAZlRFkc1Mw4QTtW/eSPhUqobyxTmqiPZ9JPT9bNwCxkhOBcn227szyW69mirTG WdzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 10si10586992itl.34.2017.06.13.09.15.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 09:15:32 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKoRw-0008FK-2x; Tue, 13 Jun 2017 16:13:48 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKoRv-0008Cd-1i for xen-devel@lists.xen.org; Tue, 13 Jun 2017 16:13:47 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 33/28-02180-A3F00495; Tue, 13 Jun 2017 16:13:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTdeS3yH S4OMaI4slHxezODB6HN39mymAMYo1My8pvyKBNWPf2aVMBVv4K66vPMXUwNjA08XIxSEksJlR 4taUXjYI5zSjxNPGTUxdjJwcbAKaEnc+fwKzRQSkJa59vswIYjMLREg0LdgLFhcWSJTYveAUm M0ioCqx7fhVFhCbV8BKYt+5BWBxCQF5iV1tF1lBbE6g+KXnTWBzhAQsJZp3r2eawMi9gJFhFa NGcWpRWWqRrqGZXlJRZnpGSW5iZo6uoYGpXm5qcXFiempOYlKxXnJ+7iZGoIcZgGAH4/nTnoc YJTmYlER5t1yxiRTiS8pPqcxILM6ILyrNSS0+xCjDwaEkwWvP5xApJFiUmp5akZaZAww1mLQE B4+SCO99FqA0b3FBYm5xZjpE6hSjopQ47wSQPgGQREZpHlwbLLwvMcpKCfMyAh0ixFOQWpSbW YIq/4pRnINRSZh3CcgUnsy8Erjpr4AWMwEtvg5yM29xSSJCSqqBMftABr/Ht9pL9rrvDl4SnZ sTs//vLYfn9ettRbcdeS8kfOffWi0fF6mvnAcmfo8Q8fAIj8i+0WSddvHk5VXpEtw+PI4h+nX rNt6qsTPP1eVtDTxQnpV3IOSacQNT71w3p0UHZlm9/l+aHnZC9UijzfFGdUXvE00rE8U0gk6l +IfMLZpwzm27EktxRqKhFnNRcSIArVKXYmoCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1497370425!103024706!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 37545 invoked from network); 13 Jun 2017 16:13:45 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-6.tower-206.messagelabs.com with SMTP; 13 Jun 2017 16:13:45 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0EDDA15A2; Tue, 13 Jun 2017 09:13:45 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4AA363F557; Tue, 13 Jun 2017 09:13:44 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 13 Jun 2017 17:13:12 +0100 Message-Id: <20170613161323.25196-14-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170613161323.25196-1-julien.grall@arm.com> References: <20170613161323.25196-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, punit.agrawal@arm.com Subject: [Xen-devel] [PATCH 13/24] xen/arm: traps: Replace p2m_lookup(..., ..., NULL) by gfn_to_mfn(..., ...) X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" gfn_to_mfn is a wrapper of p2m_lookup which does not return the p2m_type. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/traps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 6cf9ee7244..ce19021f01 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2481,7 +2481,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr) uint32_t *first = NULL, *second = NULL; mfn_t mfn; - mfn = p2m_lookup(d, _gfn(paddr_to_pfn(ttbr0)), NULL); + mfn = gfn_to_mfn(d, _gfn(paddr_to_pfn(ttbr0))); printk("dom%d VA 0x%08"PRIvaddr"\n", d->domain_id, addr); printk(" TTBCR: 0x%08"PRIregister"\n", ttbcr); @@ -2513,7 +2513,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr) (first[offset] & 0x2) ) goto done; - mfn = p2m_lookup(d, _gfn(paddr_to_pfn(first[offset])), NULL); + mfn = gfn_to_mfn(d, _gfn(paddr_to_pfn(first[offset]))); if ( mfn_eq(mfn, INVALID_MFN) ) { @@ -2619,7 +2619,7 @@ static void do_trap_instr_abort_guest(struct cpu_user_regs *regs, * with the Stage-2 page table. Walk the Stage-2 PT to check * if the entry exists. If it's the case, return to the guest */ - mfn = p2m_lookup(current->domain, _gfn(paddr_to_pfn(gpa)), NULL); + mfn = gfn_to_mfn(current->domain, _gfn(paddr_to_pfn(gpa))); if ( !mfn_eq(mfn, INVALID_MFN) ) return; } @@ -2759,7 +2759,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, * with the Stage-2 page table. Walk the Stage-2 PT to check * if the entry exists. If it's the case, return to the guest */ - mfn = p2m_lookup(current->domain, _gfn(paddr_to_pfn(info.gpa)), NULL); + mfn = gfn_to_mfn(current->domain, _gfn(paddr_to_pfn(info.gpa))); if ( !mfn_eq(mfn, INVALID_MFN) ) return;