Commit 6057497
committed
KVM: x86: Rework KVM_REQ_MSR_FILTER_CHANGED into a generic RECALC_INTERCEPTS
Rework the MSR_FILTER_CHANGED request into a more generic RECALC_INTERCEPTS
request, and expand the responsibilities of vendor code to recalculate all
intercepts that vary based on userspace input, e.g. instruction intercepts
that are tied to guest CPUID.
Providing a generic recalc request will allow the upcoming mediated PMU
support to trigger a recalc when PMU features, e.g. PERF_CAPABILITIES, are
set by userspace, without having to make multiple calls to/from PMU code.
As a bonus, using a request will effectively coalesce recalcs, e.g. will
reduce the number of recalcs for normal usage from 3+ to 1 (vCPU create,
set CPUID, set PERF_CAPABILITIES (Intel only), set filter).
The downside is that MSR filter changes that are done in isolation will do
a small amount of unnecessary work, but that's already a relatively slow
path, and the cost of recalculating instruction intercepts is negligible.
Tested-by: Xudong Hao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>1 parent cdfed93 commit 6057497
File tree
7 files changed
+29
-25
lines changed- arch/x86
- include/asm
- kvm
- svm
- vmx
7 files changed
+29
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
1914 | 1914 | | |
1915 | 1915 | | |
1916 | 1916 | | |
1917 | | - | |
| 1917 | + | |
1918 | 1918 | | |
1919 | 1919 | | |
1920 | 1920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
1080 | | - | |
| 1080 | + | |
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | | - | |
| 1228 | + | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | 1231 | | |
| |||
4479 | 4479 | | |
4480 | 4480 | | |
4481 | 4481 | | |
4482 | | - | |
| 4482 | + | |
4483 | 4483 | | |
4484 | 4484 | | |
4485 | 4485 | | |
| |||
5181 | 5181 | | |
5182 | 5182 | | |
5183 | 5183 | | |
5184 | | - | |
| 5184 | + | |
5185 | 5185 | | |
5186 | 5186 | | |
5187 | 5187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
998 | | - | |
| 998 | + | |
999 | 999 | | |
1000 | 1000 | | |
1001 | 1001 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4068 | 4068 | | |
4069 | 4069 | | |
4070 | 4070 | | |
4071 | | - | |
| 4071 | + | |
4072 | 4072 | | |
4073 | 4073 | | |
4074 | 4074 | | |
| |||
4121 | 4121 | | |
4122 | 4122 | | |
4123 | 4123 | | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
4124 | 4129 | | |
4125 | 4130 | | |
4126 | 4131 | | |
| |||
7802 | 7807 | | |
7803 | 7808 | | |
7804 | 7809 | | |
7805 | | - | |
| 7810 | + | |
7806 | 7811 | | |
7807 | 7812 | | |
7808 | 7813 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6794 | 6794 | | |
6795 | 6795 | | |
6796 | 6796 | | |
6797 | | - | |
| 6797 | + | |
| 6798 | + | |
| 6799 | + | |
| 6800 | + | |
| 6801 | + | |
6798 | 6802 | | |
6799 | 6803 | | |
6800 | 6804 | | |
| |||
10827 | 10831 | | |
10828 | 10832 | | |
10829 | 10833 | | |
10830 | | - | |
10831 | | - | |
10832 | | - | |
10833 | | - | |
10834 | | - | |
10835 | | - | |
10836 | | - | |
| 10834 | + | |
| 10835 | + | |
10837 | 10836 | | |
10838 | 10837 | | |
10839 | 10838 | | |
| |||
0 commit comments