[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>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 30 Jan 2023 10:17:28 +0100
  • 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=+DkzSkOY4mWSm4jeBZPfXwlxaZh4t6lCNw+L/pSG8Fs=; b=JosAiX3gHnACWDO9h083mBx38gb1lwhbyipjRS+ivx+Ztllu+QW7FKE4zORmDOCQgbVm7BAjF2HoB6xRSE4jDqYJ+DaL5WU62ao2MxmN3CUzbxaWARkMSUeRjsqFd3384dEoYnyTbULDY3DdNJDMRh+an69SP39EobAXeeBh4vvGHgXSiV2BM7RO0dCbU2v7pYq6fzbtzbmJ7caRMQmsYVVcnGp2X0uTx4MiIqED0k5Yf7bi/Z8eQUV1xA8M+MUOqWvb3flSE5FFOB9ica96O4n1SGOxCimX6KM7R0p4jCz9Rb2ryRXACH48Zwdm0EI4Z3CM0u+cOSHr0LGohZVXSQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvBc4O1+7jZxJy/zEhlVActk326zPB+J5uB0hmHB8Agy/I0Gt2OwYjzVR6CIP5fJ2jtszEoUXzCsZNNak4CYmSgRL/qT8Lu7ZK3MBirp5eiZ2ee6j3JtshqbPRV2lHU6B3zasCn/jE8KAAhWjB67hfNWycIJqgntknjnsAC6QaLwOQXbINgtnO655SOyO7HD24MFbv8WmBj4keVqAUHLFdsJ+Cz6slv5fpHku5IDjrhHQI2P5eIDryj4Xn4sq3uC6P3xim26xCIt8s86ie6QAe4vLOXTtCDpN39N5vGe7KOZRYTLtygQLpNxi5gwZnZHr4eDcvfzRQp/p7lN1DJZZA==
  • Cc: <Luca.Fancellu@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 30 Jan 2023 09:17:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 27/01/2023 20:55, Julien Grall 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: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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