From: David Hildenbrand Subject: Re: [PATCH v2 2/3] KVM: x86: generalize guest_cpuid_has_ helpers Date: Mon, 7 Aug 2017 10:34:29 +0200 Message-ID: <91f75360-7171-c0e1-cdbc-50abec5851a3@redhat.com> References: <20170804221250.27674-1-rkrcmar@redhat.com> <20170804221250.27674-3-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Paolo Bonzini To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <20170804221250.27674-3-rkrcmar@redhat.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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