From aed880954c7786be52fd7be6dac6556952cf0bf2 Mon Sep 17 00:00:00 2001 From: Gregory Lirent Date: Tue, 2 Jul 2024 11:52:53 +0300 Subject: [PATCH] Update rdtsc spoof --- patches/kernel/9999-rdtsc-spoof-hook-0.patch | 15 +++++++++++++++ ...f-hook.patch => 9999-rdtsc-spoof-hook-1.patch} | 11 ----------- 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 patches/kernel/9999-rdtsc-spoof-hook-0.patch rename patches/kernel/{9999-rdtsc-spoof-hook.patch => 9999-rdtsc-spoof-hook-1.patch} (74%) diff --git a/patches/kernel/9999-rdtsc-spoof-hook-0.patch b/patches/kernel/9999-rdtsc-spoof-hook-0.patch new file mode 100644 index 0000000..a901b7f --- /dev/null +++ b/patches/kernel/9999-rdtsc-spoof-hook-0.patch @@ -0,0 +1,15 @@ +diff -Naur --no-dereference a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c +--- a/arch/x86/kvm/vmx/vmx.c 2024-07-01 21:03:34.000000000 +0300 ++++ b/arch/x86/kvm/vmx/vmx.c 2024-07-01 20:24:05.000000000 +0300 +@@ -6137,6 +6137,10 @@ + [EXIT_REASON_ENCLS] = handle_encls, + [EXIT_REASON_BUS_LOCK] = handle_bus_lock_vmexit, + [EXIT_REASON_NOTIFY] = handle_notify, ++ [EXIT_REASON_RDTSC] = handle_rdtsc, ++ [EXIT_REASON_RDTSCP] = handle_rdtscp, ++ [EXIT_REASON_UMWAIT] = handle_umwait, ++ [EXIT_REASON_TPAUSE] = handle_tpause, + }; + + static const int kvm_vmx_max_exit_handlers = + \ No newline at end of file diff --git a/patches/kernel/9999-rdtsc-spoof-hook.patch b/patches/kernel/9999-rdtsc-spoof-hook-1.patch similarity index 74% rename from patches/kernel/9999-rdtsc-spoof-hook.patch rename to patches/kernel/9999-rdtsc-spoof-hook-1.patch index 18db3e3..ead5885 100644 --- a/patches/kernel/9999-rdtsc-spoof-hook.patch +++ b/patches/kernel/9999-rdtsc-spoof-hook-1.patch @@ -1,17 +1,6 @@ diff -Naur --no-dereference a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c --- a/arch/x86/kvm/vmx/vmx.c 2024-07-01 21:03:34.000000000 +0300 +++ b/arch/x86/kvm/vmx/vmx.c 2024-07-01 20:24:05.000000000 +0300 -@@ -6137,6 +6137,10 @@ - [EXIT_REASON_ENCLS] = handle_encls, - [EXIT_REASON_BUS_LOCK] = handle_bus_lock_vmexit, - [EXIT_REASON_NOTIFY] = handle_notify, -+ [EXIT_REASON_RDTSC] = handle_rdtsc, -+ [EXIT_REASON_RDTSCP] = handle_rdtscp, -+ [EXIT_REASON_UMWAIT] = handle_umwait, -+ [EXIT_REASON_TPAUSE] = handle_tpause, - }; - - static const int kvm_vmx_max_exit_handlers = @@ -6079,6 +6079,36 @@ return 1; }