summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2022-03-18 17:48:40 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-23 09:10:43 +0100
commit5f051d32b03f08a0507ac1afd7b9c0a30c8e5d59 (patch)
tree68e898f7c0c2b453789c23f43fa8acd9f48902d4 /virt
parentc20d551744797000c4af993f7d59ef8c69732949 (diff)
downloadlinux-stable-5f051d32b03f08a0507ac1afd7b9c0a30c8e5d59.tar.gz
linux-stable-5f051d32b03f08a0507ac1afd7b9c0a30c8e5d59.tar.bz2
linux-stable-5f051d32b03f08a0507ac1afd7b9c0a30c8e5d59.zip
KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated
commit a5905d6af492ee6a4a2205f0d550b3f931b03d03 upstream. KVM allows the guest to discover whether the ARCH_WORKAROUND SMCCC are implemented, and to preserve that state during migration through its firmware register interface. Add the necessary boiler plate for SMCCC_ARCH_WORKAROUND_3. Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> [ kvm code moved to virt/kvm/arm, removed fw regs ABI. Added 32bit stub ] Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/psci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/virt/kvm/arm/psci.c b/virt/kvm/arm/psci.c
index 34d08ee63747..a161951e55a5 100644
--- a/virt/kvm/arm/psci.c
+++ b/virt/kvm/arm/psci.c
@@ -429,6 +429,18 @@ int kvm_hvc_call_handler(struct kvm_vcpu *vcpu)
break;
}
break;
+ case ARM_SMCCC_ARCH_WORKAROUND_3:
+ switch (kvm_arm_get_spectre_bhb_state()) {
+ case SPECTRE_VULNERABLE:
+ break;
+ case SPECTRE_MITIGATED:
+ val = SMCCC_RET_SUCCESS;
+ break;
+ case SPECTRE_UNAFFECTED:
+ val = SMCCC_ARCH_WORKAROUND_RET_UNAFFECTED;
+ break;
+ }
+ break;
}
break;
default: