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

Re: [RFC v2 03/12] xen/arm32: head: Introduce an helper to flush the TLBs


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 25 Oct 2022 11:53:05 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=0YaOHtMnSNT4PZxeNifK/eY0BAagSfNYbflkwrC+ywI=; b=krTyagdNbDRNh78PdiR+twGTiyP8oDo3CdSMnmk9f4rNhB4NQP4Y/mxid8R6skOXgB+E4XUY46tixxrZuZrgbfzUMaup/xNK/Ubf0bg+4TjwpWC7rEDrZThpkJ7Td4iX68q6zHLYgoK030FMU57Xm6RLbAuowll0Do3q2AlZuZVD4SnRyf2/PctBtjbQqmaV8WOXdw3gyr9jwv5OVPSDuZk/Vbr3umHoQyZxC2t0d0/zj82u0paERxLcDG9K7VzxJADE/LtdxUKCAAmt35xArFuhWEOUxbI7fZRW3O7THByktQOizGOJWwL2oegR3kAokEhuGtfXISN/KF70PPWr7w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XOQz80UAMO7/e57TCNwy+IW3vdfnWj7dFK3ay6tP7HeUmwy10+O1dzN06a8qe0dcZpstmB1bsizFnJ1ZOD9hIEJz4W28y3KFxeAeUZ/bc1SxOyQLCI4N5rZ/5znIzyJQFJEwg+H7F5AmbW9k8sJoLXBIAfRMF4LY/fDJuvxOlAkg82HN7spHGL/Fs42uStVZnLzqaybIYlu5MJlDr4jNbVXhehnKnt8AG8TRDmYsHPSOsObyQX306PY/r2wLDlXqLYXMS+Uw73ThzJnNE9ZS4nDyklzTLCeA9fhGB+DnPF+qeMH8+fgyEExwuE3IAeo2hehBEMW4LRSrfJHAL0xuKA==
  • Cc: <marco.solieri@xxxxxxxxxxxxxxx>, <lucmiccio@xxxxxxxxx>, <carlo.nonato@xxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 25 Oct 2022 09:53:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 22/10/2022 17:04, Julien Grall wrote:
> 
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> The sequence for flushing the TLBs is 4 instruction long and often
> require an explanation how it works.
s/require/requires/

> 
> So create an helper and use it in the boot code (switch_ttbr() is left
> alone for now).
> 
> Note that in secondary_switched, we were also flushing the instruction
> cache and branch predictor. Neither of them was necessary because:
>     * We are only supporting IVIPT cache on arm32, so the instruction
>       cache flush is only necessary when executable code is modified.
>       None of the boot code is doing that.
>     * The instruction cache is not invalidated and misprediction is not
>       a problem at boot.
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
> ---
>  xen/arch/arm/arm32/head.S | 31 ++++++++++++++++++-------------
>  1 file changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index 163bd6596dec..aeaa8d105aeb 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -66,6 +66,21 @@
>          add   \rb, \rb, r10
>  .endm
> 
> +/*
> + * Flush local TLBs
> + *
> + * tmp1:    Scratch register
I would love to adhere to the way of describing macro params like you did in 
mov_w. This would mean:
@tmp: scratch register

Apart from that, the change looks ok.

Question on the side:
Why do we use nshst in assembly and ishst in TLB helper macro?
Is it because the latter is also used to flush the inner TLBs whereas the 
former only local ones?

~Michal




 


Rackspace

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