Re: [PATCH v2 06/24] kvm: arm64: Move hyp-init params to a per-CPU struct

From: Marc Zyngier
Date: Wed Nov 25 2020 - 05:49:39 EST


On 2020-11-25 10:39, David Brazdil wrote:
On Mon, Nov 23, 2020 at 02:20:07PM +0000, Marc Zyngier wrote:

[...]

> +
> + /*
> + * Flush the init params from the data cache because the struct will
> + * be read while the MMU is off.
> + */
> + __flush_dcache_area(params, sizeof(*params));

nit: please use kvm_flush_dcache_to_poc(), as it clearly indicates to
which point we are flushing.

Will change, but out of curiosity - how is it different? AFAICT, it is just
an alias with a single use in __clean_dcache_guest_page:

#define kvm_flush_dcache_to_poc(a,l) __flush_dcache_area((a), (l))

It is indeed the exact same thing, but it says clearly in the name that we
are cleaning to the "Point Of Coherency", as opposed to any other architectural level (Unification or Persistence).

It makes it clear that we are cleaning all the way to the point where it can
be accessed reliably with an uncacheable mapping, and not leaving the data
dangling at a shallower cache level.

Thanks,

M.
--
Jazz is not dead. It just smells funny...