WCharacter / RDTSC-KVM-Handler

my patches for linux kernel to spoof rdtsc and make vm exit undetected
221 stars 30 forks source link

How to use this on kernel 6.1/6.2? #12

Closed EdLovecraft closed 1 year ago

EdLovecraft commented 1 year ago

I cannot find these lines around setup_vmcs_config function in vmx.c

    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 |

I skipped it and added [EXIT_REASON_RDTSC] = handle_rdtsc, and other codes, added rdtscp=off to qemu:arg, but it doesn't seem to work, my cpu base clock is the same as before, pafish can still force vm exit, and there is no messages about fake rdtsc in dmesg.

jaen commented 1 year ago

As far as I can tell it's now in arch/x86/kvm/vmx/vmx.h (not tested yet, just came across this).

verifizieren commented 1 year ago

A little bit late, but I wanted to mention that it still works like the old way in v6.0, so you could boot into that when you need it, thats what I did.

WCharacter commented 1 year ago

Commit 71179a62 Should work for intel cpus. I no longer support this repository, so if someone wants to implement this patch for 6.0+ version for amd cpu - i will merge it.