From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v3 13/13] nEPT: Inject EPT violation/misconfigration Date: Mon, 20 May 2013 15:09:51 +0200 Message-ID: <519A209F.2070909@redhat.com> References: <1368939152-11406-1-git-send-email-jun.nakajima@intel.com> <1368939152-11406-13-git-send-email-jun.nakajima@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Gleb Natapov To: Jun Nakajima Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29469 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754154Ab3ETNJ5 (ORCPT ); Mon, 20 May 2013 09:09:57 -0400 In-Reply-To: <1368939152-11406-13-git-send-email-jun.nakajima@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 19/05/2013 06:52, Jun Nakajima ha scritto: > @@ -7441,10 +7443,81 @@ static void nested_ept_inject_page_fault(struct kvm_vcpu *vcpu, > * Note no need to set vmcs12->vm_exit_reason as it is already copied > * from vmcs02 in nested_vmx_vmexit() above, i.e., EPT_VIOLATION. > */ This comment is now wrong. > - vmcs12->exit_qualification = fault->error_code; And this shows that patch 5 ("nEPT: MMU context for nested EPT") was wrong in this respect. Perhaps this patch should be moved earlier in the series, so that the exit qualification is "bisectably" ok. 1) the updating of exit_qualification in walk_addr_generic should be split out and moved before patch 5; 2) the changes to handle_ept_violation and nested_ept_inject_page_fault (plus fixing the above comment) should also be split out, this time to squash them in patch 5. These two changes ensure that patch 5 can already use the right exit qualification. 3) if needed to make the series bisectable, squash patch 12 into patch 2 and make is_rsvd_bits_set always return 0 in patch 3; then the rest of the handling of reserved bits (including the introduction of check_tdp_pte) will remain here. Otherwise, just squash what's left of this patch into patch 12 and again change the subject. In either case the subject will have to change. Paolo > + if (fault->error_code & PFERR_RSVD_MASK) > + vmcs12->vm_exit_reason = EXIT_REASON_EPT_MISCONFIG; > + else > + vmcs12->vm_exit_reason = EXIT_REASON_EPT_VIOLATION; > + > + vmcs12->exit_qualification = vcpu->arch.exit_qualification; > vmcs12->guest_physical_address = fault->address; > } >