Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752548AbdHGI3Y (ORCPT ); Mon, 7 Aug 2017 04:29:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59324 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752232AbdHGI3W (ORCPT ); Mon, 7 Aug 2017 04:29:22 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5F41C6E808 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=david@redhat.com Subject: Re: [PATCH v2 1/3] KVM: x86: X86_FEATURE_NRIPS is not scattered anymore To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini References: <20170804221250.27674-1-rkrcmar@redhat.com> <20170804221250.27674-2-rkrcmar@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <454d13f6-cb34-2f46-b11b-32d6a67be275@redhat.com> Date: Mon, 7 Aug 2017 10:29:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170804221250.27674-2-rkrcmar@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 07 Aug 2017 08:29:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1462 Lines: 52 On 05.08.2017 00:12, Radim Krčmář wrote: > bit(X86_FEATURE_NRIPS) is 3 since 2ccd71f1b278 ("x86/cpufeature: Move > some of the scattered feature bits to x86_capability"), so we can > simplify the code. > > Signed-off-by: Radim Krčmář > --- > v2: new, explain why it's ok to use X86_FEATURE_NRIPS (David) > --- > arch/x86/kvm/cpuid.h | 14 +------------- > 1 file changed, 1 insertion(+), 13 deletions(-) > > diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h > index da6728383052..c723d64657d0 100644 > --- a/arch/x86/kvm/cpuid.h > +++ b/arch/x86/kvm/cpuid.h > @@ -160,25 +160,13 @@ static inline bool guest_cpuid_has_rdtscp(struct kvm_vcpu *vcpu) > return best && (best->edx & bit(X86_FEATURE_RDTSCP)); > } > > -/* > - * NRIPS is provided through cpuidfn 0x8000000a.edx bit 3 > - */ > -#define BIT_NRIPS 3 > - > static inline bool guest_cpuid_has_nrips(struct kvm_vcpu *vcpu) > { > struct kvm_cpuid_entry2 *best; > > best = kvm_find_cpuid_entry(vcpu, 0x8000000a, 0); > - > - /* > - * NRIPS is a scattered cpuid feature, so we can't use > - * X86_FEATURE_NRIPS here (X86_FEATURE_NRIPS would be bit > - * position 8, not 3). > - */ > - return best && (best->edx & bit(BIT_NRIPS)); > + return best && (best->edx & bit(X86_FEATURE_NRIPS)); > } > -#undef BIT_NRIPS > > static inline int guest_cpuid_family(struct kvm_vcpu *vcpu) > { > Reviewed-by: David Hildenbrand -- Thanks, David