From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753083AbeBENny (ORCPT ); Mon, 5 Feb 2018 08:43:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33750 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752607AbeBENno (ORCPT ); Mon, 5 Feb 2018 08:43:44 -0500 Date: Mon, 5 Feb 2018 14:43:24 +0100 From: Radim Krcmar To: Janakarajan Natarajan Cc: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Paolo Bonzini , Len Brown , Kyle Huey , Tom Lendacky , Borislav Petkov , Grzegorz Andrejczuk , Kan Liang Subject: Re: [PATCH v4 3/3] x86/kvm: Expose AMD Core Perf Extension flag to guests Message-ID: <20180205134321.GD27896@flask> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-01-30 11:32-0600, Janakarajan Natarajan: > Expose the AMD Core Perf Extension flag to the guests. > > Signed-off-by: Janakarajan Natarajan > --- > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > @@ -365,7 +371,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, > F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ | > F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) | > F(3DNOWPREFETCH) | F(OSVW) | 0 /* IBS */ | F(XOP) | > - 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM); > + 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM) | f_perfext; You can just say F(PERFCTR_CORE) here. The conditional features are needed when there is a runtime config option for them. We are automatically masking features that the host doesn't support, thanks. > > /* cpuid 0xC0000001.edx */ > const u32 kvm_cpuid_C000_0001_edx_x86_features = > -- > 2.7.4 >