From patchwork Tue Oct 15 03:49:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 11189651 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 73F2714ED for ; Tue, 15 Oct 2019 03:51:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E44820659 for ; Tue, 15 Oct 2019 03:51:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZLE7+nGW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E44820659 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iKDq6-0007Qg-6P; Tue, 15 Oct 2019 03:49:38 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iKDq4-0007Qb-R9 for xen-devel@lists.xenproject.org; Tue, 15 Oct 2019 03:49:36 +0000 X-Inumbo-ID: ce21a42e-eefe-11e9-a531-bc764e2007e4 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ce21a42e-eefe-11e9-a531-bc764e2007e4; Tue, 15 Oct 2019 03:49:36 +0000 (UTC) Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6CBF22089C; Tue, 15 Oct 2019 03:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571111375; bh=vP1HWt/8eqpLjyORcVjHdf+gp9WQkxNwYvwrVZyeZLw=; h=Date:From:To:cc:Subject:From; b=ZLE7+nGWIGOWGHOgw63yOE5I+2gcbhfcr6i8B4ChTfiVA/+zDJPdr7mLshY5iTkia 1jmt+kM6+MG/oBbzbcFQUvOXsxaRADWg88CcjW3a41P/0faqAHn0fzM7QnkI2WwqKa ndj3ic3Gnylf5GRAmypeXh1PlBuM/cmAChpBeyFo= Date: Mon, 14 Oct 2019 20:49:34 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: julien.grall@arm.com Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] xen/arm: remove special dom0 case in dump_hyp_walk X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, xen-devel@lists.xenproject.org, sstabellini@kernel.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is no need to have a special dom0 case to convert the pgtable virtual address into a physical address. The virt_to_maddr function can work both in the dom0 case and the domU case. This is more than a cleanup: when Xen is loaded at addresses lower than 2MB on arm32 phys_offset might not hold the right value and be unable to perform a virt to phys conversion properly. Reducing the unnecessary usage of phys_offset is a good idea. Link: https://marc.info/?l=xen-devel&m=157081398022401 Signed-off-by: Stefano Stabellini diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index a6637ce347..b7883cfbab 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -284,10 +284,7 @@ void dump_hyp_walk(vaddr_t addr) "on CPU%d via TTBR 0x%016"PRIx64"\n", addr, smp_processor_id(), ttbr); - if ( smp_processor_id() == 0 ) - BUG_ON( (lpae_t *)(unsigned long)(ttbr - phys_offset) != pgtable ); - else - BUG_ON( virt_to_maddr(pgtable) != ttbr ); + BUG_ON( virt_to_maddr(pgtable) != ttbr ); dump_pt_walk(ttbr, addr, HYP_PT_ROOT_LEVEL, 1); }