From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: Re: [PATCH v1 1/2] KVM: VMX: cleanup EPTP definitions Date: Thu, 10 Aug 2017 22:58:35 +0200 Message-ID: References: <20170810133512.13442-1-david@redhat.com> <20170810133512.13442-2-david@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Bandan Das To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800AbdHJU6j (ORCPT ); Thu, 10 Aug 2017 16:58:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 807015F7B0 for ; Thu, 10 Aug 2017 20:58:39 +0000 (UTC) In-Reply-To: <20170810133512.13442-2-david@redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 10.08.2017 15:35, David Hildenbrand wrote: > Don't use shifts, tag them correctly as EPTP and use better matching > names (PWL vs. GAW). > > Signed-off-by: David Hildenbrand > --- > arch/x86/include/asm/vmx.h | 11 ++++++----- > arch/x86/kvm/vmx.c | 25 +++++++++++-------------- > 2 files changed, 17 insertions(+), 19 deletions(-) > > diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h > index 5f63a2e..929b3fc 100644 > --- a/arch/x86/include/asm/vmx.h > +++ b/arch/x86/include/asm/vmx.h > @@ -468,12 +468,13 @@ enum vmcs_field { > #define VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT (1ull << 10) /* (42 - 32) */ > #define VMX_VPID_EXTENT_SINGLE_NON_GLOBAL_BIT (1ull << 11) /* (43 - 32) */ > > -#define VMX_EPT_DEFAULT_GAW 3 > -#define VMX_EPT_MAX_GAW 0x4 > #define VMX_EPT_MT_EPTE_SHIFT 3 > -#define VMX_EPT_GAW_EPTP_SHIFT 3 > -#define VMX_EPT_AD_ENABLE_BIT (1ull << 6) > -#define VMX_EPT_DEFAULT_MT 0x6ull > +#define VMX_EPTP_PWL_MASK 0x38ull > +#define VMX_EPTP_PWL_4 0x38ull stupid typo, this should be 0x18ull (otherwise you'll get a kernel panic ...) -- Thanks, David