Received: by 10.223.176.5 with SMTP id f5csp2787218wra; Mon, 5 Feb 2018 09:50:01 -0800 (PST) X-Google-Smtp-Source: AH8x225N8l0ez6XZCGPSDff+Mu3N08Y0qSv48VDBJ2HaaY3lT+vVPqUwRl4g4e+5h4MlCBQCzFhO X-Received: by 10.99.37.7 with SMTP id l7mr28176340pgl.311.1517853001504; Mon, 05 Feb 2018 09:50:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517853001; cv=none; d=google.com; s=arc-20160816; b=DCLgGglYUst+wH+549Vp+nWfz24CKsB6+Ji9y6vTdRiES1CULTEr8H53GzYixs5Oeg CHOJP20LOOBm0wi6vxBFQBVB/LwflUenDu1bGEzCa5Q0XrNIqU0+Pxj5HCk43q5wc8HU A7oBGFTDvg8VSboU3MFgywtk2FThNhuQRlfHpTCZQ+jgsqb5dWw1KnO6sSxeXKwUpEem q/Lflx6tkT3Ej+5UOxR/Bn67CO1VL24igTjAH33vB1buheCcHbwAT3ySZSGQlWqStKub kyz5BmXe4e4+xF1AkjFjE9q9c2qcdtqBzWn4iSuhQXc1N8cP8xy/EabVcx59c9Zrytkh 6d+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=X9aOeVm5f2fM/39XiK6OWjqgVeVmGkJO5JtLsE8BIO4=; b=ZEz//DMUE0lsICUF9KyGPZO/aK0gL0/ccSYyzd0JH/lQa8WT0yfl1Sq6s/zJngYHYk IQBHM/3Ezc4t7cdHBEwfv78ngVUH7U4mqYEENcuRuheLIcF0Ir9op31j4NVORzp/iDBQ GNXfjnVUqv+peEGa+VOxpSZMJjB9JO7+sjkV/S7lCuRGx1HPY2qv/lTDmeVQSpISc+ub 4VEcZh/j6N0mL9SNlUMaNwfwqxMTGjhDXfrmSRLoZUOe+6/4K6mg1qeub3NrS3WHJkFi 1U4gBynQBJ1XNLctqqRudqkek2ChUJ8GRK0EWcRn9uNoyu9/4UXJOQaeDNHbaFa5HiXa MhGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=D60sImbQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11-v6si4946685pll.546.2018.02.05.09.49.47; Mon, 05 Feb 2018 09:50:01 -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; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=D60sImbQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbeBERsO (ORCPT + 99 others); Mon, 5 Feb 2018 12:48:14 -0500 Received: from mail-dm3nam03on0050.outbound.protection.outlook.com ([104.47.41.50]:27790 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752925AbeBERsG (ORCPT ); Mon, 5 Feb 2018 12:48:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=X9aOeVm5f2fM/39XiK6OWjqgVeVmGkJO5JtLsE8BIO4=; b=D60sImbQxC2NSqIXyuKf6zlbyvZ1LgH9htJvp8kSdgPbsoOYZ97EHNxu/SFkdCX8lmNPIkCQd4evf5xtW6+y7pGbY0XE5V1tS288HcKBoe4fdahMOEMT+IJS5AeJHwBLFqhLW7Q9FqR6EJZVp3VoerCka+IHNLFzn907fAoacyk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Janakarajan.Natarajan@amd.com; Received: from [10.236.18.253] (165.204.77.1) by CY4PR12MB1367.namprd12.prod.outlook.com (2603:10b6:903:41::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Mon, 5 Feb 2018 17:48:04 +0000 Subject: Re: [PATCH v4 3/3] x86/kvm: Expose AMD Core Perf Extension flag to guests To: Radim Krcmar 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 References: <20180205134321.GD27896@flask> From: "Natarajan, Janakarajan" Message-ID: <1ab1c7a9-a55b-2903-50c7-444886ac1bfe@amd.com> Date: Mon, 5 Feb 2018 11:48:00 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180205134321.GD27896@flask> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR16CA0024.namprd16.prod.outlook.com (2603:10b6:3:c0::34) To CY4PR12MB1367.namprd12.prod.outlook.com (2603:10b6:903:41::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ea510128-2d8a-4390-5199-08d56cc09bf3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307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ZYNWxZd3f0N0vSm3L9GAW9vvWvstYn9XS+U1fAOtSVq3a6+uAecDYuZZWUiBxDOdZM+3nSrDLCJOZXXewEXLSmWqt510h9E6twH9GkBDMV6omiOqYpW1Js9TJYAYfBA6DEm9LGVWJRXVu7O8VEAWtZahS0XNC4FPo0XEfqsDUa8EB0EVgQG8GvRpLbfoN14/xAfZdz8jblCH4SywuJUz6ULJS99gmpe/cfxWtOjQcVodVVQDwKK/gwRkOssSym0VkOLHRa3dPkUueX3SOYF4BE/hw1CFvmq7Ju/wAeYehiqzwZKcEirZmhIUPh9oLcgEGt0us1WU90e05+MSKwMCb0dp6IF4Q7SQikhcOKSCiWcav8F4O7mZBax9BZz1LHpsDL6pfflvNRs2Ly78B+4LMLOh07AlnAkz26P5ixvfLiu9MmruG0;4:AIaMsTvjYIHdwO3IJMLvJ25DbNPXCatq2n5CzAGeZH+Q2VNUsDI128+P76QVgQ5rgzE8rQ4XrlQOAkrwD/yUrZ4cUxJH5KWTgzXY0kpGEBhXRBduwzGMoDcYlfJkGiDVFu/BYFetC4ciYCW/QxH0AklcJ1z6LexvOo9p2280tAup9CD6E4IpOHycd9P7msaDFeW75MESdIc1HLNztv1v7G6e3B+BfDsCS2n2zwSr+8tibqJX0Z7t5vSOsC0Io7JLzcldpp7LBl5y+T7fJQNY6x+TNk5a+o1BgBHbwQHWKG0+PKTmm8IvPc+AJdck8WwL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:CY4PR12MB1367;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1367; X-Forefront-PRVS: 0574D4712B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(346002)(396003)(39860400002)(376002)(366004)(39380400002)(189003)(199004)(377424004)(65806001)(7416002)(52116002)(2906002)(105586002)(81166006)(81156014)(47776003)(31686004)(26005)(86362001)(106356001)(54906003)(4326008)(58126008)(72206003)(66066001)(65956001)(386003)(478600001)(16526019)(6666003)(67846002)(25786009)(53936002)(6116002)(3846002)(76176011)(316002)(77096007)(53546011)(2950100002)(8936002)(186003)(6246003)(230700001)(68736007)(97736004)(83506002)(8676002)(6916009)(52146003)(229853002)(64126003)(31696002)(16576012)(50466002)(6486002)(5660300001)(305945005)(65826007)(36756003)(23676004)(7736002)(2486003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1367;H:[10.236.18.253];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMzY3OzIzOnBLdERsVGE0dmRyZVVBdG1GbGpERG1HWkFN?= =?utf-8?B?NkpQS0RUa3kwb3E5bnNwd2REVGtuY2ZjTFBjb1BGOWhUZHZFNW5jMmExRzBu?= =?utf-8?B?Y0xVQ25hN1NVUWlmR2o3b1pCc1czdlArNXVXV3pVQjFtTjhTM09Yd3M3YVha?= =?utf-8?B?K29ZSVU5ZmZySlE0TTJoRU02eEliYkJ2am9va0ZOQnUxVituVHpsYmpJRWdu?= =?utf-8?B?bUhSQm1xa0hIWHFjS25peDU3ZjVuYzc0NHc2a3FSMGVQU2c0NFRwM1Vacm01?= =?utf-8?B?VndiS3VhVURCZU5tMWx2R1BhdzI0dGRYeXU0T0xuMHFZMDFoMk1jVlh6YjlG?= =?utf-8?B?L1FmRUlYOHBuVWlRRVZwMERudERnV0E5ZzZWazVZVGhVOE10NDV6L1lsSGlT?= =?utf-8?B?UjVicEd3ek40bE9MS0U0aXNlWC9DUmVxTHpuUFRWWC9seEpZU3NHY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hWin498oUfcc1xJ7TLl4K9501rwHNe6okKJOGckvKXjySg/0E2pWgglZnlNqBR4NvqmaMtuq86ChiI63h4sKlj2lxGcuIc0=;5:YYt9UYqIrp0nYtuboZOjSIQgmB+jWK6MoAy2T5H3XdhcUbjqw0HuFlhGMAJL6MMroZ4OTDs7Gsgwf3hj8upT2hYleQ9iYtgKpm27R355rX1JWmk56FyzkUgbtCjMNlSDrVSnFr1r9SOdKaJfYIuGsjI02EPDV7HDyfuAf+W+brM=;24:nt0e9BxDNgMPIB0cHYZa0VZ89nIp/NEKC7ksY9fA06272xSwR7g2Y98a5MzOhTuv6XEm6lr/zTd0tqwkSKVvrzJZmqZLsvYtWDB3WeuUd2Y=;7:8TGSW72+AoLJC5KezTshKFbuSuzvtXsHqkeDxMlFI53/M6FM9zgC/BI8LjEhjwqszNcZf5LdizGBBGyxkgKO3eupjC5emG4bOpIMfyGZmcPYnMAsL41umjyd1LEWTnrEr+r4Q4juhwzn5Zv+b4TBAkeg8U2dRh9BA2IHZNmsqrbCBGPDKo7OzMLFJDGCjgzngD0YglyEwWqHJ0QA2tEbHLRsnH93h3Nz/30B6ILiNcryZ14Z2Xbc2cmkWpAsfklp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1367;20:8NLhYSvzNbt5ZGE8pMghqPR6x6quHAwiBMpyb5Q/WzCyLl8pgPOd6gX8Os5AAjWe3nnsn6M+aR8KLESkPYt0kqJbXC+/DOSWK85GPWYgWWSI2KrLVKJRElOc0lbAQN+jleAC6TDfjWoIsdPylq7zlZ/ab2etIDmqk70FaRuO7NOaMp6OxFV/3obbIQ8M0522oslRrLtR/aCSuljjdOluyu2YguF49aZ11N+myDql54rhovC4Cx/y/ob5QFjlrjfB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2018 17:48:04.2478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea510128-2d8a-4390-5199-08d56cc09bf3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1367 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/2018 7:43 AM, Radim Krcmar wrote: > 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, Okay. I'll send a v5 with the changes. Thanks. > > thanks. > >> >> /* cpuid 0xC0000001.edx */ >> const u32 kvm_cpuid_C000_0001_edx_x86_features = >> -- >> 2.7.4 >>