[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1557758315-12667-21-git-send-email-alexandre.chartre@oracle.com>
Date: Mon, 13 May 2019 16:38:28 +0200
From: Alexandre Chartre <alexandre.chartre@...cle.com>
To: pbonzini@...hat.com, rkrcmar@...hat.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
kvm@...r.kernel.org, x86@...nel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: konrad.wilk@...cle.com, jan.setjeeilers@...cle.com,
liran.alon@...cle.com, jwadams@...gle.com,
alexandre.chartre@...cle.com
Subject: [RFC KVM 20/27] kvm/isolation: initialize the KVM page table with vmx specific data
In addition of core memory mappings, the KVM page table has to be
initialized with vmx specific data.
Signed-off-by: Alexandre Chartre <alexandre.chartre@...cle.com>
---
arch/x86/kvm/vmx/vmx.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 0c955bb..f181b3c 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -63,6 +63,7 @@
#include "vmcs12.h"
#include "vmx.h"
#include "x86.h"
+#include "isolation.h"
MODULE_AUTHOR("Qumranet");
MODULE_LICENSE("GPL");
@@ -7830,6 +7831,24 @@ static int __init vmx_init(void)
}
}
+ if (kvm_isolation()) {
+ pr_debug("mapping vmx init");
+ /* copy mapping of the current module (kvm_intel) */
+ r = kvm_copy_module_mapping();
+ if (r) {
+ vmx_exit();
+ return r;
+ }
+ if (vmx_l1d_flush_pages) {
+ r = kvm_copy_ptes(vmx_l1d_flush_pages,
+ PAGE_SIZE << L1D_CACHE_ORDER);
+ if (r) {
+ vmx_exit();
+ return r;
+ }
+ }
+ }
+
#ifdef CONFIG_KEXEC_CORE
rcu_assign_pointer(crash_vmclear_loaded_vmcss,
crash_vmclear_local_loaded_vmcss);
--
1.7.1
Powered by blists - more mailing lists