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

RE: [PATCH v7 4/5] xen/arm64: mm: Rework switch_ttbr()


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Mon, 17 Apr 2023 04:59:12 +0000
  • Accept-language: zh-CN, 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=D3VEkZxhBKtjTkaSXciAD7QPBjlZijqEraymwNMCqo8=; b=cYhSzhXj4UUSp90JR43gtTOg4VqxazMX1ivfecLG5nwV/dvkXVKEpmAKJcexJhixvCNBbnsGjPlPNmTAD4GLXESaJ+oR605a0p2mziaqeG3oidAZRnv9u9V/W3RHhGkbHBlJ0NFX/Gz+asrQTFt1PPBM6FV7P0wZsEoTtggQL/Abw/WCpd0Fol22WwwMgTSx9l1y/09sGOEuiRxIccGTWUsk5e1K+2YQTZWzzZRttSjb0Ab05M/F8jw3M8YgjDlT31qBVmi0z3QGVosuzpyxPfCGZU5jVkRut2B+fKkJ7qPnek9o7D0wsHTLXKN1nD2BYbgy07d44nT586X2+JGa8g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g4muQ1jpFR5+Rk9avaIwR+w+J+VAXiWlP3C6ZxzsBSklucuGac1l3vKFO0xdNfF2J3V6mRuFYO5uliaFcgeNnD58BIb45lBStRT2NqVnC05mhb6ETMPkmkOuPla56ng6CZDNBiOuwLlYx+s51uHb/Dx1STbX6oNqbE4m0PU+cBfhAGml93POsTb6BwS+pWWQ6MZKuqqKq2/odwH1hb/sieU2ck2TPt5mc8iCpmlvle9phuztOWlPEeJShA4QMGUqcZsagd/rWXoE5nboO0S8b8gAh4Jos5KDuZSIG5n3OnueK14h4zCv6F9o+aMZpJkH8FJ4Hh7GVcFafs7z9fwtVQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Luca Fancellu <Luca.Fancellu@xxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Delivery-date: Mon, 17 Apr 2023 05:00:07 +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: AQHZcHBY3cupzbzE6k+kIJf+YHXT8q8uz6sQ
  • Thread-topic: [PATCH v7 4/5] xen/arm64: mm: Rework switch_ttbr()

Hi Julien,

> -----Original Message-----
> Subject: [PATCH v7 4/5] xen/arm64: mm: Rework switch_ttbr()
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> At the moment, switch_ttbr() is switching the TTBR whilst the MMU is
> still on.
> 
> Switching TTBR is like replacing existing mappings with new ones. So
> we need to follow the break-before-make sequence.
> 
> In this case, it means the MMU needs to be switched off while the
> TTBR is updated. In order to disable the MMU, we need to first
> jump to an identity mapping.
> 
> Rename switch_ttbr() to switch_ttbr_id() and create an helper on
> top to temporary map the identity mapping and call switch_ttbr()
> via the identity address.
> 
> switch_ttbr_id() is now reworked to temporarily turn off the MMU
> before updating the TTBR.
> 
> We also need to make sure the helper switch_ttbr() is part of the
> identity mapping. So move _end_boot past it.
> 
> The arm32 code will use a different approach. So this issue is for now
> only resolved on arm64.
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
> Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

I used the test method described in my notes from patch#2, and this
patch passed the test, so:

Tested-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry



 


Rackspace

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