From: Bradley Morgan <brads@mainlining.org>
To: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
James Morse <james.morse@arm.com>, Marc Zyngier <maz@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, brads@mainlining.org
Subject: [PATCH 5/7] arm64: hibernate: use dcache_by_myline_op
Date: Tue, 25 Aug 2026 20:58:37 +0000 [thread overview]
Message-ID: <20260825205839.14571-6-brads@mainlining.org> (raw)
In-Reply-To: <20260825205839.14571-1-brads@mainlining.org>
swsusp_arch_suspend_exit() used to open code its cache maintenance, but
the dcache_by_myline_op macro does everything that open coded version
did, including the ARM64_WORKAROUND_CLEAN_CACHE handling. So use it.
Since this was first written the macro got split, with the trailing DSB
moved out into a wrapper, so use dcache_by_myline_op_nosync here and
keep relying on the DSB that already sits after the restore loop. That
keeps this a true no-op.
Signed-off-by: Bradley Morgan <brads@mainlining.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
---
arch/arm64/kernel/hibernate-asm.S | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/arch/arm64/kernel/hibernate-asm.S b/arch/arm64/kernel/hibernate-asm.S
index 2baefe7a82d3..f7613404f99e 100644
--- a/arch/arm64/kernel/hibernate-asm.S
+++ b/arch/arm64/kernel/hibernate-asm.S
@@ -66,16 +66,11 @@ SYM_CODE_START(swsusp_arch_suspend_exit)
copy_page x0, x1, x2, x3, x4, x5, x6, x7, x8, x9
+ /* Clean the restored page to the PoU */
+ mov x0, x10
add x1, x10, #PAGE_SIZE
- /* Clean the copied page to PoU - based on caches_clean_inval_pou() */
raw_dcache_line_size x2, x3
- sub x3, x2, #1
- bic x4, x10, x3
-2: /* clean D line / unified line */
-alternative_insn "dc cvau, x4", "dc civac, x4", ARM64_WORKAROUND_CLEAN_CACHE
- add x4, x4, x2
- cmp x4, x1
- b.lo 2b
+ dcache_by_myline_op_nosync cvau, x0, x1, x2, x3
ldr x19, [x19, #HIBERN_PBE_NEXT]
cbnz x19, 1b
--
2.47.3
next prev parent reply other threads:[~2026-08-25 20:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 20:58 [PATCH 0/7] arm64: hibernate: dust off the suspend/cleanup rework Bradley Morgan
2026-08-25 20:58 ` [PATCH 1/7] arm64: hibernate: pass HVC_SET_VECTORS args to the resume hvc Bradley Morgan
2026-08-25 20:58 ` [PATCH 2/7] arm64: head: correct comment for init_kernel_el() Bradley Morgan
2026-08-25 20:58 ` [PATCH 3/7] arm64: hibernate: free MTE tag pages after saving Bradley Morgan
2026-08-25 20:58 ` [PATCH 4/7] arm64: hibernate: fix _cpu_resume() calling convention Bradley Morgan
2026-08-25 20:58 ` Bradley Morgan [this message]
2026-08-25 20:58 ` [PATCH 6/7] arm64: hibernate: only clean to PoC Bradley Morgan
2026-08-25 20:58 ` [PATCH 7/7] arm64: hibernate: use regular cpu_resume() logic Bradley Morgan
2026-08-28 10:32 ` [PATCH 0/7] arm64: hibernate: dust off the suspend/cleanup rework Ard Biesheuvel
2026-08-28 11:31 ` Bradley Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260825205839.14571-6-brads@mainlining.org \
--to=brads@mainlining.org \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox