On 2/21/21 1:24 AM, Claudio Fontana wrote:
> From: Claudio Fontana <cfont...@centriq4.arch.suse.de>
> 
> extract it from the tcg helpers, as functionality is needed
> for KVM too.
> 
> Signed-off-by: Claudio Fontana <cfont...@suse.de>
> ---
>  target/arm/cpu-common.c | 68 +++++++++++++++++++++++++++++++++++++++++
>  target/arm/tcg/helper.c | 68 -----------------------------------------
>  2 files changed, 68 insertions(+), 68 deletions(-)

Hmm, not really.  The hypervisor (the linux kernel for kvm) uses EL2 itself,
and only exposes EL1 and EL0 to the virtualized guest.  Due to how
virtualization works on ARM, the same will be true for all hypervisors.

Thus, ARM_FEATURE_EL2 will always be unset, and arm_is_el2_enabled will always
be false.

I think you want a stub for !tcg like

/* EL2 is used by the hypervisor and never enabled for the guest. */
uint64_t arm_hcr_el2_eff(CPUARMState *env) { return 0; }


r~

Reply via email to