On 29 June 2018 at 14:29, Luc Michel <luc.mic...@greensocs.com> wrote:
> An access to the CPU interface is non-secure if the current GIC instance
> implements the security extensions, and the memory access is actually
> non-secure. Until then, it was checked with tests such as
>   if (s->security_extn && !attrs.secure) { ... }
> in various places of the CPU interface code.
>
> With the implementation of the virtualization extensions, those tests
> must be updated to take into account whether we are in a vCPU interface
> or not. This is because the exposed vCPU interface does not implement
> security extensions.
>
> This commits replaces all those tests with a call to the
> gic_cpu_ns_access() function to check if the current access to the CPU
> interface is non-secure. This function takes into account whether the
> current CPU is a vCPU or not.

Thanks -- this approach looks much cleaner.

> Note that this function is used only in the (v)CPU interface code path.
> The distributor code path is leaved unchanged, as the distributor is not

"left"

> exposed to vCPUs at all.
>
> Signed-off-by: Luc Michel <luc.mic...@greensocs.com>
> ---

Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>

thanks
-- PMM

Reply via email to