Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* QNS: ARM64: Cache coherency while doing Kexec for KHO
@ 2026-08-11 19:19 tarunsahu
  2026-08-11 19:23 ` tarunsahu
  2026-08-11 19:30 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: tarunsahu @ 2026-08-11 19:19 UTC (permalink / raw)
  To: Pasha Tatashin, Pratyush Yadav, Mike Rapoport, will, changyuanl,
	Alexander Graf, mark.rutland, jgg
  Cc: linux-arm-kernel, kexec


Hi,

I have a question regarding cache maintenance for Kernel Handover (KHO)
preserved memory across kexec reboots on arm64.

During kexec, all other CPUs gets hot-unplugged where they flush all
of their caches so there will be no issues with any KHO data preserved
having caches on these CPUs.

But CPU0 still has not been flushed its D-cache (Is this correct?) and
it will only do flushing for specific area by kexec_segment_flush().

So for KHO preserved memory, if its caches still marked dirty on CPU0
they will not be flushed?

Is my understanding correct? or AM I missing something?
Also if this true, This will be a problem?

PS: Pardon my less knowledge on ARM64 cache coherency.

~Tarun


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: QNS: ARM64: Cache coherency while doing Kexec for KHO
  2026-08-11 19:19 QNS: ARM64: Cache coherency while doing Kexec for KHO tarunsahu
@ 2026-08-11 19:23 ` tarunsahu
  2026-08-11 19:30 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: tarunsahu @ 2026-08-11 19:23 UTC (permalink / raw)
  To: Pasha Tatashin, Pratyush Yadav, Mike Rapoport, will, changyuanl,
	Alexander Graf, mark.rutland, jgg, dmatlack, skhawaja
  Cc: linux-arm-kernel, kexec


+ Added more folks to the lists

Tarun Sahu <tarunsahu@google.com> writes:

> Hi,
>
> I have a question regarding cache maintenance for Kernel Handover (KHO)
> preserved memory across kexec reboots on arm64.
>
> During kexec, all other CPUs gets hot-unplugged where they flush all
> of their caches so there will be no issues with any KHO data preserved
> having caches on these CPUs.
>
> But CPU0 still has not been flushed its D-cache (Is this correct?) and
> it will only do flushing for specific area by kexec_segment_flush().
>
> So for KHO preserved memory, if its caches still marked dirty on CPU0
> they will not be flushed?
>
> Is my understanding correct? or AM I missing something?
> Also if this true, This will be a problem?
>
> PS: Pardon my less knowledge on ARM64 cache coherency.
>
> ~Tarun


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: QNS: ARM64: Cache coherency while doing Kexec for KHO
  2026-08-11 19:19 QNS: ARM64: Cache coherency while doing Kexec for KHO tarunsahu
  2026-08-11 19:23 ` tarunsahu
@ 2026-08-11 19:30 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2026-08-11 19:30 UTC (permalink / raw)
  To: tarunsahu
  Cc: Pasha Tatashin, Pratyush Yadav, Mike Rapoport, will, changyuanl,
	Alexander Graf, mark.rutland, linux-arm-kernel, kexec

On Tue, Aug 11, 2026 at 07:19:11PM +0000, tarunsahu@google.com wrote:
> 
> Hi,
> 
> I have a question regarding cache maintenance for Kernel Handover (KHO)
> preserved memory across kexec reboots on arm64.
> 
> During kexec, all other CPUs gets hot-unplugged where they flush all
> of their caches so there will be no issues with any KHO data preserved
> having caches on these CPUs.
> 
> But CPU0 still has not been flushed its D-cache (Is this correct?) and
> it will only do flushing for specific area by kexec_segment_flush().
> 
> So for KHO preserved memory, if its caches still marked dirty on CPU0
> they will not be flushed?
> 
> Is my understanding correct? or AM I missing something?
> Also if this true, This will be a problem?
> 
> PS: Pardon my less knowledge on ARM64 cache coherency.

Yes, I think what you outline is correct, but I don't think it is a
problem.

As long as the CPU cache implementation is physically tagged and
everything kexec runs during boot with paging and caching disabled is
flushed it should be fine.

Once the new kernel comes up and installs a page table with cachable
attributes everything will still be consistent from the CPU's
perspective.

Anything in the new kernel that needs forced coherence, like DMA, will
be doing flushes anyhow.

Jason


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-11 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11 19:19 QNS: ARM64: Cache coherency while doing Kexec for KHO tarunsahu
2026-08-11 19:23 ` tarunsahu
2026-08-11 19:30 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox