Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 766E0CD4840 for ; Mon, 11 May 2026 16:11:39 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1306319.1578347 (Exim 4.92) (envelope-from ) id 1wMTE2-0002Ju-9s; Mon, 11 May 2026 16:11:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1306319.1578347; Mon, 11 May 2026 16:11:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wMTE2-0002Jn-6l; Mon, 11 May 2026 16:11:22 +0000 Received: by outflank-mailman (input) for mailman id 1306319; Mon, 11 May 2026 16:11:21 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wMTE0-0002Jf-VY for xen-devel@lists.xenproject.org; Mon, 11 May 2026 16:11:20 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wMTE0-006ykw-1o for xen-devel@lists.xenproject.org; Mon, 11 May 2026 18:11:20 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a01ff99-bab6-0a2a0a5309dd-0a2a4504e8f0-28 for ; Mon, 11 May 2026 18:11:20 +0200 Received: from [209.85.167.48] (helo=mail-lf1-f48.google.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a01ffa7-1dec-0a2a45040019-d155a730dd6d-3 for ; Mon, 11 May 2026 18:11:19 +0200 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5a8cb92f26aso1217441e87.1 for ; Mon, 11 May 2026 09:11:19 -0700 (PDT) Received: from [10.17.80.122] (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a8a956606fsm2729763e87.60.2026.05.11.09.11.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 09:11:17 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778515879; x=1779120679; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Sls1bHMvWLGjROEhjj794p0jW0oEgupA7PELvWg6QEo=; b=E7+Ldo0P8dunEG3fGto7rH9E4gvzoctBQMNXNPNK/9gDSRrqM9qUHU1Z67kRuZNECF 5yOHCa3RU4VNG5F2uW/Sbs5oreVx/zMReAF1J/XKK0SSzvbZivtO45iNXkQlDmlo2GNj EMFMev5c2GLlGlo3C3jNrEq+s4tMGXERKNynCROeRLs4XKNK72/zM5uoeqKi5y8VPEgD MhreLSw9p4JZAqJ5+zagvNRaaOezyOOdJOqe1/xKge3MOhWa3/QIVG85p4PCresFLk2U hr99TSKRSi2BYBP5QtNY6NDgK+c+kWLIj/hAjq00TQqDf2Ybh7OB3CFzNVFyG0Xb/Suc ArGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778515879; x=1779120679; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Sls1bHMvWLGjROEhjj794p0jW0oEgupA7PELvWg6QEo=; b=A0FAAzYs+s9QlIXuynN0+syA1dAKRHCP6orEqZEzQ6Vm++FFYXaUUoa2UlIx2TYTGG x641wWWGYmNk4i2BRtcddkYSJZCTcPlgPSnOyG36YWe1zAfhZb5hYsBfYUZxx6eF9dBs 4/3EcqlERcqXwLwlATXfS0VKmNBF1TD2tFsiVpkxVlwLCRQK0N4vVlmJOrNl0DrvQofL akVezXWJogL/YQBpOIPaGRxEtKjBCMGRZZ62uuZZGxdRdg/ev/2l9pqjjZ/oW/hXnq4u +wxUKRg8YcsRXJ1ZU5YAfmhy2xcLQP5WEzJgv3xNDQm8ck3cuWjmAH0Yu5lElTl/v8TE Xw5g== X-Forwarded-Encrypted: i=1; AFNElJ/Cm7jE1fNW1seFIlOAjPzlQVVYHB/FcXbRdPx5HaXouvBl9RhFv4IMrwgz6jZXz+sV7SS+UqY6HvU=@lists.xenproject.org X-Gm-Message-State: AOJu0YzMTqjl5sopHId+c7Zkge/bCSfmDdVF2lkJynRw83T+HIv9yo5S NDS/e+N0JnAK7hcCIw6pJ4pDhyKw9ojygxEECfHg4mSA9yJ13Hx/c4aq X-Gm-Gg: Acq92OEVLaJjUUDyrvr9ksrl2GCCgkb7Pl6mF/mrZNts+O9MvYcj8XvRanTrRaQgv5A 6fEd+EgwI2P4O4Uyj9jjqlEtS8k7HlfN4ZZbH1aXIEh5ZqzS/hErbHw6/U2Nv0A83XPVLIItI+O 97dFJAsLpiVZsG2OqlZh1xVdhISlqyaWah+6pE1amzzDj5IW5Cwyh04VSihH3pfb3dAZEP71VzV rLFlSJK33PJGx20GsdLhed29AZwJe+bZxsjkf/fUP7OBu9uzHIrQEqk7/CDF/QIqz7WIpv4qAm4 BM8x7+NKeGujfSTUxZI4yfNpwmT9T6hEV5JajJanwIS271DQVmp12yKj3vY1nJD50XGpoGvESPy pue9yj/m1J/gsTXYCyhRK9bZr7wZaSDr7wRfZTK+ChsO4lbIAZbE4uSGaFAhFm3pUZKi0jcnC8l rlYhCgAaRLUjSwUysqF0bSiXGhQuWKJnJjgenJcc7H0gjAOf0iSCe+x1Y= X-Received: by 2002:a05:6512:3188:b0:5a3:f2ed:87cd with SMTP id 2adb3069b0e04-5a887adfccemr9511589e87.10.1778515878947; Mon, 11 May 2026 09:11:18 -0700 (PDT) Message-ID: Date: Mon, 11 May 2026 19:11:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 10/13] xen/arm: Resume memory management on Xen resume To: Mykola Kvach , "xen-devel@lists.xenproject.org" Cc: Mykola Kvach , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk References: <02b55a02f329d09c9f8b15d97ca9176b3c33017a.1775125380.git.mykola_kvach@epam.com> <873402ub63.fsf@epam.com> Content-Language: en-US From: Oleksandr Tyshchenko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-ebf023/1778515879-42F653FF-4178308E/0/0 X-purgate-type: clean X-purgate-size: 2925 On 5/8/26 23:59, Mykola Kvach wrote: Hello Mykola > Hi Volodymyr, > > Thank you for the feedback. > > On Fri, May 8, 2026 at 1:06 AM Volodymyr Babchuk > wrote: >> >> Hi Mykola, >> >> Mykola Kvach writes: >> >>> From: Mirela Simonovic >>> >>> The MMU must be enabled during the resume path before restoring context, >>> as virtual addresses are used to access the saved context data. >>> >> >> I agree with Luca, this patch does not makes sense as is. I don't see >> why it should be separated from the rest of the resume path that is >> added in the next patch > > Ack. I'll combine this with the next patch in v9. > > Best regards, > Mykola > >> >>> This patch adds MMU setup during resume by reusing the existing >>> enable_secondary_cpu_mm function, which enables data cache and the MMU. >>> Before the MMU is enabled, the content of TTBR0_EL2 is changed to point >>> to init_ttbr (page tables used at runtime). >>> >>> Signed-off-by: Mirela Simonovic >>> Signed-off-by: Saeed Nowshadi >>> Signed-off-by: Mykyta Poturai >>> Signed-off-by: Mykola Kvach >>> --- >>> Changes in v7: >>> - no functional changes, just moved commit >>> --- >>> xen/arch/arm/arm64/head.S | 24 ++++++++++++++++++++++++ >>> 1 file changed, 24 insertions(+) >>> >>> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S >>> index 72c7b24498..596e960152 100644 >>> --- a/xen/arch/arm/arm64/head.S >>> +++ b/xen/arch/arm/arm64/head.S >>> @@ -561,6 +561,30 @@ END(efi_xen_start) >>> >>> #endif /* CONFIG_ARM_EFI */ >>> >>> +#ifdef CONFIG_SYSTEM_SUSPEND >>> + >>> +FUNC(hyp_resume) >>> + /* Initialize the UART if earlyprintk has been enabled. */ >>> +#ifdef CONFIG_EARLY_PRINTK >>> + bl init_uart >>> +#endif >>> + PRINT_ID("- Xen resuming -\r\n") >>> + >>> + bl check_cpu_mode >>> + bl cpu_init >>> + >>> + ldr x0, =start >>> + adr x20, start /* x20 := paddr (start) */ >>> + sub x20, x20, x0 /* x20 := phys-offset */ >>> + ldr lr, =mmu_resumed >>> + b enable_secondary_cpu_mm >>> + >>> +mmu_resumed: >>> + b . I also think this patch would be better squashed with the next one, as they are tightly coupled. During the review of patch 11, I had to switch between patches 10 and 11 several times to understand the full context—patch 10 sets up hyp_resume with a placeholder (b .), and patch 11 immediately fills in the actual context restore. >>> +END(hyp_resume) >>> + >>> +#endif /* CONFIG_SYSTEM_SUSPEND */ >>> + >>> /* >>> * Local variables: >>> * mode: ASM >> >> -- >> WBR, Volodymyr >