diff options
author | Will Deacon <will.deacon@arm.com> | 2018-08-08 17:10:54 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2018-09-14 18:46:20 +0200 |
commit | 7c36447ae5a090729e7b129f24705bb231a07e0b (patch) | |
tree | 30a096c5533d645081b5a558d6c538c3a245ae32 /arch/arm64/kvm/hyp | |
parent | arm64: ssbd: Add support for PSTATE.SSBS rather than trapping to EL3 (diff) | |
download | linux-7c36447ae5a090729e7b129f24705bb231a07e0b.tar.xz linux-7c36447ae5a090729e7b129f24705bb231a07e0b.zip |
KVM: arm64: Set SCTLR_EL2.DSSBS if SSBD is forcefully disabled and !vhe
When running without VHE, it is necessary to set SCTLR_EL2.DSSBS if SSBD
has been forcefully disabled on the kernel command-line.
Acked-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kvm/hyp')
-rw-r--r-- | arch/arm64/kvm/hyp/sysreg-sr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/sysreg-sr.c b/arch/arm64/kvm/hyp/sysreg-sr.c index 9ce223944983..76d016b446b2 100644 --- a/arch/arm64/kvm/hyp/sysreg-sr.c +++ b/arch/arm64/kvm/hyp/sysreg-sr.c @@ -288,3 +288,14 @@ void kvm_vcpu_put_sysregs(struct kvm_vcpu *vcpu) vcpu->arch.sysregs_loaded_on_cpu = false; } + +void __hyp_text __kvm_enable_ssbs(void) +{ + u64 tmp; + + asm volatile( + "mrs %0, sctlr_el2\n" + "orr %0, %0, %1\n" + "msr sctlr_el2, %0" + : "=&r" (tmp) : "L" (SCTLR_ELx_DSSBS)); +} |