summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/arm.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-08-20 12:23:02 +0100
committerMarc Zyngier <maz@kernel.org>2021-08-20 12:23:02 +0100
commit78bc117095cc30408e2131e81757a6659ac4b002 (patch)
treed34bd6cb153cb54c44fa03b7bdc592eaeab7ea2d /arch/arm64/kvm/arm.c
parentcf0c7125d5783f93b78921845d4b101c65a7998b (diff)
parentcb97cf95c44021278b7637731bc0928026bc29ab (diff)
downloadlinux-78bc117095cc30408e2131e81757a6659ac4b002.tar.gz
linux-78bc117095cc30408e2131e81757a6659ac4b002.tar.bz2
linux-78bc117095cc30408e2131e81757a6659ac4b002.zip
Merge branch kvm-arm64/psci/cpu_on into kvmarm-master/next
PSCI fixes from Oliver Upton: - Plug race on reset - Ensure that a pending reset is applied before userspace accesses - Reject PSCI requests with illegal affinity bits * kvm-arm64/psci/cpu_on: selftests: KVM: Introduce psci_cpu_on_test KVM: arm64: Enforce reserved bits for PSCI target affinities KVM: arm64: Handle PSCI resets before userspace touches vCPU state KVM: arm64: Fix read-side race on updates to vcpu reset state Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/arm.c')
-rw-r--r--arch/arm64/kvm/arm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index fd9a6bcf797f..1decdec70102 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -1216,6 +1216,14 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
if (copy_from_user(&reg, argp, sizeof(reg)))
break;
+ /*
+ * We could owe a reset due to PSCI. Handle the pending reset
+ * here to ensure userspace register accesses are ordered after
+ * the reset.
+ */
+ if (kvm_check_request(KVM_REQ_VCPU_RESET, vcpu))
+ kvm_reset_vcpu(vcpu);
+
if (ioctl == KVM_SET_ONE_REG)
r = kvm_arm_set_reg(vcpu, &reg);
else