lkml.org 
[lkml]   [2019]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC KVM 20/27] kvm/isolation: initialize the KVM page table with vmx specific data
Date
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@oracle.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
\
 
 \ /
  Last update: 2019-05-13 16:41    [W:1.288 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site