[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 13/14] xen/arm64: mm: Rework switch_ttbr()
- To: Julien Grall <julien@xxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Fri, 13 Jan 2023 16:50:38 +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=GohCHgT8xkSR18XtakrCSXvIqvzjUApH5r1DLvdgF2M=; b=SBdvnrsFSjUDTHmGwZGjbutWRHG3GTxVqyeWCkJDIdjGBXoY4dPscQ/sb+OsfhGZbvxKNwLfpQkw6fnyLaUXlP2yHmqIzx6EF9wdNG0ASOSpFbGCNrb/CmY8b/v1zYphUWZpI8OoY9dr5RfOaFsJB9TP334CVS/Srv35pk7AzXFowBrruieVWf+L/+rIjXOKq4jOplKyfCn10dmfO/XBHG5esieQHM+xXDJbHnRdjINRAshuPOm+ZHFKBzUOi5I3w51soV41SaVyPQ5WPsCFWRDmXgw8vr5wYXdGxX4iKpjVVajE9uS8NwLGnczxswnMpDBSoVdlkACFpeJrPd84xA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXdbkkroSyIoq4e3ZLCzRRd9aomzJfxlp69Y3SIaH7HxajXRb3HLB93ZUfhLOR+9ONlepM3MzWRpfDOkxtph/l8Y29zB1/iUQcArALDZ6/tbCizXs5PxQl/asSYej48WKoF5YUaORs99XEj+cIPr/0a/4C3TVsulrYvhWgdhEvjuX0FiJfQjE11/ll/KCwBKw9Lp0KtLCuFcVXBXOsVJFb6NBTvx58qkiYGmuGwsEQvMmTaPfRc7lQEwB/2C4AFPt8zO5rC2j7l88QB5tmUhvFfQn/r0OrNffp2Jolf6F24B/eIJP9J6mgk02FpSAOZDZVC3HqGp+MWfKZRK3Z7JPw==
- 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>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Fri, 13 Jan 2023 16:51:13 +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: AQHZJzoRxQQAKbugEU6tZrnWUCTSoK6cj9MA
- Thread-topic: [PATCH v4 13/14] xen/arm64: mm: Rework switch_ttbr()
> On 13 Jan 2023, at 10:11, 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>
The sequence looks ok to me, also the reasoning about barriers and
register dependencies discussed in the previous version.
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
I’ve also built for arm32/64 and test this patch on fvp, booting Dom0
and creating/running/destroying some guests
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
|