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

Re: [PATCH v5 4/5] xen/arm64: mm: Rework switch_ttbr()


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 30 Jan 2023 10:42:12 +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=LaLvTfGY3yPCKPIkdgdR6515xyazaVC9XVEgVwtipb8=; b=YGudpXjxGLBDJ1TApeWKgRIEuo7Gv+j3hhzLTLvea+B4Rp9+RS07LibeyGZbDt7Js3cHsdD7vziRSFK1+Hd6QSTaXVc2glSL7P4QPzN+Psgc6IvuhiZilW9KQOuCVhJHyj9jiCgBnn2sUaCSF1MIiw7zQwKn9f5F2vrQzvcqRA2yaw5ul1KKrRzoSGzJ9gj82MoqYjLV+UiNZO3cZWx6jVo4luCmhpFwGCW42XPzJa0INRiyfFfs8S3rdsZxNWFZWbDN/QWPjVCGYr3v4RWb7XhdvwLtT9/6EmZc8Uofb9B6PihACxHewloOD/2w+tzzsSY+xUw3ALeaerR6MUPIrQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SjQHVUoqR1SkNWqCxW5X0FvZ6DhU9j9s6JIU3WUaBIN388ax/IaKifRjN9ovc26KaIKt4DHmcAdyxEUV8b61mJYwF0AetXblnybDU1m6Z5A5YmF4OomdzCm15Q3P3F0GrT9qKTKNgqwTu+XNlGtC4OdYuLpabE2lO50oN+5ql4Gt6z2NC14Tys4XGcoLn1Hst2/yhcNb+b9+wmYfzEnZVBQb846YFeiQeCd0iMS2DWpcaPbxhHID5YAzvieSKEWTn8KBBuafw5PTZr5yz0Mcs5al2bjtWDeVbpH+C+iTVqxLglvLpOfhpCel2Dh3BqttFa7I50+ZDEYHTV2lukxmkg==
  • 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>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 30 Jan 2023 10:42:55 +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: AQHZMolOd87sSpDhTkiljIZJzDGtf662yeWA
  • Thread-topic: [PATCH v5 4/5] xen/arm64: mm: Rework switch_ttbr()

Hi Julien,

On 27 Jan 2023, at 20:55, Julien Grall <julien@xxxxxxx> wrote:

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>
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>

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

Cheers
Bertrand


 


Rackspace

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