From acaef7872a94322b0d0b95a79779aa4d599504c0 Mon Sep 17 00:00:00 2001 From: rodrigosiqueira Date: Fri, 27 Oct 2017 10:16:25 -0200 Subject: [PATCH 1/3] Switch read_cr3 to __read_cr3 due to Kernel update --- kern/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kern/vmx.c b/kern/vmx.c index 04c639a..4bf8d97 100644 --- a/kern/vmx.c +++ b/kern/vmx.c @@ -510,7 +510,7 @@ static void vmx_setup_constant_host_state(void) vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */ vmcs_writel(HOST_CR4, __read_cr4()); /* 22.2.3, 22.2.5 */ - vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 */ + vmcs_writel(HOST_CR3, __read_cr3()); /* 22.2.3 */ vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ From cfaac2bd9ba1a16fd45a5a46a6e6b66ea3398b00 Mon Sep 17 00:00:00 2001 From: rodrigosiqueira Date: Fri, 27 Oct 2017 10:18:05 -0200 Subject: [PATCH 2/3] Removed VMX_EPT_EXTENT_INDIVIDUAL_ADDR Linux Kernel removed VMX_EPT_EXTENT_INDIVIDUAL_ADDR field. For more information look at the commit 63f3ac48133a19110c8a3666028dbd9b1bf3dcb3 on the Linux Kernel repository --- kern/vmx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kern/vmx.c b/kern/vmx.c index 4bf8d97..9db954e 100644 --- a/kern/vmx.c +++ b/kern/vmx.c @@ -180,10 +180,7 @@ static inline void ept_sync_context(u64 eptp) static inline void ept_sync_individual_addr(u64 eptp, gpa_t gpa) { - if (cpu_has_vmx_invept_individual_addr()) - __invept(VMX_EPT_EXTENT_INDIVIDUAL_ADDR, - eptp, gpa); - else + if (!cpu_has_vmx_invept_individual_addr()) ept_sync_context(eptp); } From 113d15994a4246d2e2194c14d7b7ea5665c1e898 Mon Sep 17 00:00:00 2001 From: rodrigosiqueira Date: Fri, 27 Oct 2017 10:20:04 -0200 Subject: [PATCH 3/3] Remove invalidate_page field invalidate_page was removed from kernel, for more detail look the commit 5f32b265400de723ab0db23101a75ac073bdd980 on Linux Kernel. --- kern/ept.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/kern/ept.c b/kern/ept.c index 83c4e53..57276b6 100644 --- a/kern/ept.c +++ b/kern/ept.c @@ -628,17 +628,6 @@ static inline struct vmx_vcpu *mmu_notifier_to_vmx(struct mmu_notifier *mn) return container_of(mn, struct vmx_vcpu, mmu_notifier); } -static void ept_mmu_notifier_invalidate_page(struct mmu_notifier *mn, - struct mm_struct *mm, - unsigned long address) -{ - struct vmx_vcpu *vcpu = mmu_notifier_to_vmx(mn); - - pr_debug("ept: invalidate_page addr %lx\n", address); - - ept_invalidate_page(vcpu, mm, address); -} - static void ept_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, struct mm_struct *mm, unsigned long start, @@ -750,7 +739,6 @@ static void ept_mmu_notifier_release(struct mmu_notifier *mn, } static const struct mmu_notifier_ops ept_mmu_notifier_ops = { - .invalidate_page = ept_mmu_notifier_invalidate_page, .invalidate_range_start = ept_mmu_notifier_invalidate_range_start, .invalidate_range_end = ept_mmu_notifier_invalidate_range_end, .clear_flush_young = ept_mmu_notifier_clear_flush_young,