Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp526736rdb; Fri, 26 Jan 2024 03:05:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJxDR0uMlYBgRLvYx36XzUjq+iQUuN8qG5XWymjLhHHPA7fgWb6fSt+BpT8yFpPUSUbjsu X-Received: by 2002:ac8:7d45:0:b0:42a:8344:6c23 with SMTP id h5-20020ac87d45000000b0042a83446c23mr513300qtb.14.1706267155516; Fri, 26 Jan 2024 03:05:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706267155; cv=pass; d=google.com; s=arc-20160816; b=rSoDlF6My4JWn45UUofgJc3xWxGB3mWKaIEbBT4YADfgxFl8VJOf6+kDS5bukQzMTE pRQrQouNtlu0Gk15TXRyRz8QfimgqDFdhnGaAm0637bwiE8lc0egvG27+75Wu8evbAIa WwNkbu18zHh5h97IcyFbZu93s5Jr26mSzjCnW05fhtsRYT4VV5nLHQwmtjFh0PvqJTcG Va4PlqB7oW+mTOO+IGbym/LjpHmHMZD3Bv3GHSu0aAtC4hAnEilzzaDcJjWMxmNuA9dc QJLhY6fEeax2DGN4LjjwlDaoGMdirmBDob5eOVc0MwTEPjr5TF8g5SDE8/gsvMtkhB5Z DFjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0JA/37fDNd+34ofBBUxIX9ts8bYxd4nIgQ1HqD8loJ4=; fh=fKQXo0qMcal6BogvSG9bxyWEWsAUcPVWLMmdMql1Nx4=; b=VWm4jwN51Yo9tDRss4gEPgB0Sqp/THY4GSdMg31sJS/rrbwC7LmpDngVKflVns8J8S 5KBmVHhT19CXKtm2jQbfPzBUiIFv53nKMeS8WDhOlQYT/CryiCZiBjN6W/SRI0aW2OvO 6FWI4AGrjETIAchrHXHIFmqlP7hL5ofm9Z9oZEIsnk1VsPCA7uJzihRUDvfk58MZiP6j AuMuShSFW98lOXcuwxpUf1QKJlBltYK6QsfmRNX2WJfDxU5OhDbroGVnZYSeWs0Yuk6D TIFL1NPedHiSsl1qsP/lQtmGWHt5NEIocXO9dwkZQ1FAM3b9a2zOESfTRjHQSlEc/AwJ tzzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hNFNdqg+; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-39842-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39842-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e9-20020ac84e49000000b0042a6409d610si974948qtw.158.2024.01.26.03.05.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 03:05:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39842-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hNFNdqg+; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-39842-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39842-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1BEF11C2A9FA for ; Fri, 26 Jan 2024 09:41:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4AB0148FEE; Fri, 26 Jan 2024 08:57:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hNFNdqg+" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF61B148319; Fri, 26 Jan 2024 08:57:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706259464; cv=none; b=Qf8VfxcDWResXfhVOpPzsMHvAMTM6QEfn9ULsY5Hc0nhGKgMwIkb3yIspVayd8BUDUQzU5PlR8C8DN8+vWQ70PfcpDiV46+okqt7sFngaXF+FUzuF0tEmnt32rTtQOSzS0F0Z0UoeOq3MaYLWs1MTjURMHqenORowf8yiOXfQkk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706259464; c=relaxed/simple; bh=VmVupQ0f4JlKloBwqRwVJNycDk88RDOb6fGszV69574=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZU20AUg8I2q08xvJPsWUBNoJDYhMc1hAfTVc+nN6DV7YHhuiYOVlx6/mS8q3TWezfr3PaIlr1wcYCvCyLuqbWa3RpA+LRIf3NUx9Hkf1c9MZYY6Bj4D24LCO50ES4/szngFRCH5FuFCeeHSBKctDS7Ur5TzblKzcod31esc8MMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hNFNdqg+; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706259463; x=1737795463; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VmVupQ0f4JlKloBwqRwVJNycDk88RDOb6fGszV69574=; b=hNFNdqg+EgsVlllK8rvGNe5zfXotTth8rEMLH/j8yJSOuL5DqMajS4+4 1L7s7CGVptD56H9XwsbIaF0RLVMWS4ahWrp4dr17MnXOLRlUzPXbEdOC6 mG8N4kh29C5F3/DtEI8B8u298QbKlvwd1NJfvlgYjABhGYG75WaYcsxfZ kfeIFtnz96YIi0QMh3Tf6yO6uj7+VHaN8CfM4n5FTeAZ1bD9QJWiIDAqC OQbcIBFnEVwlVJt9VgJ4QoSXSMu37JlRySt5X2ERMwDSePrUiim7m5G1O rLR3PDzBGZIXOlw2fhTAU+rzZZVY9UT0Dw1ZCarumnorsdrivWCgZbtqu w==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="9792708" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="9792708" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2024 00:57:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="930310216" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="930310216" Received: from yanli3-mobl.ccr.corp.intel.com (HELO xiongzha-desk1.ccr.corp.intel.com) ([10.254.213.178]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2024 00:57:37 -0800 From: Xiong Zhang To: seanjc@google.com, pbonzini@redhat.com, peterz@infradead.org, mizhang@google.com, kan.liang@intel.com, zhenyuw@linux.intel.com, dapeng1.mi@linux.intel.com, jmattson@google.com Cc: kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, zhiyuan.lv@intel.com, eranian@google.com, irogers@google.com, samantha.alt@intel.com, like.xu.linux@gmail.com, chao.gao@intel.com, xiong.y.zhang@linux.intel.com Subject: [RFC PATCH 25/41] KVM: x86/pmu: Introduce macro PMU_CAP_PERF_METRICS Date: Fri, 26 Jan 2024 16:54:28 +0800 Message-Id: <20240126085444.324918-26-xiong.y.zhang@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240126085444.324918-1-xiong.y.zhang@linux.intel.com> References: <20240126085444.324918-1-xiong.y.zhang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Dapeng Mi Define macro PMU_CAP_PERF_METRICS to represent bit[15] of MSR_IA32_PERF_CAPABILITIES MSR. This bit is used to represent whether perf metrics feature is enabled. Signed-off-by: Dapeng Mi --- arch/x86/kvm/vmx/capabilities.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h index 41a4533f9989..d8317552b634 100644 --- a/arch/x86/kvm/vmx/capabilities.h +++ b/arch/x86/kvm/vmx/capabilities.h @@ -22,6 +22,7 @@ extern int __read_mostly pt_mode; #define PT_MODE_HOST_GUEST 1 #define PMU_CAP_FW_WRITES (1ULL << 13) +#define PMU_CAP_PERF_METRICS BIT_ULL(15) #define PMU_CAP_LBR_FMT 0x3f struct nested_vmx_msrs { -- 2.34.1