[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/17] target-arm: Don't report presence of EL2 if it
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 09/17] target-arm: Don't report presence of EL2 if it doesn't exist |
Date: |
Wed, 3 Feb 2016 18:59:12 +0000 |
We already modify the processor feature bits to not report EL3
support to the guest if EL3 isn't enabled for the CPU we're emulating.
Add similar support for not reporting EL2 unless it is enabled.
This is necessary because real world guest code running at EL3
(trusted firmware or bootloaders) will query the ID registers to
determine whether it should start a guest Linux kernel in EL2 or EL3.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Sergey Fedorov <address@hidden>
Message-id: address@hidden
---
target-arm/cpu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 0e582c4..7ddbf3d 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -650,6 +650,15 @@ static void arm_cpu_realizefn(DeviceState *dev, Error
**errp)
cpu->id_aa64pfr0 &= ~0xf000;
}
+ if (!arm_feature(env, ARM_FEATURE_EL2)) {
+ /* Disable the hypervisor feature bits in the processor feature
+ * registers if we don't have EL2. These are id_pfr1[15:12] and
+ * id_aa64pfr0_el1[11:8].
+ */
+ cpu->id_aa64pfr0 &= ~0xf00;
+ cpu->id_pfr1 &= ~0xf000;
+ }
+
if (!cpu->has_mpu) {
unset_feature(env, ARM_FEATURE_MPU);
}
--
1.9.1
- [Qemu-devel] [PULL 00/17] target-arm queue, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 01/17] virt-acpi-build: add always-on property for timer, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 16/17] arm/boot: move highbank secure board setup code to common routine, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 17/17] raspi: add raspberry pi 2 machine, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 15/17] bcm2836: add bcm2836 SoC device, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 05/17] target-arm: Rename check_s2_startlevel to check_s2_mmu_setup, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 08/17] libvixl: Avoid std::abs() of 64-bit type, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 12/17] bcm2835_ic: add bcm2835 interrupt controller, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 11/17] bcm2835_property: add bcm2835 property channel, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 02/17] target-arm: Make various system registers visible to EL3, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 09/17] target-arm: Don't report presence of EL2 if it doesn't exist,
Peter Maydell <=
- [Qemu-devel] [PULL 03/17] hw/arm: Setup EL1 and EL2 in AArch64 mode for 64bit Linux boots, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 04/17] target-arm: Apply S2 MMU startlevel table size check to AArch64, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 10/17] bcm2835_mbox: add BCM2835 mailboxes, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 14/17] bcm2836_control: add bcm2836 ARM control logic, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 06/17] target-arm: Implement the S2 MMU inputsize > pamax check, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 07/17] arm: virt-acpi: each MADT.GICC entry as enabled unconditionally, Peter Maydell, 2016/02/03
- [Qemu-devel] [PULL 13/17] bcm2835_peripherals: add rollup device for bcm2835 peripherals, Peter Maydell, 2016/02/03
- Re: [Qemu-devel] [PULL 00/17] target-arm queue, Peter Maydell, 2016/02/04