asamy / ksm

A fast, hackable and simple x64 VT-x hypervisor for Windows and Linux. Builtin userspace sandbox and introspection engine.
https://asamy.github.io/ksm/
GNU General Public License v2.0
834 stars 180 forks source link

MSR_IA32_FEATURE_CONTROL lock bit is set in kernel version 5.x #34

Open purplewall1206 opened 2 years ago

purplewall1206 commented 2 years ago

MSR_IA32_FEATURE_CONTROL.lock[0bit] = 1 is set in kernel version 5.x by default.

which means no modification to MSRs is allowed until the system reboot.

the code in ksm.c is invalid anymore.

// ksm.c    int __ksm_init_cpu(struct ksm *k)

feat_ctl = __readmsr(MSR_IA32_FEATURE_CONTROL);
    if ((feat_ctl & required_feat_bits) != required_feat_bits) {