From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.mainlining.org (mail.mainlining.org [5.75.144.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F9A13DA7CC for ; Tue, 25 Aug 2026 20:58:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.75.144.95 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787691546; cv=none; b=MOCOeAT3eH4PbL/YPRWTi4dtxynOd1NVSCcBZSjcyz5hHP0ri8ccw+nYJSomN+Gapw3mwZUyF4jKEeIYEf2lh9uLOLVXeu+XCIWv4/9Ja8c91tRksWMAYGamumdCJcRMVTbkx3J8mqXAg6leMUqhWOzsoyoGnvbQWsOE6p7+G7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787691546; c=relaxed/simple; bh=qCTDHUwfSWmQtlcQbudWw7GuklhdV+TbBjkmorbIrl0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DIoyPS6nsnCDXTlbOGFF6STr5C0xoo8RfQyI8lBgh+SqW3t5V7X8fOzqg9MzlVaBoRGz6Zw304xACVrPje8mIzz85Inw/qNzeWy0JYofFs1IWBV4KNuSDMFEcwdKIq3Bmmo56bFG+hJvH2BSzUzj2cBAnYbPPQ93Z1yfdHQYs/M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mainlining.org; spf=pass smtp.mailfrom=mainlining.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b=QyLp5iTE; dkim=permerror (0-bit key) header.d=mainlining.org header.i=@mainlining.org header.b=ie7YX5QJ; arc=none smtp.client-ip=5.75.144.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mainlining.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mainlining.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b="QyLp5iTE"; dkim=permerror (0-bit key) header.d=mainlining.org header.i=@mainlining.org header.b="ie7YX5QJ" DKIM-Signature: v=1; a=rsa-sha256; s=202507r; d=mainlining.org; c=relaxed/relaxed; h=Message-ID:Date:Subject:To:From; t=1787691520; bh=0O+oUQUX+jAxuxBxQW9D024 AeP68nNqnUC52RYABhqI=; b=QyLp5iTET0O75a6RtR+b3mTEuGBLCQeXHoGKptbBxQEt4mL8BC QPwDPXEP4ZCad2fpMaHeojT6bGC573aTEGvlNKvu2k0vC5upwT8oMOE+KQUpg3OXX07qrjvLYyG /ZnC9VOHWT63QfVLycW0SaEWw2xj99rLYoNbMeOIhiikmBM3yx3W/QSkfp31z45yZVNyI5nW10B ikqzyE89853N/ho90xueXcumM8DWEw+hIztEqJnD68BPvl64YXm5x6MXqb38kG6sjsDYgVBBIvU t5y9L13b+XjL5qoTV9ajMV8llZG2V8HgyEhBV8Sktba3sVLGcz0YGzCfVGDs1bUEEpA==; DKIM-Signature: v=1; a=ed25519-sha256; s=202507e; d=mainlining.org; c=relaxed/relaxed; h=Message-ID:Date:Subject:To:From; t=1787691520; bh=0O+oUQUX+jAxuxBxQW9D024 AeP68nNqnUC52RYABhqI=; b=ie7YX5QJ/U1UgthPO/32NMOn81LBn1MM4WV1iYwlWBRdiqji9m n3ZBqR0jCQaCIesagDO3PjPwoFrpk3v29WDA==; From: Bradley Morgan To: Will Deacon Cc: Catalin Marinas , Mark Rutland , James Morse , Marc Zyngier , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, brads@mainlining.org Subject: [PATCH 0/7] arm64: hibernate: dust off the suspend/cleanup rework Date: Tue, 25 Aug 2026 20:58:32 +0000 Message-ID: <20260825205839.14571-1-brads@mainlining.org> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This comes out of the hibernate resume discussion where Will asked if the restored kernel's hyp vectors are reinstalled before we come back from swsusp_arch_suspend() and free the reserved pages. Rather than answer with a one off fix, this series reworks resume to look like a resume from idle, which makes the answer fall out on its own. The series leans on Mark Rutland's old work for inspiration, he had the same end goal in a branch from back then: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/suspend/cleanup The short answer to the question: yes, but only because the rework makes resume look like a resume from idle. We enter cpu_resume() at the highest available EL with the MMU off, and the resumed kernel installs its own hyp stub vectors into VBAR_EL2 through init_kernel_el() before anything else runs, so by the time swsusp_free() releases the trans_pgd copies nothing points at them anymore. The series is structured so the first patch stands alone as a stable worthy fix for the missing hvc arguments. The rest is the cleanup: the stale init_kernel_el() comment gets corrected, MTE tag pages get freed after save instead of leaking on failed hibernates, the fragile _cpu_resume() calling convention gets split, and the last patch reworks hibernate to use the regular cpu_resume() logic end to end. Everything object compiles and passes checkpatch and sparse. I could not boot or run a hibernate cycle on real hardware here, so that still wants doing before anyone gets excited. Bradley Morgan (7): arm64: hibernate: pass HVC_SET_VECTORS args to the resume hvc arm64: head: correct comment for init_kernel_el() arm64: hibernate: free MTE tag pages after saving arm64: hibernate: fix _cpu_resume() calling convention arm64: hibernate: use dcache_by_myline_op arm64: hibernate: only clean to PoC arm64: hibernate: use regular cpu_resume() logic arch/arm64/include/asm/suspend.h | 1 - arch/arm64/kernel/head.S | 6 +-- arch/arm64/kernel/hibernate-asm.S | 87 +++++++++++++++++++------------ arch/arm64/kernel/hibernate.c | 66 +++++++++++------------ arch/arm64/kernel/sleep.S | 6 +-- 5 files changed, 88 insertions(+), 78 deletions(-) -- 2.47.3