On 09/10/2010 06:34 PM, Joerg Roedel wrote:
This patch adds code to setup a nested page table which is
used for all tests.
+
+ printf("NPT detected - running all tests with NPT enabled\n");
+
+ /*
+ * Nested paging supported - Build a nested page table
+ * Build the page-table bottom-up and map everything with 2M pages
+ */
+
+ address = 0;
+
+ /* PTE level */
Conflicts with previous comment - these aren't 2M pages.
+ for (i = 0; i< 2048; ++i) {
+ page = alloc_page();
+
+ for (j = 0; j< 512; ++j, address += 4096)
+ page[j] = address | 0x067ULL;
{ }
static void vmcb_set_seg(struct vmcb_seg *seg, u16 selector,
@@ -56,6 +110,11 @@ static void vmcb_ident(struct vmcb *vmcb)
save->g_pat = rdmsr(MSR_IA32_CR_PAT);
save->dbgctl = rdmsr(MSR_IA32_DEBUGCTLMSR);
ctrl->intercept = (1ULL<< INTERCEPT_VMRUN) | (1ULL<< INTERCEPT_VMMCALL);
+
+ if (npt_supported()) {
+ ctrl->nested_ctl = 1;
+ ctrl->nested_cr3 = (u64)pml4e;
+ }
}
struct test {
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html