From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752611AbcF2DLb (ORCPT ); Tue, 28 Jun 2016 23:11:31 -0400 Received: from mga11.intel.com ([192.55.52.93]:23372 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752449AbcF2DLa (ORCPT ); Tue, 28 Jun 2016 23:11:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,544,1459839600"; d="scan'208";a="837071310" Subject: Re: [PATCH 2/5] mmu: pass execonly value when initializing rsvd bits To: Bandan Das , kvm@vger.kernel.org References: <1467088360-10186-1-git-send-email-bsd@redhat.com> <1467088360-10186-3-git-send-email-bsd@redhat.com> Cc: pbonzini@redhat.com, linux-kernel@vger.kernel.org From: Xiao Guangrong Message-ID: <57733B8C.6050504@linux.intel.com> Date: Wed, 29 Jun 2016 11:07:56 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1467088360-10186-3-git-send-email-bsd@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/28/2016 12:32 PM, Bandan Das wrote: > In reset_tdp_shadow_zero_bits_mask, we always pass false > when initializing the reserved bits. By initializing with the > correct value of ept exec only, the host can correctly > identify if the guest pte is valid. Note that > kvm_init_shadow_ept_mmu() already knows about execonly. > > Signed-off-by: Bandan Das > --- > arch/x86/kvm/mmu.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index a50af79..875d4f7 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -3831,23 +3831,27 @@ static inline bool boot_cpu_is_amd(void) > > /* > * the direct page table on host, use as much mmu features as > - * possible, however, kvm currently does not do execution-protection. > + * possible > */ > static void > reset_tdp_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, > struct kvm_mmu *context) > { It is not necessary. reset_tdp_shadow_zero_bits_mask() is used for the guest without nested-ept, host never sets shadow execute-only actively. For the nested ept guest, kvm_init_shadow_ept_mmu() has already handled xonly case perfectly.