[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC 1/6] xen/arm: mm: Remove special case for CPU0 in dump_hyp_walk()


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 24 Nov 2020 17:10:07 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CsPdk1yx+SbUX7HP1AfNtmsQZPPkC07SXBqWKIiwM/o=; b=G+0b09ZRBNBISL2DZqXB0zL9UkfqzqXqfHVW/ITVmfQDVYTmcwSYFEft+Ssib1wAHWXLIs9BK23eSCIbmb08pQdm8sLWm3sSBIxvGeNIE62FyDSUe6hurnn5oVDjn5ryeuKSDRgdxG67WB2xN0Zuq3ZNrCvGkIxbQqFWBiy2Ur1hC2oXwQ7i/3KQ+w/2nsgQpuuA86Vvtw68TkEIW7pPGqpk+6kwsYoSGvvyAtecwUDUPGx58/eS2m4QUS1wSs49igjbUhJy6/Kn16XlCH/IY75XeC3PJ9tXGLAeJLmS0A3/s40B/6kuFXHf2/9ZFFRigLEUGO6QHvEuv0uHdEQTpg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZNNMNGsikotKj0+HgIAK9j94ssStSFGmmcAq4JIAys1ARalbxRghADdmhqIiiUR2GF6Z14yEZeRlnBkYEumdCAPTZPApOYGEhiBrluJbbADu4IylbTfn9OppnVsDk9ftZRHFYyJ48joR789XrrGCZe/fVMR4BEsBz1lENLFUGgw1GSvoKKfuwjtpUGwPpPm2oxwQVX6hAI9EYkG4r6V/5GwK9bCaWAiXGNJEILDx8NrhvJjgLIq+JzS+ySyBDSe6IKjzLhmdp62RQde3fLqNE/SA/CxNf9v4idSAmlv5r0Q/xtxERUVrzEaXg+IidWqcPoZT/IX9oV3URfmjgO+zxQ==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: "open list:X86" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Tue, 24 Nov 2020 17:10:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWvqdPAjvY1ondm0yRVrKn/nv1bqnXjAKA
  • Thread-topic: [PATCH RFC 1/6] xen/arm: mm: Remove special case for CPU0 in dump_hyp_walk()

Hi Julien,


> On 19 Nov 2020, at 19:07, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> 
> There is no need to have a special case for CPU0 when converting the
> page-table virtual address into a physical address. The helper
> virt_to_maddr() is able to translate any address as long as the root
> page-tables is mapped in the virtual address. This is the case for all
> the CPUs at the moment.
> 
> So use the same BUG_ON() regardless the CPU.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> [julien: Rework the commit message]
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> 
> ---
> 
> I went back through the conversation in [1] regarding the issue when
> loading Xen below 2MB on Arm32. The example provided is wrong because to
> find the physical address, we need to add 'phys_offset', not substract.
> 
> So I removed the comment regarding the code was buggy.
> 
> [1] https://marc.info/?l=xen-devel&m=157081398022401
> ---
> xen/arch/arm/mm.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 9c4b26bf079b..4dd886f7c80d 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);
> }
> 
> -- 
> 2.17.1
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.