diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-07-26 13:01:52 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-08-06 17:32:01 +0200 |
commit | 44883f01fe6ae436a8604c47d8435276fef369b0 (patch) | |
tree | d2339b15742e5f66afb5ea7bf1e825710ac175dd /arch/x86/kvm/hyperv.h | |
parent | cf81a7e580ac0d598d3e7e9c06864168b2b4073d (diff) | |
download | linux-stable-44883f01fe6ae436a8604c47d8435276fef369b0.tar.gz linux-stable-44883f01fe6ae436a8604c47d8435276fef369b0.tar.bz2 linux-stable-44883f01fe6ae436a8604c47d8435276fef369b0.zip |
KVM: x86: ensure all MSRs can always be KVM_GET/SET_MSR'd
Some of the MSRs returned by GET_MSR_INDEX_LIST currently cannot be sent back
to KVM_GET_MSR and/or KVM_SET_MSR; either they can never be sent back, or you
they are only accepted under special conditions. This makes the API a pain to
use.
To avoid this pain, this patch makes it so that the result of the get-list
ioctl can always be used for host-initiated get and set. Since we don't have
a separate way to check for read-only MSRs, this means some Hyper-V MSRs are
ignored when written. Arguably they should not even be in the result of
GET_MSR_INDEX_LIST, but I am leaving there in case userspace is using the
outcome of GET_MSR_INDEX_LIST to derive the support for the corresponding
Hyper-V feature.
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/hyperv.h')
-rw-r--r-- | arch/x86/kvm/hyperv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/hyperv.h b/arch/x86/kvm/hyperv.h index 837465d69c6d..d6aa969e20f1 100644 --- a/arch/x86/kvm/hyperv.h +++ b/arch/x86/kvm/hyperv.h @@ -48,7 +48,7 @@ static inline struct kvm_vcpu *synic_to_vcpu(struct kvm_vcpu_hv_synic *synic) } int kvm_hv_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data, bool host); -int kvm_hv_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); +int kvm_hv_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata, bool host); bool kvm_hv_hypercall_enabled(struct kvm *kvm); int kvm_hv_hypercall(struct kvm_vcpu *vcpu); |