Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp240205lqb; Tue, 16 Apr 2024 14:22:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrYLkhHITVPCmMcbM6mjSVnSATIhHKguNlQZxWFrZ04HVdeWvHDMnI+aQSHAYYiH8I24LTfENAmbWuC4M5g//h4A2SIg2ZrPOWVOhFbw== X-Google-Smtp-Source: AGHT+IFL4+E51NVT/J0fwGm3T/t/5d5jabeQZj8Xlw2Gyhb8NPJ1aiRML+ZmJq9tADpEY2fE8Wef X-Received: by 2002:a50:c314:0:b0:570:5b70:efc8 with SMTP id a20-20020a50c314000000b005705b70efc8mr111382edb.6.1713302547661; Tue, 16 Apr 2024 14:22:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713302547; cv=pass; d=google.com; s=arc-20160816; b=wdLDhmr5V4L5GXmHPa5c4Oqb/c7uQ3CDPtRWVOG6sXHErrW2Omg/hjKN1kwSd9JjbN CoP/VXE3nGLDSHKGHc/VKM97qGWck5xRhZRl4bSdt/SEQCx7JfqNRdrZb/xaHY5dBwlg 4WAN/2ZcH172R0Mh0E6qlUn3VU5xqAGqTEzPJTt3L2hfIiWdjH6wT7qh+BjVsbVcfm3R a/pOZekIlvVocDUR2gQoRX3lgVtBiR7bf2rLqah3gPs9VM4RMjgTngFWP6B6jRByrZgN j5H2Y/3AY7N0jWpQeOJOY6JBJ4t4FJvR9fj/4RhCxNsz76jZ3E9IiWi99ew4SPxvrhj6 vi7A== 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=VPT/Z7pXh9dLGKTR8GaZ3LjkhcH97+ex2mjmJntE0M0=; fh=fCCNFvJbPqqXo45yXdlgqaDimb/JVSzwDZSVTcpWFog=; b=y7w09B1MQbyIYCtwtZExQJ/3pTwSWMiYdtrzB4eiNEejKFvQF6KOnkPy/D388U/Pr/ CDNw91lrHdj3Bq0okaOWzWjYx3IetlNMHzHF6P8MBZqv7ELIumZiB+BfWBf7EdV5APh9 63CxyA8sFwAazkSekb+U+LDOSiMsxy+TDBybhkZQpm9sfM1bY29k6vkYqh4fP6dm/cWC L96BQmnTtl74cW+gx2dVM5kh7Gmd91n16ZZAhMGwZuiibT90ud8Rv24zA+/MI+jSjJaN sUBHRTN37QnfbUkPek1ShXec25EgnItywuNLMx0GDZD3sEmcPO6Hbx/Pavc0GNeSihls 2Z/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KYduPplK; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-147573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m9-20020a056402430900b005701e8c01e4si1635551edc.284.2024.04.16.14.22.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 14:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KYduPplK; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-147573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147573-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3B0391F220EE for ; Tue, 16 Apr 2024 21:22:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39A9C13B7B3; Tue, 16 Apr 2024 21:20:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KYduPplK" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 7BC2D13343F for ; Tue, 16 Apr 2024 21:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713302405; cv=none; b=Nasue6Kb49QRUfNEazkl6tmheKWMol9N7gxGDkGRXJzlF2+hYXazsfRb5e/S9aoAezKKAQpI7QkDYrZQyyb3mW78oiyAzCJv8i/MGembSRm9jV/u62I5cy5Jmgcv5/k7o1SeVsEZH+NZia8scOYFsmFL4D1nfsiVi6iiSTwt9Yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713302405; c=relaxed/simple; bh=D6uulQ3cLZc5mQiJu7bFxubPtVC+PN35kkiJSAvGK6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WsgjLTPbap6JdaMEw+vIZIPzlEwLO7qgkQrUrWs7fux9ZVXhWDWoOkpl2U5/kZMKrJUqrEw/WujjjpfOq2MGoAY59y4qDFPsAvQRZ+4y5F6WxucN58pkisNwsd5qpzQwFs0iTz6Q3bcRcFIfpbM7S6u0OfQNklL+z3/G577fcUg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KYduPplK; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713302403; x=1744838403; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D6uulQ3cLZc5mQiJu7bFxubPtVC+PN35kkiJSAvGK6A=; b=KYduPplKYXoq79Xk6++BXORmBYgdITJH9iqHYEyxrGiBzi88OW/HbTT7 tKxoxcnXFWLv2M65JEvCl2n8uoAZyt96Vm/tHLdQzx9XQlrAzecBfEzOW 0m4fi8WxI0DqIcaj7LAJU0+hdd/yeDy+FzB0Qx3IrlwTJu3rg8RmeBv5t RsvTgSpU372dVgRsP/895Eu5QyI0qnXUA7+EY+wP44Inegyni4NXuopVM RGkPB4JePrwViJr51XAJ9+3rguEeU0FJSz3NyCKPxfKgz6B39McUAg8rQ e/mEJCR+Iqv3CXkLgBqgx58Q8W2MhWYEE8gKv5W8yRT/9a3ktwAHfiWDW A==; X-CSE-ConnectionGUID: TqnYlm/7RwSZoTsIg0xwCQ== X-CSE-MsgGUID: HcU5oPAOS1ytwBMqFJxzLw== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="19914718" X-IronPort-AV: E=Sophos;i="6.07,207,1708416000"; d="scan'208";a="19914718" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 14:19:58 -0700 X-CSE-ConnectionGUID: OfBhR9iCSh+eTZNkavE+Xg== X-CSE-MsgGUID: WlHVooziTZ60HhGUKyeReQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,207,1708416000"; d="scan'208";a="22871914" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 14:19:58 -0700 From: Tony Luck To: Borislav Petkov Cc: x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 12/74] x86/cpu/vfm: Update arch/x86/events/msr.c Date: Tue, 16 Apr 2024 14:19:14 -0700 Message-ID: <20240416211941.9369-13-tony.luck@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416211941.9369-1-tony.luck@intel.com> References: <20240416211941.9369-1-tony.luck@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 New CPU #defines encode vendor and family as well as model. Signed-off-by: Tony Luck --- arch/x86/events/msr.c | 131 +++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/arch/x86/events/msr.c b/arch/x86/events/msr.c index 9e237b30f017..19de4cd26de2 100644 --- a/arch/x86/events/msr.c +++ b/arch/x86/events/msr.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "probe.h" @@ -43,75 +44,75 @@ static bool test_intel(int idx, void *data) boot_cpu_data.x86 != 6) return false; - switch (boot_cpu_data.x86_model) { - case INTEL_FAM6_NEHALEM: - case INTEL_FAM6_NEHALEM_G: - case INTEL_FAM6_NEHALEM_EP: - case INTEL_FAM6_NEHALEM_EX: - - case INTEL_FAM6_WESTMERE: - case INTEL_FAM6_WESTMERE_EP: - case INTEL_FAM6_WESTMERE_EX: - - case INTEL_FAM6_SANDYBRIDGE: - case INTEL_FAM6_SANDYBRIDGE_X: - - case INTEL_FAM6_IVYBRIDGE: - case INTEL_FAM6_IVYBRIDGE_X: - - case INTEL_FAM6_HASWELL: - case INTEL_FAM6_HASWELL_X: - case INTEL_FAM6_HASWELL_L: - case INTEL_FAM6_HASWELL_G: - - case INTEL_FAM6_BROADWELL: - case INTEL_FAM6_BROADWELL_D: - case INTEL_FAM6_BROADWELL_G: - case INTEL_FAM6_BROADWELL_X: - case INTEL_FAM6_SAPPHIRERAPIDS_X: - case INTEL_FAM6_EMERALDRAPIDS_X: - case INTEL_FAM6_GRANITERAPIDS_X: - case INTEL_FAM6_GRANITERAPIDS_D: - - case INTEL_FAM6_ATOM_SILVERMONT: - case INTEL_FAM6_ATOM_SILVERMONT_D: - case INTEL_FAM6_ATOM_AIRMONT: - - case INTEL_FAM6_ATOM_GOLDMONT: - case INTEL_FAM6_ATOM_GOLDMONT_D: - case INTEL_FAM6_ATOM_GOLDMONT_PLUS: - case INTEL_FAM6_ATOM_TREMONT_D: - case INTEL_FAM6_ATOM_TREMONT: - case INTEL_FAM6_ATOM_TREMONT_L: - - case INTEL_FAM6_XEON_PHI_KNL: - case INTEL_FAM6_XEON_PHI_KNM: + switch (boot_cpu_data.x86_vfm) { + case INTEL_NEHALEM: + case INTEL_NEHALEM_G: + case INTEL_NEHALEM_EP: + case INTEL_NEHALEM_EX: + + case INTEL_WESTMERE: + case INTEL_WESTMERE_EP: + case INTEL_WESTMERE_EX: + + case INTEL_SANDYBRIDGE: + case INTEL_SANDYBRIDGE_X: + + case INTEL_IVYBRIDGE: + case INTEL_IVYBRIDGE_X: + + case INTEL_HASWELL: + case INTEL_HASWELL_X: + case INTEL_HASWELL_L: + case INTEL_HASWELL_G: + + case INTEL_BROADWELL: + case INTEL_BROADWELL_D: + case INTEL_BROADWELL_G: + case INTEL_BROADWELL_X: + case INTEL_SAPPHIRERAPIDS_X: + case INTEL_EMERALDRAPIDS_X: + case INTEL_GRANITERAPIDS_X: + case INTEL_GRANITERAPIDS_D: + + case INTEL_ATOM_SILVERMONT: + case INTEL_ATOM_SILVERMONT_D: + case INTEL_ATOM_AIRMONT: + + case INTEL_ATOM_GOLDMONT: + case INTEL_ATOM_GOLDMONT_D: + case INTEL_ATOM_GOLDMONT_PLUS: + case INTEL_ATOM_TREMONT_D: + case INTEL_ATOM_TREMONT: + case INTEL_ATOM_TREMONT_L: + + case INTEL_XEON_PHI_KNL: + case INTEL_XEON_PHI_KNM: if (idx == PERF_MSR_SMI) return true; break; - case INTEL_FAM6_SKYLAKE_L: - case INTEL_FAM6_SKYLAKE: - case INTEL_FAM6_SKYLAKE_X: - case INTEL_FAM6_KABYLAKE_L: - case INTEL_FAM6_KABYLAKE: - case INTEL_FAM6_COMETLAKE_L: - case INTEL_FAM6_COMETLAKE: - case INTEL_FAM6_ICELAKE_L: - case INTEL_FAM6_ICELAKE: - case INTEL_FAM6_ICELAKE_X: - case INTEL_FAM6_ICELAKE_D: - case INTEL_FAM6_TIGERLAKE_L: - case INTEL_FAM6_TIGERLAKE: - case INTEL_FAM6_ROCKETLAKE: - case INTEL_FAM6_ALDERLAKE: - case INTEL_FAM6_ALDERLAKE_L: - case INTEL_FAM6_ATOM_GRACEMONT: - case INTEL_FAM6_RAPTORLAKE: - case INTEL_FAM6_RAPTORLAKE_P: - case INTEL_FAM6_RAPTORLAKE_S: - case INTEL_FAM6_METEORLAKE: - case INTEL_FAM6_METEORLAKE_L: + case INTEL_SKYLAKE_L: + case INTEL_SKYLAKE: + case INTEL_SKYLAKE_X: + case INTEL_KABYLAKE_L: + case INTEL_KABYLAKE: + case INTEL_COMETLAKE_L: + case INTEL_COMETLAKE: + case INTEL_ICELAKE_L: + case INTEL_ICELAKE: + case INTEL_ICELAKE_X: + case INTEL_ICELAKE_D: + case INTEL_TIGERLAKE_L: + case INTEL_TIGERLAKE: + case INTEL_ROCKETLAKE: + case INTEL_ALDERLAKE: + case INTEL_ALDERLAKE_L: + case INTEL_ATOM_GRACEMONT: + case INTEL_RAPTORLAKE: + case INTEL_RAPTORLAKE_P: + case INTEL_RAPTORLAKE_S: + case INTEL_METEORLAKE: + case INTEL_METEORLAKE_L: if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF) return true; break; -- 2.44.0