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

Re: [PATCH 5/7] xen/arm: pmap: Add missing ISB in arch_pmap_map()


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 4 Jul 2023 14:56:59 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G3zMTeCLUtM1cEkUBaoYNInhOtFMlJXgNjM4UM4FfTk=; b=odFkFRYK56ovLcJlI8qE9TuDFsmi8d8OC4P4I9SMrzWqYlf9i3jA8Giszpw+1Ejl51ouZZAxVPGDJ3mRggFjgUVJZCJ5T6nCxYRiJhCEONBegg8+Em2B/Gq6nN5NrmhO1tgcc/YQmRcJEA0Wfnkg9LXmFv60bUHyh9N4HwKoqEwj+Ujqr9nrxCjIY3dTTYNT2OVvc+ikvPo9GdWWKGP5MXJZscHnsQcqNv5Z/s2kPLg3gxLYGDgqKeOIfaGjLnRcJ7T32PuZN+3IBt74EG4B37daVgai5ZL1MWoPBccp70KPjOIFvztsvahs5Cy/an/hBLEKzobB7UGIJdAwJM+l+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LsQWswdpaTupvJYAxEHhIbDSgVfQBhlbaMZ+D7QI+kMhNTQ+4wqNrPzWTphtiprJqpYBG+0ZvPIf1GyQuaeXYwrnzCC/sYd/+SMJ39DiEMcsZW5UUu6nhv0UNyV2df8uACzKCYVPzYiWtQPJdWTroDeOqOwZT85Wx9ZZuCjTklwYw/+pak2rVrJOpeOdiwfOAJ96aU654hFKU9BqjdbYzMgCwZ8LHitv5J6EsqVeX4oKMWkqm4iCv5pFLvRGEX0NyEOv0Tv9RhzelMj/1l3vglCajfpo0p9u7K7LkTw7jFnKvVV7X4b3Mg4icJBkBHwEf/rX2y9hr0EYt6+6qqvQUA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 04 Jul 2023 14:57:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZos+1XQowzy5c7k+9HVrcbAjL6K+pyeQA
  • Thread-topic: [PATCH 5/7] xen/arm: pmap: Add missing ISB in arch_pmap_map()

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> Per the Arm Arm, (Armv7 DDI406C.d A3.8.3 and Armv8 DDI 0487J.a B2.3.12):
> 
> "The DMB and DSB memory barriers affect reads and writes to the memory
> system generated by load/store instructions and data or unified cache
> maintenance operations being executed by the processor. Instruction
> fetches or accesses caused by a hardware translation table access are
> not explicit accesses."
> 
> Note that second sentence is not part of the newer Armv8 spec. But the
> interpretation is not much different.
> 
> As the entry created by arch_pmap_map() will be used soon after
> pmap_map() returns, we want to ensure the DSB in write_pte() has
> completed. So add an ISB.
> 
> Fixes: 4f17357b52f6 ("xen/arm: add Persistent Map (PMAP) infrastructure")
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> xen/arch/arm/include/asm/pmap.h | 5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/xen/arch/arm/include/asm/pmap.h b/xen/arch/arm/include/asm/pmap.h
> index e094d13dd282..bca3381796f3 100644
> --- a/xen/arch/arm/include/asm/pmap.h
> +++ b/xen/arch/arm/include/asm/pmap.h
> @@ -15,6 +15,11 @@ static inline void arch_pmap_map(unsigned int slot, mfn_t 
> mfn)
>     pte = mfn_to_xen_entry(mfn, PAGE_HYPERVISOR_RW);
>     pte.pt.table = 1;
>     write_pte(entry, pte);
> +    /*
> +     * The new entry will be used very soon after arch_pmap_map() returns.
> +     * So ensure the DSB in write_pte() has completed before continuing.
> +     */
> +    isb();
> }
> 
> static inline void arch_pmap_unmap(unsigned int slot)
> -- 
> 2.40.1
> 




 


Rackspace

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