Commit 39d61b4
committed
KVM: x86: Remove per-vCPU "cache" of its reference pvclock
Remove the per-vCPU "cache" of the reference pvclock and instead cache
only the TSC shift+multiplier. All other fields in pvclock are fully
recomputed by kvm_guest_time_update(), i.e. aren't actually persisted.
In addition to shaving a few bytes, explicitly tracking the TSC shift/mul
fields makes it easier to see that those fields are tied to hw_tsc_khz
(they exist to avoid having to do expensive math in the common case).
And conversely, not tracking the other fields makes it easier to see that
things like the version number are pulled from the guest's copy, not from
KVM's reference.
Reviewed-by: Paul Durrant <paul@xen.org>
Link: https://lore.kernel.org/r/20250201013827.680235-10-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 46aed4d commit 39d61b4
3 files changed
+21
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
911 | | - | |
| 911 | + | |
| 912 | + | |
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3170 | 3170 | | |
3171 | 3171 | | |
3172 | 3172 | | |
| 3173 | + | |
3173 | 3174 | | |
3174 | 3175 | | |
3175 | 3176 | | |
| |||
3247 | 3248 | | |
3248 | 3249 | | |
3249 | 3250 | | |
3250 | | - | |
3251 | | - | |
| 3251 | + | |
| 3252 | + | |
3252 | 3253 | | |
3253 | 3254 | | |
3254 | 3255 | | |
3255 | 3256 | | |
3256 | | - | |
3257 | | - | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
3258 | 3261 | | |
3259 | 3262 | | |
3260 | 3263 | | |
3261 | | - | |
| 3264 | + | |
3262 | 3265 | | |
3263 | | - | |
| 3266 | + | |
3264 | 3267 | | |
3265 | 3268 | | |
3266 | 3269 | | |
| |||
3269 | 3272 | | |
3270 | 3273 | | |
3271 | 3274 | | |
3272 | | - | |
| 3275 | + | |
3273 | 3276 | | |
3274 | 3277 | | |
3275 | | - | |
| 3278 | + | |
3276 | 3279 | | |
3277 | | - | |
| 3280 | + | |
3278 | 3281 | | |
3279 | 3282 | | |
3280 | 3283 | | |
3281 | 3284 | | |
3282 | | - | |
| 3285 | + | |
3283 | 3286 | | |
3284 | 3287 | | |
3285 | 3288 | | |
3286 | | - | |
| 3289 | + | |
3287 | 3290 | | |
3288 | 3291 | | |
3289 | | - | |
| 3292 | + | |
3290 | 3293 | | |
3291 | 3294 | | |
3292 | 3295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
| 179 | + | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
2316 | 2316 | | |
2317 | 2317 | | |
2318 | 2318 | | |
2319 | | - | |
2320 | | - | |
| 2319 | + | |
| 2320 | + | |
2321 | 2321 | | |
2322 | 2322 | | |
2323 | 2323 | | |
| |||
0 commit comments