Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794AbdDNFSD (ORCPT ); Fri, 14 Apr 2017 01:18:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49376 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbdDNFSA (ORCPT ); Fri, 14 Apr 2017 01:18:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1A3FF804F2 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1A3FF804F2 Subject: Re: [PATCH 4/6] kvm: nVMX: support EPT accessed/dirty bits To: Bandan Das References: <1490867732-16743-1-git-send-email-pbonzini@redhat.com> <1490867732-16743-5-git-send-email-pbonzini@redhat.com> <317734077.12913155.1491954869446.JavaMail.zimbra@redhat.com> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, david@redhat.com From: Paolo Bonzini Message-ID: Date: Fri, 14 Apr 2017 13:17:56 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 14 Apr 2017 05:18:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 962 Lines: 24 On 13/04/2017 07:02, Bandan Das wrote: >> For EPT it is, you're right it's fishy. The "nested_access" should be >> computed in translate_nested_gpa, which is where kvm->arch.nested_mmu >> (non-EPT) requests to access kvm->arch.mmu (EPT). > > Thanks for the clarification. Is it the case when L1 runs L2 without > EPT ? I can't figure out the case where translate_nested_gpa will actually > be called. It happens when L2 instruction are emulated by L0, for example when L1 is passing through I/O ports to L2 and L2 runs an "insb" instruction. I think this case is not covered by vmx.flat. Paolo > FNAME(walk_addr_nested) calls walk_addr_generic > with &vcpu->arch.nested_mmu and init_kvm_nested_mmu() sets gva_to_gpa() > with the appropriate "_nested" functions. But the gva_to_gpa() pointers > don't seem to get invoked at all for the nested case. > > BTW, just noticed that setting PFERR_USER_MASK is redundant since > translate_nested_gpa does it too.