mbox series

[v1,0/2] KVM: arm64: Fix bugs related to mp_state updates

Message ID 20230419021852.2981107-1-reijiw@google.com (mailing list archive)
Headers show
Series KVM: arm64: Fix bugs related to mp_state updates | expand

Message

Reiji Watanabe April 19, 2023, 2:18 a.m. UTC
This series adds fixes that were missing in the patch [1].

The patch [1] added the mp_state_lock to serialize writes to
kvm_vcpu_arch::{mp_state, reset_state}, and promoted all
accessors of mp_state to {READ,WRITE}_ONCE() as readers do not
acquire the mp_state_lock.

Since the patch [1] didn't fix all the relevant code, fix the
code that weren't addressed yet.

This series is based on v6.3-rc7 with the series [2] applied.

[1] https://lore.kernel.org/all/20230327164747.2466958-2-oliver.upton@linux.dev/
[2] https://lore.kernel.org/all/20230327164747.2466958-1-oliver.upton@linux.dev/

Reiji Watanabe (2):
  KVM: arm64: Acquire mp_state_lock in kvm_arch_vcpu_ioctl_vcpu_init()
  KVM: arm64: Have kvm_psci_vcpu_on() use WRITE_ONCE() to update
    mp_state

 arch/arm64/kvm/arm.c  | 5 ++++-
 arch/arm64/kvm/psci.c | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Marc Zyngier April 20, 2023, 8:08 a.m. UTC | #1
On Tue, 18 Apr 2023 19:18:50 -0700, Reiji Watanabe wrote:
> This series adds fixes that were missing in the patch [1].
> 
> The patch [1] added the mp_state_lock to serialize writes to
> kvm_vcpu_arch::{mp_state, reset_state}, and promoted all
> accessors of mp_state to {READ,WRITE}_ONCE() as readers do not
> acquire the mp_state_lock.
> 
> [...]

Applied to next, thanks!

[1/2] KVM: arm64: Acquire mp_state_lock in kvm_arch_vcpu_ioctl_vcpu_init()
      commit: 4ff910be01c0ca28c2ea8b354dd47a3a17524489
[2/2] KVM: arm64: Have kvm_psci_vcpu_on() use WRITE_ONCE() to update mp_state
      commit: a189884bdc9238aeba941c50f02e25eb584fafed

Cheers,

	M.