lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/7] KVM: x86: Ignore benign host accesses to "unsupported" PEBS and BTS MSRs
On Sat, Jun 11, 2022, Sean Christopherson wrote:
> @@ -4122,6 +4132,16 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> msr_info->data = vcpu->arch.guest_fpu.xfd_err;
> break;
> #endif
> + case MSR_IA32_PEBS_ENABLE:
> + case MSR_IA32_DS_AREA:
> + case MSR_PEBS_DATA_CFG:
> + if (kvm_pmu_is_valid_msr(vcpu, msr_info->index))
> + return kvm_pmu_get_msr(vcpu, msr_info);
> + /*
> + * Userspace is allowed to read MSRs that KVM reports as
> + * to-be-saved, even if an MSR isn't fully supported.
> + */
> + return !msr_info->host_initiated;

Gah, this needs to set msr_info->data.

/*
* Userspace is allowed to read MSRs that KVM reports as
* to-be-saved, even if an MSR isn't fully supported.
*/
if (!msr_info->host_initiated)
return 1;

msr_info->data = 0;

> default:
> if (kvm_pmu_is_valid_msr(vcpu, msr_info->index))
> return kvm_pmu_get_msr(vcpu, msr_info);
> --
> 2.36.1.476.g0c4daa206d-goog
>

\
 
 \ /
  Last update: 2022-06-13 20:15    [W:0.075 / U:2.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site