RFC: Precise TSC migration
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 2/22 patches 0 repliesNew
- v2 posting 1/23 patches 73 repliesSuperseded
- v12 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- switched to -accel for enablement
- sync with updated kernel patches
- minor cleanups, renames, etc
Patches in v2 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | Update the kernel headers for 5.10-rc5 + TSCinclude/ linux-headers/ linux-headers/ | +73 | 0 replies | |
| 2/2 | Implement support for precise TSC migrationaccel/ include/ target/ +2 more | +161 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/2] RFC: Precise TSC migration
Note that to use this feature you need the kernel patches which are posted to LKML and [email protected]
The feature is disabled by default, and can be enabled with -accel kvm,x-precise-tsc=on.
I changed the TSC and TSC adjust read/write code to go though a special function kvm_get_tsc/kvm_set_tsc regardless of enablement of this feature.
The side effect of this is that now we upload to the kernel the TSC_ADJUST msr only on KVM_PUT_RESET_STATE reset level.
This shouldn't matter as I don't think that qemu changes this msr on its own.
For migration I added a new state field 'cpu/tsc_ns_timestamp', where I save the TSC nanosecond timestamp, which is the only new thing that was added to the migration state.
First patch in this series is temporary and it just updates the kernel headers to make qemu compile.
When the feature is merged to the kernel, a kernel header sync will bring the same changes to the qemu, making this patch unnecessary.
V2:
- switched to -accel for enablement
- sync with updated kernel patches
- minor cleanups, renames, etc
Best regards,
Maxim Levitsky
Maxim Levitsky (2):
Update the kernel headers for 5.10-rc5 + TSC
Implement support for precise TSC migration
accel/kvm/kvm-all.c | 28 ++++ include/standard-headers/asm-x86/kvm_para.h | 1 + include/sysemu/kvm.h | 1 + linux-headers/asm-x86/kvm.h | 2 + linux-headers/linux/kvm.h | 71 +++++++++- target/i386/cpu.h | 1 + target/i386/kvm.c | 140 ++++++++++++++++---- target/i386/machine.c | 19 +++ 8 files changed, 234 insertions(+), 29 deletions(-)
Signature · 1 line
2.26.2