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

Re: [PATCH] xen/arm: Properly clean update to init_ttbr and smp_up_cpu


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Date: Tue, 30 Jan 2024 18:10:05 +0000
  • Accept-language: en-US, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+YVpvWJmtnyfvFJRT7vIoRtVvt0hhVd9rXB4SJedm2E=; b=PLOR8fVQzS99uLgaul+y5fWkBhp1tB2QxK9avUmFpNlIE+t0Gw+iyKryAtEqzdU5/FESKy5LGtmLs2RQtDH6zWDt4VJRzvUZCReOqBTmv6KcEkBxLAot4XmWfLdx8Wu98y5rbUIunjREHgrp1bDQfpVjq0KcIGdu6kmV6PLZpeqddlgW4JXmSIe0XzAtR614dUXEtuJLMtVRujWmnMd0IEeyr7zisnSecXLceRMDx699qt6eUmgk46HOKHrpCF3hgeLuD5o6t4VZgAb1QPnn8p83PHF3Rxcvk/h6c/CDSkuaodvufjPGFl2sEUZple1fuAKfZJicU/8uROrrbjG18Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DrtR6DRvW5HyFvQEVSadSeP6xTufYtMHulsTyU0NymdpIW9DCMgMiuQyO20+bXEabRtaq9F30iUMta8BK4GFrP4mV7HKaHme2kqEN/bbBoGN0oOKiYBvVCA5ZQ5c+MixzTaDg3aYPpqAccwgAWYvNJ4VC7DS7qK+mJDXGSdScX3hLoevwanQV7tTjX3482wmw/yix5KXKuZ6Bmu95du5Sz/Gf9OCUm7uV2NUuW3zd0PDFPRiqsoF9boYsYyJAAs6Cek9jsdd/q8kf3I1ZMyvHzQHoSDofS7Kkoj2vGVHPiQV+Nm1kSCdaf4VVrgWe4uzhIrAOIaDnO3lw1ZHFBCu4Q==
  • Cc: Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 30 Jan 2024 18:10:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaU6HyUyltufp+KE2Jtz4dElFoO7Dyp8CA
  • Thread-topic: [PATCH] xen/arm: Properly clean update to init_ttbr and smp_up_cpu


On 30.01.24 19:29, Julien Grall wrote:

Hello Julien


> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> Recent rework to the secondary boot code modified how init_ttbr and
> smp_up_cpu are accessed. Rather than directly accessing them, we
> are using a pointer to them.
> 
> The helper clean_dcache() is expected to take the variable in parameter
> and then clean its content. As we now pass a pointer to the variable,
> we will clean the area storing the address rather than the content itself.
> 
> Switch to use clean_dcache_va_range() to avoid casting the pointer.
> 
> Fixes: a5ed59e62c6f ("arm/mmu: Move init_ttbr to a new section .data.idmap")
> Fixes: 9a5114074b04 ("arm/smpboot: Move smp_up_cpu to a new section 
> .data.idmap)
> 
> Reported-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>


[on Renesas R-Car Gen3 SoC with 8 cores (Arm64)]
Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>


> ---
>   xen/arch/arm/mmu/smpboot.c | 2 +-
>   xen/arch/arm/smpboot.c     | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/mmu/smpboot.c b/xen/arch/arm/mmu/smpboot.c
> index bc91fdfe3331..4ffc8254a44b 100644
> --- a/xen/arch/arm/mmu/smpboot.c
> +++ b/xen/arch/arm/mmu/smpboot.c
> @@ -88,7 +88,7 @@ static void set_init_ttbr(lpae_t *root)
>        * init_ttbr will be accessed with the MMU off, so ensure the update
>        * is visible by cleaning the cache.
>        */
> -    clean_dcache(ptr);
> +    clean_dcache_va_range(ptr, sizeof(uint64_t));
>   
>       unmap_domain_page(ptr);
>   }
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index 119bfa3160ad..a84e706d77da 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -449,7 +449,7 @@ static void set_smp_up_cpu(unsigned long mpidr)
>        * smp_up_cpu will be accessed with the MMU off, so ensure the update
>        * is visible by cleaning the cache.
>        */
> -    clean_dcache(ptr);
> +    clean_dcache_va_range(ptr, sizeof(unsigned long));
>   
>       unmap_domain_page(ptr);
>   

 


Rackspace

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