Open giuseppejaripappalardo opened 11 months ago
This patch makes Windows 10 crash no matter what on 'IPI_WATCHDOG_TIMEOUT' on a i7 12700K.
The unmodified patch works as intended with no BSOD.
I've done the following to make these patches work on kernel 6.9; in vmx.c:
/*
* Not used by KVM, but fully supported for nesting, i.e. are allowed in
* vmcs12 and propagated to vmcs02 when set in vmcs12.
*/
exec_control &= ~(CPU_BASED_USE_IO_BITMAPS |
CPU_BASED_MONITOR_TRAP_FLAG |
CPU_BASED_PAUSE_EXITING);
// Ensure handle_rdtsc() is used.
exec_control |= CPU_BASED_RDTSC_EXITING;
In vmx.h:
#define __KVM_REQUIRED_VMX_CPU_BASED_VM_EXEC_CONTROL \
(CPU_BASED_HLT_EXITING | \
CPU_BASED_CR3_LOAD_EXITING | \
CPU_BASED_CR3_STORE_EXITING | \
CPU_BASED_UNCOND_IO_EXITING | \
CPU_BASED_MOV_DR_EXITING | \
CPU_BASED_USE_TSC_OFFSETTING | \
CPU_BASED_MWAIT_EXITING | \
CPU_BASED_MONITOR_EXITING | \
CPU_BASED_INVLPG_EXITING | \
CPU_BASED_RDPMC_EXITING | \
CPU_BASED_RDTSC_EXITING | \
CPU_BASED_INTR_WINDOW_EXITING)
Hello, thanks for your nice work.
I would like to propose some fine tuning, up to you if bring or not:
static int handle_rdtsc(struct kvm_vcpu *vcpu) { // Static variables to keep track of the fake and previous TSC values static u64 rdtsc_fake = 0; static u64 rdtsc_prev = 0; // Static variable for the divisor, makes it easy to adjust the TSC rate static const u64 divisore = 16;
}
Regards, Jari