Commit 67bd641
Marc Zyngier
Merge branch kvm-arm64/nv-pmu-fixes into kvmarm-master/next
* kvm-arm64/nv-pmu-fixes:
: .
: Fixes for NV PMU emulation. From the cover letter:
:
: "Joey reports that some of his PMU tests do not behave quite as
: expected:
:
: - MDCR_EL2.HPMN is set to 0 out of reset
:
: - PMCR_EL0.P should reset all the counters when written from EL2
:
: Oliver points out that setting PMCR_EL0.N from userspace by writing to
: the register is silly with NV, and that we need a new PMU attribute
: instead.
:
: On top of that, I figured out that we had a number of little gotchas:
:
: - It is possible for a guest to write an HPMN value that is out of
: bound, and it seems valuable to limit it
:
: - PMCR_EL0.N should be the maximum number of counters when read from
: EL2, and MDCR_EL2.HPMN when read from EL0/EL1
:
: - Prevent userspace from updating PMCR_EL0.N when EL2 is available"
: .
KVM: arm64: Let kvm_vcpu_read_pmcr() return an EL-dependent value for PMCR_EL0.N
KVM: arm64: Handle out-of-bound write to MDCR_EL2.HPMN
KVM: arm64: Don't let userspace write to PMCR_EL0.N when the vcpu has EL2
KVM: arm64: Allow userspace to limit the number of PMU counters for EL2 VMs
KVM: arm64: Contextualise the handling of PMCR_EL0.P writes
KVM: arm64: Fix MDCR_EL2.HPMN reset value
KVM: arm64: Repaint pmcr_n into nr_pmu_counters
Signed-off-by: Marc Zyngier <maz@kernel.org>File tree
5 files changed
+116
-23
lines changed- Documentation/virt/kvm/devices
- arch/arm64
- include
- asm
- uapi/asm
- kvm
5 files changed
+116
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
140 | 164 | | |
141 | 165 | | |
142 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
| 362 | + | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | 611 | | |
616 | | - | |
617 | 612 | | |
618 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
619 | 617 | | |
620 | 618 | | |
621 | 619 | | |
| |||
1027 | 1025 | | |
1028 | 1026 | | |
1029 | 1027 | | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1030 | 1046 | | |
1031 | 1047 | | |
1032 | 1048 | | |
1033 | 1049 | | |
1034 | 1050 | | |
1035 | | - | |
| 1051 | + | |
1036 | 1052 | | |
1037 | 1053 | | |
1038 | 1054 | | |
| |||
1088 | 1104 | | |
1089 | 1105 | | |
1090 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
1091 | 1121 | | |
1092 | 1122 | | |
1093 | 1123 | | |
| |||
1184 | 1214 | | |
1185 | 1215 | | |
1186 | 1216 | | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1187 | 1226 | | |
1188 | 1227 | | |
1189 | 1228 | | |
| |||
1222 | 1261 | | |
1223 | 1262 | | |
1224 | 1263 | | |
| 1264 | + | |
1225 | 1265 | | |
1226 | 1266 | | |
1227 | 1267 | | |
| |||
1260 | 1300 | | |
1261 | 1301 | | |
1262 | 1302 | | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
1263 | 1307 | | |
1264 | | - | |
| 1308 | + | |
1265 | 1309 | | |
1266 | 1310 | | |
1267 | 1311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
788 | | - | |
| 788 | + | |
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
| 1219 | + | |
1219 | 1220 | | |
1220 | | - | |
| 1221 | + | |
1221 | 1222 | | |
1222 | 1223 | | |
1223 | 1224 | | |
| |||
2570 | 2571 | | |
2571 | 2572 | | |
2572 | 2573 | | |
2573 | | - | |
| 2574 | + | |
2574 | 2575 | | |
2575 | | - | |
2576 | | - | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
2577 | 2583 | | |
2578 | 2584 | | |
2579 | | - | |
2580 | | - | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
2581 | 2588 | | |
2582 | | - | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
2583 | 2601 | | |
2584 | 2602 | | |
2585 | 2603 | | |
| |||
2698 | 2716 | | |
2699 | 2717 | | |
2700 | 2718 | | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
2701 | 2725 | | |
2702 | 2726 | | |
2703 | 2727 | | |
| |||
3243 | 3267 | | |
3244 | 3268 | | |
3245 | 3269 | | |
3246 | | - | |
| 3270 | + | |
3247 | 3271 | | |
3248 | 3272 | | |
3249 | 3273 | | |
| |||
0 commit comments