From patchwork Wed Apr 24 18:14:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Luck X-Patchwork-Id: 13642307 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 6A57A16D9DE; Wed, 24 Apr 2024 18:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713982489; cv=none; b=S+sQv/c8BuhGYbsRWk1cHmUwYB7SOGr4shr9ZbxxR0OtpTKeK+u1P6Evd5PhMuhprbzDYx+V3QVNYrhVCsZrAsRjHkiG0aqEvwGuwST+HDbxAdzXSVtq5pwwdgDzpLi700KiX1Kt0cm7XfCxLZBLmY9pE60YrxsEJwlCBO5BPmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713982489; c=relaxed/simple; bh=kkF0kOmubRaABW0Hf14QsZUk5Z9XWIfvaI1+06NWDic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CvGXdUGon7srow/BJ9ONwhHD46OZ2VC0Fo66rHDUG2ywPqY4Axy/uD7Io4paJIqRWZG9gq10sNpRYBvWldAY5awQ128Vh5PMRZVj/7hWn8DLty2lTv2NVyPpdbNWTC7pCPBfcl92yopuy1cVz+Fd9FwZM+IcelpY0vBwY/t6h6U= 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=VT/bioXR; arc=none smtp.client-ip=192.198.163.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VT/bioXR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713982488; x=1745518488; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kkF0kOmubRaABW0Hf14QsZUk5Z9XWIfvaI1+06NWDic=; b=VT/bioXRfEpqWYyn8QbY6SY5XgZlTbkDuNok+q/MDdgwbn+zxovExB08 l3xWnAEcDxDHLMGe2ho65VLUij47MUR2QbT6CXf4GB89VvFyLviE85bjH 7xbSCHDXuRD1+BVdM0Sp3HyJ/7+4hbn49auGFUrzJw2dRUAgeI2+Ga4wf gd4yyXlA4tt0gkPY63B6IT5DRrfTOdPKQFPLSDYYWUsmW5IKt65zQnFTZ WKIYs+ONXPShIYZ7Rjo731rBcgzSSPcSRfPqFfUbVRnFZ9AND6F7MPKuy KyyoLpdo0dAWMgg7gjZ/Tn/lPLIoDpQP94P7C+/4gNz65zp+CJvmPvKMB g==; X-CSE-ConnectionGUID: Qg8ZnJioQYafVr9/be98aA== X-CSE-MsgGUID: gpsBp6dvTlOB1dQkNH1QdQ== X-IronPort-AV: E=McAfee;i="6600,9927,11054"; a="9503378" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="9503378" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 11:14:47 -0700 X-CSE-ConnectionGUID: yRuNC9RIQPOiq37fhZbzPg== X-CSE-MsgGUID: z01KKwbxTIKkzN3BFVKWSQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="24683658" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 11:14:47 -0700 From: Tony Luck To: Borislav Petkov , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org Cc: Sean Christopherson , Paolo Bonzini , "H. Peter Anvin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v4 03/71] KVM: x86/pmu: Switch to new Intel CPU model defines Date: Wed, 24 Apr 2024 11:14:46 -0700 Message-ID: <20240424181446.41212-1-tony.luck@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424181245.41141-1-tony.luck@intel.com> References: <20240424181245.41141-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 New CPU #defines encode vendor and family as well as model. Signed-off-by: Tony Luck Acked-by: Sean Christopherson --- arch/x86/kvm/pmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index c397b28e3d1b..2faa67a4bfb6 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -34,16 +34,16 @@ EXPORT_SYMBOL_GPL(kvm_pmu_eventsel); /* Precise Distribution of Instructions Retired (PDIR) */ static const struct x86_cpu_id vmx_pebs_pdir_cpu[] = { - X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, NULL), - X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, NULL), + X86_MATCH_VFM(INTEL_ICELAKE_D, NULL), + X86_MATCH_VFM(INTEL_ICELAKE_X, NULL), /* Instruction-Accurate PDIR (PDIR++) */ - X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, NULL), + X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, NULL), {} }; /* Precise Distribution (PDist) */ static const struct x86_cpu_id vmx_pebs_pdist_cpu[] = { - X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, NULL), + X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, NULL), {} }; From patchwork Wed Apr 24 18:14:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Luck X-Patchwork-Id: 13642308 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 317E916DEAF; Wed, 24 Apr 2024 18:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713982490; cv=none; b=mbwcrLJojwreVkCjhlfV0rT4neD27JXvJXi9XMiamcOx3Z8kBCQm2yblpZ9Fur1LK889Q6mG1MB9jADzB4WN/++4h8z51xW3zgzSgVhEopZ+2N9rWZSS9c+oLak9owIAHe2N+eBo9AJgETg3oNiqsQ1X/dR6UhjAeMiZZTEpYsk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713982490; c=relaxed/simple; bh=DTmj/yYZ5S3zG9s0UR1lWeqfV7XL+xXwEY+aB15HzFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YvrXqCkv9nZGmXY/yx+ztBmyOedfURy0Mxu2r6wt7EFXeORPaesp56WQRCdoQGaM9KAsVU/UGmBoV12+8Qte0D9K0PKnbeuT0IN61kG/Wrwh52cnssqSSCk9AzfwkCQkF8cnC0VtA8HSudJGTfEVIVBXzoMvhYk9zjU9nsv5Fbc= 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=b3CBYKil; arc=none smtp.client-ip=192.198.163.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="b3CBYKil" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713982489; x=1745518489; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DTmj/yYZ5S3zG9s0UR1lWeqfV7XL+xXwEY+aB15HzFA=; b=b3CBYKilboprpZlWgzdqD9tQA4AP6fVl0WRLarLasUSCMg9QKrvPfIYz m8pugqBFi0x2+W3SUeU7/J2qBb/F9SCh2yWle26XQznBAcgLkjkEDixBB WMKaAenJ9j4tdnmk2mJCMoJiDnvnjF7LbtLQY12ek8xZkEj+XtwQydGdQ D0EJsAAAGPsUXOnDdafZyQwP0xLCels9GdCkAc4sRQx/uTvJLMOILXpAq 2vGcFW4PXXtyJ8d1c5X/Fi4fag74nIKg+UgJQDb/tT1dqIyrvSSvOS2eK q/GcqVSYdfJ6/PdSZe7PIXRBvuK8Yid8C7BgMciF/0Fkc1H2pqNu103Cm A==; X-CSE-ConnectionGUID: ABbjj0LRT9KRNRChC0+mUQ== X-CSE-MsgGUID: iZOF3LVsTk6u2BRYDysHCw== X-IronPort-AV: E=McAfee;i="6600,9927,11054"; a="9503390" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="9503390" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 11:14:48 -0700 X-CSE-ConnectionGUID: 8YGYbTfMQSmqKIpYGLP9mg== X-CSE-MsgGUID: iJt3JCwTSSe45nPXccqmjw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="24683664" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 11:14:48 -0700 From: Tony Luck To: Borislav Petkov , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org Cc: Sean Christopherson , Paolo Bonzini , "H. Peter Anvin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v4 04/71] KVM: VMX: Switch to new Intel CPU model defines Date: Wed, 24 Apr 2024 11:14:47 -0700 Message-ID: <20240424181447.41231-1-tony.luck@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424181245.41141-1-tony.luck@intel.com> References: <20240424181245.41141-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 New CPU #defines encode vendor and family as well as model. Signed-off-by: Tony Luck Acked-by: Sean Christopherson --- arch/x86/kvm/vmx/vmx.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index c37a89eda90f..2c747f2642c6 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -2518,17 +2518,15 @@ static bool cpu_has_sgx(void) */ static bool cpu_has_perf_global_ctrl_bug(void) { - if (boot_cpu_data.x86 == 0x6) { - switch (boot_cpu_data.x86_model) { - case INTEL_FAM6_NEHALEM_EP: /* AAK155 */ - case INTEL_FAM6_NEHALEM: /* AAP115 */ - case INTEL_FAM6_WESTMERE: /* AAT100 */ - case INTEL_FAM6_WESTMERE_EP: /* BC86,AAY89,BD102 */ - case INTEL_FAM6_NEHALEM_EX: /* BA97 */ - return true; - default: - break; - } + switch (boot_cpu_data.x86_vfm) { + case INTEL_NEHALEM_EP: /* AAK155 */ + case INTEL_NEHALEM: /* AAP115 */ + case INTEL_WESTMERE: /* AAT100 */ + case INTEL_WESTMERE_EP: /* BC86,AAY89,BD102 */ + case INTEL_NEHALEM_EX: /* BA97 */ + return true; + default: + break; } return false;