[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/9] hw/arm/boot: If booting a kernel in EL2, set SC
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 3/9] hw/arm/boot: If booting a kernel in EL2, set SCR_EL3.HCE |
Date: |
Tue, 13 Mar 2018 15:34:52 +0000 |
If we're directly booting a Linux kernel and the CPU supports both
EL3 and EL2, we start the kernel in EL2, as it expects. We must also
set the SCR_EL3.HCE bit in this situation, so that the HVC
instruction is enabled rather than UNDEFing. Otherwise at least some
kernels will panic when trying to initialize KVM in the guest.
Signed-off-by: Peter Maydell <address@hidden>
---
hw/arm/boot.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index e21a92f972..9319b12fcd 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -729,6 +729,11 @@ static void do_cpu_reset(void *opaque)
assert(!info->secure_board_setup);
}
+ if (arm_feature(env, ARM_FEATURE_EL2)) {
+ /* If we have EL2 then Linux expects the HVC insn to work
*/
+ env->cp15.scr_el3 |= SCR_HCE;
+ }
+
/* Set to non-secure if not a secure boot */
if (!info->secure_boot &&
(cs != first_cpu || !info->secure_board_setup)) {
--
2.16.2
- Re: [Qemu-devel] [Qemu-arm] [PATCH 1/9] hw/arm/raspi: Don't do board-setup or secure-boot for raspi3, (continued)
- [Qemu-devel] [PATCH 4/9] hw/arm/bcm2386: Fix parent type of bcm2386, Peter Maydell, 2018/03/13
- [Qemu-devel] [PATCH 7/9] hw/arm/bcm2836: Use correct affinity values for BCM2837, Peter Maydell, 2018/03/13
- [Qemu-devel] [PATCH 9/9] hw/arm/raspi: Provide spin-loop code for AArch64 CPUs, Peter Maydell, 2018/03/13
- [Qemu-devel] [PATCH 3/9] hw/arm/boot: If booting a kernel in EL2, set SCR_EL3.HCE,
Peter Maydell <=
- [Qemu-devel] [PATCH 8/9] hw/arm/bcm2836: Hardcode correct CPU type, Peter Maydell, 2018/03/13
- Re: [Qemu-devel] [PATCH 8/9] hw/arm/bcm2836: Hardcode correct CPU type, Peter Maydell, 2018/03/15
- Re: [Qemu-devel] [PATCH 8/9] hw/arm/bcm2836: Hardcode correct CPU type, Igor Mammedov, 2018/03/19
- Re: [Qemu-devel] [PATCH 8/9] hw/arm/bcm2836: Hardcode correct CPU type, Peter Maydell, 2018/03/19
Re: [Qemu-devel] [PATCH 8/9] hw/arm/bcm2836: Hardcode correct CPU type, Philippe Mathieu-Daudé, 2018/03/13