From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694AbcF1ReE (ORCPT ); Tue, 28 Jun 2016 13:34:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37604 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbcF1ReB (ORCPT ); Tue, 28 Jun 2016 13:34:01 -0400 From: Bandan Das To: Paolo Bonzini Cc: kvm@vger.kernel.org, guangrong.xiao@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] mmu: mark spte present if the x bit is set References: <1467088360-10186-1-git-send-email-bsd@redhat.com> <1467088360-10186-2-git-send-email-bsd@redhat.com> <55601232-c941-74e8-f740-fd09e9e8a6ae@redhat.com> Date: Tue, 28 Jun 2016 13:33:45 -0400 In-Reply-To: <55601232-c941-74e8-f740-fd09e9e8a6ae@redhat.com> (Paolo Bonzini's message of "Tue, 28 Jun 2016 10:44:53 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 28 Jun 2016 17:33:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paolo Bonzini writes: > On 28/06/2016 06:32, Bandan Das wrote: >> This is safe because is_shadow_present_pte() is called >> on host controlled page table and we know the spte is >> valid >> >> Signed-off-by: Bandan Das >> --- >> arch/x86/kvm/mmu.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c >> index def97b3..a50af79 100644 >> --- a/arch/x86/kvm/mmu.c >> +++ b/arch/x86/kvm/mmu.c >> @@ -304,7 +304,8 @@ static int is_nx(struct kvm_vcpu *vcpu) >> >> static int is_shadow_present_pte(u64 pte) >> { >> - return pte & PT_PRESENT_MASK && !is_mmio_spte(pte); >> + return pte & (PT_PRESENT_MASK | shadow_x_mask) && >> + !is_mmio_spte(pte); > > This should really be pte & 7 when using EPT. But this is okay as an > alternative to a new shadow_present_mask. I could revive shadow_xonly_valid probably... Anyway, for now I will add a TODO comment here. > Paolo > >> } >> >> static int is_large_pte(u64 pte) >> > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html