From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/7] svm: Run tests with NPT enabled if available Date: Sun, 12 Sep 2010 11:10:50 +0200 Message-ID: <4C8C991A.6020106@redhat.com> References: <1284132850-19302-1-git-send-email-joerg.roedel@amd.com> <1284132850-19302-3-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Joerg Roedel Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55900 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783Ab0ILJKz (ORCPT ); Sun, 12 Sep 2010 05:10:55 -0400 In-Reply-To: <1284132850-19302-3-git-send-email-joerg.roedel@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: 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