Received: by 10.223.176.5 with SMTP id f5csp2530930wra; Mon, 5 Feb 2018 05:44:54 -0800 (PST) X-Google-Smtp-Source: AH8x226yuMzIq1PJmcJGS7MAfrh+RxAZFDeu4kNFY2vF6qJ5H6wuhulBQVhVG3u7spgMI+eb0scj X-Received: by 10.98.178.8 with SMTP id x8mr4517821pfe.57.1517838294030; Mon, 05 Feb 2018 05:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517838294; cv=none; d=google.com; s=arc-20160816; b=MWhReGLgeKDBFB4ZvoOJ6WBtbZJndPpaCKMN59JoV7gOE/bIoZiG+yZk8U/ZcjOd0x k108dfWKgkl58Gb6th9SQwlGxRiN7JztBzsFt9UvcM5rxW93CTVPP4AQcACrVPFlnjLH 0WoJl7XA1WAXVX6b9ubVaPRRB1RBKE5YKMLXY1hA2sYkuVysiiPjYYAUdvfO94/mCeFT RY7kuXfnF9nVFcOveornM63zzBlwgH6WS1Mr03F3FUCWAZhIl8T3d8oVolwuNSwAo1JW 4yqvxgrblxZ6RbxE2cxmWIpIs2gtQ0tB6+5M2V3+21/adyNvBniyv7ZBie0MbzflpdAq kkFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=yMN5Wur4hk+k5rFPSZpz96NfN97dHQuGxXum3EZJzZY=; b=WAYFnA8UnooGA9AfH5CrIKG+McpT1JPI26awZ97kzVbO/JDZ3zbJjlv8lEYKm0BaPj yCMYiHTcIBOU4oy0/5teQDUHYGMd5fjLIItBP0tymds5Z99HwBS+jYZg+EmbQ9uXq2pL ODk9A2hj3rxyhPEZGSaEOBkMBALmEEov5YQqKrJBGKYtBCKlh5w+q4+UjM3lzdp4UeHR GanoS3vtorfEtfpgRSzHAAFxU7Uiut+ZUddyZNcC0a/4U/lS9Ci6ryLefkbow/ldRI/o UeXurNmM6JMVyJw3BM6fbaZM4gOacp2FVN4MXILr/DDwR1zRTUecAaP001si9uaIitzC 0fLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si415246plp.738.2018.02.05.05.44.39; Mon, 05 Feb 2018 05:44:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753067AbeBENnw (ORCPT + 99 others); Mon, 5 Feb 2018 08:43:52 -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 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 26154C0587C1; Mon, 5 Feb 2018 13:43:44 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id F13B45D9CB; Mon, 5 Feb 2018 13:43:39 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Mon, 05 Feb 2018 14:43:24 +0100 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: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 05 Feb 2018 13:43:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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 >