From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [Bug 53611] New: nVMX: Add nested EPT Date: Fri, 22 Mar 2013 17:45:45 +0100 Message-ID: <514C8AB9.6040602@siemens.com> References: <5118EF31.8000900@siemens.com> <20130211132730.GA24985@fermat.math.technion.ac.il> <511B441F.5030002@siemens.com> <20130226141129.GA15375@fermat.math.technion.ac.il> <512D1051.4050302@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Nadav Har'El" , "kvm@vger.kernel.org" To: "Nakajima, Jun" Return-path: Received: from goliath.siemens.de ([192.35.17.28]:25914 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933489Ab3CVQqB (ORCPT ); Fri, 22 Mar 2013 12:46:01 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 2013-03-22 07:23, Nakajima, Jun wrote: > On Mon, Mar 4, 2013 at 8:45 PM, Nakajima, Jun wrote: >> I have some updates on this. We rebased the patched to the latest KVM >> (L0). It turned out that the version of L1 KVM/Linux matters. At that >> time, actually I used v3.7 kernel for L1, and the L2 didn't work as I >> described above. If I use v3.5 or older for L1, L2 works with the EPT >> patches. So, I guess some changes made to v3.6 might have exposed a >> bug with the nested EPT patches or somewhere. We are looking at the >> changes to root-cause it. >> > > Finally I've had more time to work on this, and I think I've fixed > this. The problem was that the exit qualification for EPT violation > (to L1) was not accurate (enough). And I needed to save the exit > qualification upon EPT violation somewhere. Today, that information is > converted to error_code (see below), and we lose the information. We > need to use at least the lower 3 bits when injecting EPT violation to > the L1 VMM. I tried to use the upper bytes of error_code to pass part > of the exit qualification, but it didn't work well. Any suggestion for > the place to store the value? kvm_vcpu? > > ... > /* It is a write fault? */ > error_code = exit_qualification & (1U << 1); > /* ept page table is present? */ > error_code |= (exit_qualification >> 3) & 0x1; > > return kvm_mmu_page_fault(vcpu, gpa, error_code, NULL, 0); I don't have a full picture (already asked you to post / git-push your intermediate state), but nested related states typically go to nested_vmx, thus vcpu_vmx. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux