Re: [PATCH v4 07/10] cxl: add host cache flush and multi-function reset

Davidlohr Bueso
2026-01-21T20:33:53Z

On Wed, 21 Jan 2026, Jonathan Cameron wrote:

>On Tue, 20 Jan 2026 22:26:07 +0000
>smadhavan@nvidia.com wrote:
>
>> From: Srirangan Madhavan <smadhavan@nvidia.com>
>>
>> Flush host CPU caches for mapped HDM ranges after teardown and prepare
>> sibling Type 2 functions on multi-function devices. The host cache
>> maintenance uses wbinvd_on_all_cpus() on x86 and VA-based PoC clean+
>
>That's not sufficient in general on arm64. It might flush far enough
>or there might be buffers beyond the point of coherence that are not
>flushed.

... and quite slow for large regions without firmware assistance
(CLEAN_INV_MEMREGION from PSCI 1.3).

>Until there are clarifications from Arm we need something like the
>agents in drivers/cache to do equivalent of wbinvd_on_all_cpus()
>(be it on a PA range to making a tiny bit less horrible)
>
>Or we need an opt in list for platforms where a flush to PoC is enough.
>
>Needs to some sort of arch_ call as well, not hidden in the cxl driver.

Reset should just be using cpu_cache_invalidate_memregion().

... now, in addition to DCD, we have two users that are beyond the
"just once at boot time" use case.

Thanks,
Davidlohr