[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 10/13] xen/arm64: Save/restore CPU context across SYSTEM_SUSPEND
- To: Mykola Kvach <xakep.amatop@xxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Mon, 1 Jun 2026 17:58:45 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=gmail.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- 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=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rOAkbjw/97cFMPKBMWQnA3cSk4m7XxzWDSoxBQmqVeo=; b=JObaVKx+dKQLc4nP9xh8Mpe/GaL1MR6FtzCavbmjw5QNnR9UcUhqZNjyLtlpj7Rv1Iq6qXVNVwDl367iOGnGWc7AN/vIk+ClyBLE2COVAB99pFUVjc15HtUp/9BF3DANHc3hF9q930CIFx5HcJljKoD3QW8xcXWDlh9GPWf2VUTZQpdHR9CIocEs/c09vYWKqEs0jMZmLxV4+Cy+JbrSes6F55UiMAER5fkIgT2ZUq54OMzx9jUUh3Chnf0uK0NpIyUKIpI3yD+CHR/pi0NRis00qA6x6w97yAjLvMBk2VvI/Y/yIPo48G0D1cq1lSdq7nOwEA8nq1XXJSreD9RwgQ==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rOAkbjw/97cFMPKBMWQnA3cSk4m7XxzWDSoxBQmqVeo=; b=HP94+TLWrK7cAvSb+61DNb/dBpdB7G/UJRGmvE+eHz4ivINve3PBJrDbFhFlZBuZmt7p1wCi0rG7dPUOqJxkdMNx64xDtJ2upKRf3pWyrKD2yNPD7+dB3Lg8HDBoykkM+hCJp1JVrnt353QVqlOM+CazEFsXLKBnuxqWRQJwMOlvfgM66YwOzl5poEe9aQAS6J4FHlkuoruO6ZC2741l/YaopbKKv8EB44WMuJlwYB+qS1CGMDEzIS0G5t0lUnIjh0EW3egFoeZXGsPWRCtA3bA0qY4PMwDsVrr9o4UM2ksAZZqe71QX2GE0dYri/tXtBk6nKZ9Pq2u4jQ+U6nLgJg==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=t/OIqDz+garGRmZksE2+HGvNf8FOjafAhGK/O07zS3spNlIGpcyaYE54bO3RhQWAFlat5QqTxaBFZLv1J9a3QbjD43g53a9Cz3rpErTiJCpop9B/9tNI5Cer2gyYtO43hKRDlRzKSm6ihre72IoYvXVyCkLVywlJQnLHTUoRxDvwuf2pTnyonzLUC3MREUhlzkAmLWHlffrE2vhaOiZDD8Ijy4z5e1bgDaYKhSsJmb8AKL0485RZ/vXDeK6vdMrWuPlY+ZBD9PkHQE3a1g6zkR8wr4X9zLH9LC0+1ng2NJcnHAJlD6Ei4IxorSUj5rDYrkw6R8t/B120rYxTfuZLTw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Nz45iuFmrRSkA2cixckZn5VNTXGMgz94Xdrm0DS9/SFysuFSE9dPkXPOTqQwwMW3M2P76WA0QzKibB5PcJsifiqAl+yQtjy8KkwAhCfO9/xzOEkS4/t1t46nY23UPMOo8FzH0iL0XxXw0pUILzAXSsEYrQz/M8PaLAYG2hUmo2wizC1XT1Cc+30Vi5x1dzI7y0pcEYLbZbvCdj4NahBUHNRo+jS/d73SfoDwwJ2HYky2Gj5rWCLBcIlHOz4lseSBgZs/6MGPWHHDIzzzurkiDhsx+jKyiGOqJoRHEamx5YNHK+M0lQVppcnOnlbuaWy7yRVzQj/y7kt7UKNQIBLXsQ==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Mykola Kvach <mykola_kvach@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
- Delivery-date: Mon, 01 Jun 2026 17:59:56 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Thread-index: AQHc6UoJDjVka9AN20eljtAAqxiA5LYqDdoA
- Thread-topic: [PATCH v10 10/13] xen/arm64: Save/restore CPU context across SYSTEM_SUSPEND
Hi Mykola,
> On 21 May 2026, at 18:45, Mykola Kvach <xakep.amatop@xxxxxxxxx> wrote:
>
> From: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>
>
> On wakeup from PSCI SYSTEM_SUSPEND, Xen re-enters EL2 with the MMU and
> data cache disabled. The resume path must first switch back to Xen's
> runtime page tables before it can access the saved CPU context using
> virtual addresses.
>
> Add an arm64 hyp_resume trampoline that reuses enable_secondary_cpu_mm()
> to enable the data cache and MMU, switch to init_ttbr, and resume in the
> runtime virtual mapping. The trampoline then restores the saved CPU
> general-purpose and system-control register context.
>
> prepare_resume_ctx() must be invoked just before the PSCI system suspend
> call is issued to the platform firmware. It saves the current CPU context
> and returns a non-zero value so that the caller enters the physical
> SYSTEM_SUSPEND call.
>
> On resume, hyp_resume restores the saved context, including the saved link
> register. Control therefore returns to the place where prepare_resume_ctx()
> was called. To avoid re-entering the suspend path, the restored path sees
> prepare_resume_ctx() return zero.
>
> The assembly save/restore code uses offsets generated by asm-offsets.c
> from struct resume_cpu_context, keeping the assembly memory accesses in
> sync with the C structure layout.
>
> Support for ARM32 is not implemented. Instead, compilation fails with a
> build-time error if suspend is enabled for ARM32.
>
> Signed-off-by: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>
> Signed-off-by: Saeed Nowshadi <saeed.nowshadi@xxxxxxxxxx>
> Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
> Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> ---
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Cheers,
Luca
|