diff options
author | Nianyao Tang <tangnianyao@huawei.com> | 2022-12-20 11:50:24 +0100 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2023-01-12 22:15:16 +0100 |
commit | 59d78a2ec0e9cfba5935f3a0d3f14a771461cded (patch) | |
tree | 1a716454c69cfd36b94d8a957f6435498fd12cd4 /arch/arm64/kvm/fpsimd.c | |
parent | KVM: arm64: Kill CPACR_EL1_TTA definition (diff) | |
download | linux-59d78a2ec0e9cfba5935f3a0d3f14a771461cded.tar.xz linux-59d78a2ec0e9cfba5935f3a0d3f14a771461cded.zip |
KVM: arm64: Synchronize SMEN on vcpu schedule out
If we have VHE and need to reenable SME for host in
kvm_arch_vcpu_put_fp, CPACR.SMEN is modified from 0 to 1. Trap
control for reading SVCR is modified from enable to disable.
Synchronization is needed before reading SVCR later in
fpsimd_save, or it may cause sync exception which can not be
handled by host.
Cc: Marc Zyngier <maz@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Nianyao Tang <tangnianyao@huawei.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20221220105024.13484-1-dongbo4@huawei.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/kvm/fpsimd.c')
-rw-r--r-- | arch/arm64/kvm/fpsimd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kvm/fpsimd.c b/arch/arm64/kvm/fpsimd.c index 02dd7e9ebd39..f5799f571317 100644 --- a/arch/arm64/kvm/fpsimd.c +++ b/arch/arm64/kvm/fpsimd.c @@ -184,6 +184,7 @@ void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu) sysreg_clear_set(CPACR_EL1, CPACR_EL1_SMEN_EL0EN, CPACR_EL1_SMEN_EL1EN); + isb(); } if (vcpu->arch.fp_state == FP_STATE_GUEST_OWNED) { |