|
16 | 16 | #include <asm/kvm_hyp.h> |
17 | 17 | #include <asm/kvm_mmu.h> |
18 | 18 |
|
| 19 | +#define SYS_IMP_APL_ACTLR_EL12 sys_reg(3, 6, 15, 14, 6) |
| 20 | + |
19 | 21 | static inline void __sysreg_save_common_state(struct kvm_cpu_context *ctxt) |
20 | 22 | { |
21 | 23 | ctxt_sys_reg(ctxt, MDSCR_EL1) = read_sysreg(mdscr_el1); |
@@ -70,6 +72,9 @@ static inline void __sysreg_save_el1_state(struct kvm_cpu_context *ctxt) |
70 | 72 | ctxt_sys_reg(ctxt, SP_EL1) = read_sysreg(sp_el1); |
71 | 73 | ctxt_sys_reg(ctxt, ELR_EL1) = read_sysreg_el1(SYS_ELR); |
72 | 74 | ctxt_sys_reg(ctxt, SPSR_EL1) = read_sysreg_el1(SYS_SPSR); |
| 75 | + if (IS_ENABLED(CONFIG_ARM64_ACTLR_STATE) && |
| 76 | + alternative_has_cap_unlikely(ARM64_HAS_TSO_APPLE)) |
| 77 | + ctxt_sys_reg(ctxt, ACTLR_EL1) = read_sysreg_s(SYS_IMP_APL_ACTLR_EL12); |
73 | 78 | } |
74 | 79 |
|
75 | 80 | static inline void __sysreg_save_el2_return_state(struct kvm_cpu_context *ctxt) |
@@ -138,6 +143,10 @@ static inline void __sysreg_restore_el1_state(struct kvm_cpu_context *ctxt) |
138 | 143 | write_sysreg(ctxt_sys_reg(ctxt, PAR_EL1), par_el1); |
139 | 144 | write_sysreg(ctxt_sys_reg(ctxt, TPIDR_EL1), tpidr_el1); |
140 | 145 |
|
| 146 | + if (IS_ENABLED(CONFIG_ARM64_ACTLR_STATE) && |
| 147 | + alternative_has_cap_unlikely(ARM64_HAS_TSO_APPLE)) |
| 148 | + write_sysreg_s(ctxt_sys_reg(ctxt, ACTLR_EL1), SYS_IMP_APL_ACTLR_EL12); |
| 149 | + |
141 | 150 | if (ctxt_has_mte(ctxt)) { |
142 | 151 | write_sysreg_el1(ctxt_sys_reg(ctxt, TFSR_EL1), SYS_TFSR); |
143 | 152 | write_sysreg_s(ctxt_sys_reg(ctxt, TFSRE0_EL1), SYS_TFSRE0_EL1); |
|
0 commit comments