[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qemu-discuss
Subject:    Re: ID_AA64MMFR1 VHE fields read as 0 when virtualization=true
From:       Peter Maydell <peter.maydell () linaro ! org>
Date:       2022-02-17 11:54:00
Message-ID: CAFEAcA9o_Zz-U9tZYtapQT=Pu8khP6GCyCacyAfUh-z0bOPJ3w () mail ! gmail ! com
[Download RAW message or body]

On Thu, 17 Feb 2022 at 08:49, Chan Kim <ckim@etri.re.kr> wrote:
> I found by setting -cpu max, this ID_AA64MMFR1 register value is read correctly.

The value is correct in both cases. The Cortex-A72 does not implement
the VHE architecture feature (it is mandatory from Armv8.1, but the
A72 is an Armv8.0 core). The 'max' CPU implements every feature
our emulation supports, which includes VHE.

> But with qemu-5.1.0, this register value's VH value is read as "0000" so it goes to \
> ‘install_el2_stub' and returns with ‘msr elr_el2, lr' and ‘eret' so that it \
> drops down to el1 and start_kernsl runs in el1.

This is all expected -- if the CPU does not support VHE then
the kernel will fall back to implementing KVM in the older way
(running the kernel proper in EL1 and with stub code in EL2
to do the things that must be done from EL2).

> I thought by setting ‘virtualization=true', the VH value will be
> read as 1 and other VH features will be enabled in qemu but it seems not.

No. virtualization=true just means "CPU should support virtualization,
ie have an EL2".

thanks
-- PMM


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic