Commit f7a65e5
committed
KVM: x86/pmu: Disallow emulation in the fastpath if mediated PMCs are active
Don't handle exits in the fastpath if emulation is required, i.e. if an
instruction needs to be skipped, the mediated PMU is enabled, and one or
more PMCs is counting instructions. With the mediated PMU, KVM's cache of
PMU state is inconsistent with respect to hardware until KVM exits the
inner run loop (when the mediated PMU is "put").
Reviewed-by: Sandipan Das <sandipan.das@amd.com>
Tested-by: Xudong Hao <xudong.hao@intel.com>
Tested-by: Manali Shukla <manali.shukla@amd.com>
Link: https://patch.msgid.link/20251206001720.468579-29-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 56bb273 commit f7a65e5
2 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
237 | 247 | | |
238 | 248 | | |
239 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2215 | 2215 | | |
2216 | 2216 | | |
2217 | 2217 | | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
2218 | 2221 | | |
2219 | 2222 | | |
2220 | 2223 | | |
| |||
2271 | 2274 | | |
2272 | 2275 | | |
2273 | 2276 | | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
2274 | 2280 | | |
2275 | 2281 | | |
2276 | 2282 | | |
| |||
11714 | 11720 | | |
11715 | 11721 | | |
11716 | 11722 | | |
| 11723 | + | |
| 11724 | + | |
| 11725 | + | |
11717 | 11726 | | |
11718 | 11727 | | |
11719 | 11728 | | |
| |||
0 commit comments