Commit d75cac3
committed
KVM: x86: Reject userspace attempts to access PERF_CAPABILITIES w/o PDCM
Reject userspace accesses to PERF_CAPABILITIES if PDCM isn't set in guest
CPUID, i.e. if the vCPU doesn't actually have PERF_CAPABILITIES. But! Do
so via KVM_MSR_RET_UNSUPPORTED, so that reads get '0' and writes of '0'
are ignored if KVM advertised support PERF_CAPABILITIES.
KVM's ABI is that userspace must set guest CPUID prior to setting MSRs,
and that setting MSRs that aren't supposed exist is disallowed (modulo the
'0' exemption).
Link: https://lore.kernel.org/r/20240802185511.305849-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent dcb988c commit d75cac3
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3800 | 3800 | | |
3801 | 3801 | | |
3802 | 3802 | | |
3803 | | - | |
3804 | | - | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
3805 | 3807 | | |
3806 | 3808 | | |
3807 | 3809 | | |
| |||
4260 | 4262 | | |
4261 | 4263 | | |
4262 | 4264 | | |
4263 | | - | |
4264 | | - | |
4265 | | - | |
| 4265 | + | |
| 4266 | + | |
4266 | 4267 | | |
4267 | 4268 | | |
4268 | 4269 | | |
| |||
0 commit comments