Skip to content

KVM: arm/arm64: fix some races and allow userspace to set MPIDR

Andrew Jones kvmarm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: arm/arm64: prepare to use vcpu requestsarch/arm/kvm/handle_exit.c arch/arm/kvm/psci.c arch/arm64/kvm/handle_exit.c+3 -01 reply
2/5KVM: arm/arm64: replace vcpu->arch.pause with a vcpu-requestarch/arm/include/asm/kvm_host.h arch/arm/kvm/arm.c arch/arm64/include/asm/kvm_host.h+15 -215 replies
3/5KVM: arm/arm64: replace vcpu->arch.power_off with a vcpu-requestarch/arm/include/asm/kvm_host.h arch/arm/kvm/arm.c arch/arm/kvm/psci.c +1 more+25 -320 replies
4/5KVM: arm/arm64: fix race in kvm_psci_vcpu_onarch/arm/kvm/psci.c include/linux/kvm_host.h+7 -20 replies
5/5KVM: arm/arm64: allow userspace to set MPIDRarch/arm/include/asm/kvm_emulate.h arch/arm/include/asm/kvm_host.h arch/arm/kvm/arm.c +6 more+119 -244 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchChristoffer Dall
1/5A-b
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] KVM: arm/arm64: fix some races and allow userspace to set MPIDR

This series fixes four races. Two are easy to produce with a kvm-unit-test test[1], but the other two would be quite hard. I didn't even try to produce those. The two hard to produce races are addressed by changing vcpu->arch.pause and vcpu->arch.power_off to vcpu requests. The two easy to produce races are addressed in two different ways: the first takes advantage of power_off having been changed to a vcpu request, the second caches vcpu MPIDRs in order to avoid extracting them from sys_regs. When introducing the MPIDR cache we also introduce a new feature (userspace settable MPIDRs).

Support for userspace settable MPIDRs was already posted once[2], but rejected due to not having a use case. We have one now, which is to satisfy QEMU's need for the MPDIR information very early, before vcpu-init has even run. While the original posting author wasn't me, I've taken authorship now, as I've changed the patch substantially. If anybody disagrees with that, then feel free to suggest alternatives. The QEMU counterpart has been posted[3].

This series is based on Radim's recent posting[4] that improves the vcpu-request framework. I've tested the series on a couple AArch64 platforms and compile-tested the arm bits.

[1] https://lists.cs.columbia.edu/pipermail/kvmarm/2017-February/023820.html
[2] https://lists.cs.columbia.edu/pipermail/kvmarm/2016-April/019691.html
[3] http://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg06895.html
[4] https://www.mail-archive.com/[email protected]/msg1340496.html

Andrew Jones (4):
KVM: arm/arm64: prepare to use vcpu requests
KVM: arm/arm64: replace vcpu->arch.pause with a vcpu-request
KVM: arm/arm64: replace vcpu->arch.power_off with a vcpu-request
KVM: arm/arm64: allow userspace to set MPIDR

Levente Kurusa (1):
KVM: arm/arm64: fix race in kvm_psci_vcpu_on

 arch/arm/include/asm/kvm_emulate.h   |  2 +-
 arch/arm/include/asm/kvm_host.h      | 12 +++----
 arch/arm/kvm/arm.c                   | 49 ++++++++++++++-------------
 arch/arm/kvm/coproc.c                | 61 +++++++++++++++++++++++++++++-----
 arch/arm/kvm/coproc.h                |  6 ++++
 arch/arm/kvm/handle_exit.c           |  1 +
 arch/arm/kvm/psci.c                  | 18 ++++------
 arch/arm64/include/asm/kvm_emulate.h |  2 +-
 arch/arm64/include/asm/kvm_host.h    | 12 +++----
 arch/arm64/kvm/handle_exit.c         |  1 +
 arch/arm64/kvm/sys_regs.c            | 64 ++++++++++++++++++++++++++++--------
 include/linux/kvm_host.h             |  5 +++
 include/uapi/linux/kvm.h             |  1 +
 13 files changed, 162 insertions(+), 72 deletions(-)
Signature · 1 line
2.9.3