Commit 6d88d0e
committed
KVM: x86/pmu: Require nr fixed_pmc_events to match nr max fixed counters
Assert that the number of known fixed_pmc_events matches the max number of
fixed counters supported by KVM, and clean up related code.
Opportunistically extend setup_fixed_pmc_eventsel()'s use of
array_index_nospec() to cover fixed_counters, as nr_arch_fixed_counters is
set based on userspace input (but capped using KVM-controlled values).
Link: https://lore.kernel.org/r/20230607010206.1425277-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent bc96589 commit 6d88d0e
1 file changed
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | 471 | | |
475 | 472 | | |
| 473 | + | |
| 474 | + | |
476 | 475 | | |
477 | | - | |
478 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
479 | 480 | | |
480 | | - | |
| 481 | + | |
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
| |||
538 | 539 | | |
539 | 540 | | |
540 | 541 | | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
| 542 | + | |
| 543 | + | |
545 | 544 | | |
546 | 545 | | |
547 | 546 | | |
| |||
0 commit comments