From 161a3c11e2ee7cf4a768cf1131f7001869f08184 Mon Sep 17 00:00:00 2001 From: Adam_pi3 Date: Sun, 1 Dec 2019 20:59:25 -0500 Subject: [PATCH] [CI] Introduce an option to compile LKRG without verifying MSRs on each (v)CPU core. It might be useful for the host machines which manages VMs (root-partition). This compilation option is DISABLED by default. --- src/modules/database/arch/x86/MSR.h | 25 ++++++++++++++++++------- src/p_lkrg_main.h | 1 + 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/modules/database/arch/x86/MSR.h b/src/modules/database/arch/x86/MSR.h index c1a43f9..06c3143 100644 --- a/src/modules/database/arch/x86/MSR.h +++ b/src/modules/database/arch/x86/MSR.h @@ -21,13 +21,24 @@ u64 p_read_msr(/*int p_cpu, */u32 p_arg); -#define P_MSR_READ_COUNT(x,y,z) \ -do { \ - char p_tmp = x-1; \ - do { \ - y = p_read_msr(z); \ - } while(!y && p_tmp--); \ -} while(0) +#if defined(P_LKRG_CI_X86_NO_MSR) + + #define P_MSR_READ_COUNT(x,y,z) \ + do { \ + y = -1; \ + } while(0) + +#else + + #define P_MSR_READ_COUNT(x,y,z) \ + do { \ + char p_tmp = x-1; \ + do { \ + y = p_read_msr(z); \ + } while(!y && p_tmp--); \ + } while(0) + +#endif #ifdef CONFIG_X86_64 #define P_MSR_ASM_RET(val, low, high) (((u64)(high) << 32) | (low)) diff --git a/src/p_lkrg_main.h b/src/p_lkrg_main.h index e37be52..45b44d2 100644 --- a/src/p_lkrg_main.h +++ b/src/p_lkrg_main.h @@ -19,6 +19,7 @@ #define P_LKRG_MAIN_H #define P_LKRG_UNHIDE +//#define P_LKRG_CI_X86_NO_MSR //#define P_LKRG_PCFI_NO_STACKWALK #include