[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/10] arm/arm-powerctl: set NSACR.{CP11, CP10} bits in arm_set_c
From: |
Niek Linnenbank |
Subject: |
[PATCH 06/10] arm/arm-powerctl: set NSACR.{CP11, CP10} bits in arm_set_cpu_on() |
Date: |
Mon, 2 Dec 2019 22:09:43 +0100 |
This change ensures that the FPU can be accessed in Non-Secure mode
when the CPU core is reset using the arm_set_cpu_on() function call.
The NSACR.{CP11,CP10} bits define the exception level required to
access the FPU in Non-Secure mode. Without these bits set, the CPU
will give an undefined exception trap on the first FPU access for the
secondary cores under Linux.
Fixes: fc1120a7f5
Signed-off-by: Niek Linnenbank <address@hidden>
---
target/arm/arm-powerctl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index f77a950db6..b064513d44 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -104,6 +104,9 @@ static void arm_set_cpu_on_async_work(CPUState
*target_cpu_state,
/* Processor is not in secure mode */
target_cpu->env.cp15.scr_el3 |= SCR_NS;
+ /* Set NSACR.{CP11,CP10} so NS can access the FPU */
+ target_cpu->env.cp15.nsacr |= 3 << 10;
+
/*
* If QEMU is providing the equivalent of EL3 firmware, then we need
* to make sure a CPU targeting EL2 comes out of reset with a
--
2.17.1
- Re: [PATCH 02/10] hw: arm: add Xunlong Orange Pi PC machine, (continued)
- Re: [PATCH 02/10] hw: arm: add Xunlong Orange Pi PC machine, Niek Linnenbank, 2019/12/04
- Re: [PATCH 02/10] hw: arm: add Xunlong Orange Pi PC machine, Niek Linnenbank, 2019/12/05
- Re: [PATCH 02/10] hw: arm: add Xunlong Orange Pi PC machine, Philippe Mathieu-Daudé, 2019/12/06
- Re: [PATCH 02/10] hw: arm: add Xunlong Orange Pi PC machine, Niek Linnenbank, 2019/12/06
- Re: [PATCH 02/10] hw: arm: add Xunlong Orange Pi PC machine, Philippe Mathieu-Daudé, 2019/12/10
- Re: [PATCH 02/10] hw: arm: add Xunlong Orange Pi PC machine, Niek Linnenbank, 2019/12/10
[PATCH 05/10] arm: allwinner-h3: add System Control module, Niek Linnenbank, 2019/12/02
[PATCH 06/10] arm/arm-powerctl: set NSACR.{CP11, CP10} bits in arm_set_cpu_on(),
Niek Linnenbank <=
Re: [PATCH 00/10] Add Allwinner H3 SoC and Orange Pi PC Machine, Philippe Mathieu-Daudé, 2019/12/03