]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
KVM: PPC: Book3S HV: Hold kvm->lock around call to kvmppc_update_lpcr
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 11 Sep 2017 06:05:30 +0000 (16:05 +1000)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Oct 2017 21:20:08 +0000 (16:20 -0500)
commit30bd2ec2b10a9586ff77a5e9d98638f5ed0c3640
tree2e10f7b0e7b06e7cccc80110bffbf0e21b3cde92
parent626597dab1faea00e462456a8811996d9e401bbf
KVM: PPC: Book3S HV: Hold kvm->lock around call to kvmppc_update_lpcr

BugLink: http://bugs.launchpad.net/bugs/1721777
commit cf5f6f3125241853462334b1bc696f3c3c492178 upstream.

Commit 468808bd35c4 ("KVM: PPC: Book3S HV: Set process table for HPT
guests on POWER9", 2017-01-30) added a call to kvmppc_update_lpcr()
which doesn't hold the kvm->lock mutex around the call, as required.
This adds the lock/unlock pair, and for good measure, includes
the kvmppc_setup_partition_table() call in the locked region, since
it is altering global state of the VM.

This error appears not to have any fatal consequences for the host;
the consequences would be that the VCPUs could end up running with
different LPCR values, or an update to the LPCR value by userspace
using the one_reg interface could get overwritten, or the update
done by kvmhv_configure_mmu() could get overwritten.

Fixes: 468808bd35c4 ("KVM: PPC: Book3S HV: Set process table for HPT guests on POWER9")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/powerpc/kvm/book3s_hv.c