From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934125AbcIEN0t (ORCPT ); Mon, 5 Sep 2016 09:26:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932257AbcIEN0p (ORCPT ); Mon, 5 Sep 2016 09:26:45 -0400 Subject: Re: [PATCH] KVM: nVMX: pass valid guest linear-address to the L1 To: Jan Dakinevich , Wanpeng Li References: <1473013367-12173-1-git-send-email-jan.dakinevich@gmail.com> <9db16fce-3813-2882-bec5-abd279a8a3a1@gmail.com> Cc: kvm , Radim Krcmar , "linux-kernel@vger.kernel.org" , ynorov@caviumnetworks.com From: Paolo Bonzini Message-ID: <60fc4f75-7e46-fdb4-e790-f434d9aefbeb@redhat.com> Date: Mon, 5 Sep 2016 15:16:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <9db16fce-3813-2882-bec5-abd279a8a3a1@gmail.com> 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.32]); Mon, 05 Sep 2016 13:16:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/09/2016 15:02, Jan Dakinevich wrote: > > No, nested_ept_inject_page_fault() will set > > vmcs12->guest_linear_address after L0 walks L1's EPT page table and > > finds that the mapping is invalid if nested EPT is enabled. > > Acctually, nested_ept_inject_page_fault() doesn't do that, the routine > sets only vmcs12->guest_physical_address, but > vmcs12->guest_linear_address remains untouched. As result, after EPT > fault from L2, vmcs_readl(GUEST_LINEAR_ADDRESS) in L1 always returns 0. > > > prepare_vmcs12() just copies the vmcs field that could have changed by > > the L2 guest or the exit-information etc instead of all fields since > > other fields are modified by L1 with VMWRITE, which already writes to > > vmcs12 directly. > > Yes, and guest linear-address considered as a part of exit information, > provided by hardware. I agree. The patch seems okay to me, but I'll leave a couple days more to Wanpeng. Paolo