Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp369902ybj; Wed, 6 May 2020 20:23:02 -0700 (PDT) X-Google-Smtp-Source: APiQypLt9TG8rQ/k89YS2HdhRaP3lgGMpT0p198oa8Lq+2hEG0tAVzjbJqgoBp51hw2X//905IHc X-Received: by 2002:aa7:ce0f:: with SMTP id d15mr9484182edv.290.1588821782167; Wed, 06 May 2020 20:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588821782; cv=none; d=google.com; s=arc-20160816; b=bITMCarXiBEL02srUdLaPbK2r8TOhi2dttm16LpFz9ike1IbuzIX3Wa9t+5/k4si+A +n8HHb+NAy2GK2lWBK50sJLJyXv22hIva1nQ/Kw/mkKOzgr7JSniAWXcAYQkyUF6aigt u64K0TIz2yloe92w4KrS2mZhs82KykJsttzz5/gBoVKR0M/6VvfDDCXoCShA/mw8K2GU CdZnznDmvSHaUIsQMZzWenZyFiZd+8JKlFRbBPUeM/WbcUBtsaMGXLwQEXD64VaeV9ps JHOJn4KYv0rAeVFvLLm3y3AjBHorYdcjzB0sowHSB6d5IQVDU1IQVnZM8IPMTYBUosKt x1Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:reply-to :ironport-sdr:ironport-sdr; bh=Xq6TGKQVDiftmyWWh/jby5+MeDblXrzSKR0ZK+RaBCg=; b=VlX70i9IpjCxQUszHoDiMgaKPObfJ51vZ1wBNQ53cAGvrZVbF7luo1yK7r05SCCik3 xszyUlExdLxhveH8fMRHOpSZ1ZzEnIgvWZnIVquPVMKjto6K7aEIPYtr9PjHxenr6DlX /nIVfthAKQ/7n4n/qwtIwO+3qoxOlVoJPBqGRF8ZT+iW7lxMj0adMiR01fjQnMaYNmEK IqBSN7XYZ6KSy9N1bulldfy23b5buHBJi99hyhqKabvF+hRE6L5WyXBhNAw5vJaoWWF7 J3ewUp0HnUYE4HnmBGhKnr4SgBVBFe2O9QhewDMLktQWXUczeZqQPR3iST4dVJTBGTyM H4gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si1748232eje.518.2020.05.06.20.22.39; Wed, 06 May 2020 20:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727837AbgEGCWM (ORCPT + 99 others); Wed, 6 May 2020 22:22:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:31295 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgEGCWL (ORCPT ); Wed, 6 May 2020 22:22:11 -0400 IronPort-SDR: 8SbwEQyzKkwfuf17MedXmDJw37z4rnamwpZxzZfELUlCyh/KMv5MYsIgVGswtwHIsq3T012SuI WnXBsTlxoBOg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2020 19:22:11 -0700 IronPort-SDR: N44NmMeJFi8fM31NdVbMUW5ElTg0hNdWotwLp5GU+rlmslq/H+0ZFBWB/1e1UVRVrU5d7l1AQA SZtMqQz3RC9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,361,1583222400"; d="scan'208";a="407477588" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.238.4.141]) ([10.238.4.141]) by orsmga004.jf.intel.com with ESMTP; 06 May 2020 19:22:08 -0700 Reply-To: like.xu@intel.com Subject: Re: [RESEND PATCH] KVM: x86/pmu: Support full width counting To: Paolo Bonzini , Like Xu , Jim Mattson , Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200427071922.86257-1-like.xu@linux.intel.com> From: "Xu, Like" Organization: Intel OTC Message-ID: Date: Thu, 7 May 2020 10:22:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paolo, Thanks for your comments! On 2020/5/5 0:57, Paolo Bonzini wrote: > On 27/04/20 09:19, Like Xu wrote: >> + if (vmx_supported_perf_capabilities()) >> + kvm_cpu_cap_check_and_set(X86_FEATURE_PDCM); > I think we can always set it, worst case it will be zero. Sure,  we could set it for x86. > > However, blocking intel_pmu_set_msr altogether is incorrect. Instead, > you need to: > > - list the MSR in msr_based_features_all so that it appears in > KVM_GET_MSR_FEATURE_INDEX_LIST > > - return the supported bits in vmx_get_msr_feature > > - allow host-initiated writes (as long as they only set supported bits) > of the MSR in intel_pmu_set_msr. Please review the v2 patch for this feature, https://lore.kernel.org/kvm/20200507021452.174646-1-like.xu@linux.intel.com/ Thanks, Like Xu > > Thanks, > > Paolo >