From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 1/3] KVM: VMX: remove setting of shadow_base_ptes for EPT Date: Wed, 20 Oct 2010 12:24:03 +0200 Message-ID: <4CBEC343.8020200@redhat.com> References: <20101019162613.278902252@redhat.com> <20101019162726.443514881@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, aarcange@redhat.com To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41549 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751251Ab0JTKYH (ORCPT ); Wed, 20 Oct 2010 06:24:07 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9KAO7AL027585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Oct 2010 06:24:07 -0400 In-Reply-To: <20101019162726.443514881@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/19/2010 06:26 PM, Marcelo Tosatti wrote: > The EPT present/writable bits use the same position as normal > pagetable bits. > > Since direct_map passes ACC_ALL to mmu_set_spte, thus always setting > the writable bit on sptes, use the generic PT_PRESENT shadow_base_pte. > > Also pass present/writable error code information from EPT violation > to generic pagefault handler. > > Signed-off-by: Marcelo Tosatti > > Index: kvm/arch/x86/kvm/vmx.c > =================================================================== > --- kvm.orig/arch/x86/kvm/vmx.c > +++ kvm/arch/x86/kvm/vmx.c > @@ -3483,7 +3483,7 @@ static int handle_ept_violation(struct k > > gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); > trace_kvm_page_fault(gpa, exit_qualification); > - return kvm_mmu_page_fault(vcpu, gpa& PAGE_MASK, 0); > + return kvm_mmu_page_fault(vcpu, gpa, exit_qualification& 0x3); > } Why in the same patch? Seems unrelated. Ah, it's actually not unrelated, it won't work without it. > > static u64 ept_rsvd_mask(u64 spte, int level) > @@ -4408,8 +4408,6 @@ static int __init vmx_init(void) > > if (enable_ept) { > bypass_guest_pf = 0; > - kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | > - VMX_EPT_WRITABLE_MASK); > kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, > VMX_EPT_EXECUTABLE_MASK); > kvm_enable_tdp(); > Only caller gone, please remove callee. -- error compiling committee.c: too many arguments to function