Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbdHGIed (ORCPT ); Mon, 7 Aug 2017 04:34:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751442AbdHGIeb (ORCPT ); Mon, 7 Aug 2017 04:34:31 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9A3926148B Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=david@redhat.com Subject: Re: [PATCH v2 2/3] KVM: x86: generalize guest_cpuid_has_ helpers 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-3-rkrcmar@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <91f75360-7171-c0e1-cdbc-50abec5851a3@redhat.com> Date: Mon, 7 Aug 2017 10:34:29 +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-3-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.39]); Mon, 07 Aug 2017 08:34:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 993 Lines: 34 On 05.08.2017 00:12, Radim Krčmář wrote: > This patch turns guest_cpuid_has_XYZ(cpuid) into guest_cpuid_has(cpuid, > X86_FEATURE_XYZ), which gets rid of many very similar helpers. > > When seeing a X86_FEATURE_*, we can know which cpuid it belongs to, but > this information isn't in common code, so we recreate it for KVM. > > Add some BUILD_BUG_ONs to make sure that it runs nicely. > > Signed-off-by: Radim Krčmář > --- > v2: > - fixed X86_FEATURE_RDTSCP (David) > - renamed best to entry (David) > - added const (David) > - added __always_inline (Paolo) > --- > arch/x86/kvm/cpuid.h | 170 +++++++++++++++++---------------------------------- > arch/x86/kvm/mmu.c | 7 ++- > arch/x86/kvm/mtrr.c | 2 +- > arch/x86/kvm/svm.c | 2 +- > arch/x86/kvm/vmx.c | 26 ++++---- > arch/x86/kvm/x86.c | 38 ++++++------ > 6 files changed, 95 insertions(+), 150 deletions(-) > Reviewed-by: David Hildenbrand -- Thanks, David