Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp606868lqd; Wed, 24 Apr 2024 11:15:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtV65szy8SsVPWaCtnZ6XwJJsJ89/OTd7rxcQ2nWvD4qpEaLQ5dqsz/ObaoXxmex0OJb8X1UMl2k1ktrzEX/9ZNvp8fY1832iIXXWDkA== X-Google-Smtp-Source: AGHT+IGwDwg6XQZJZJOkTr2ljun0KEHAERjZg2Prx7ShljeltviiTMmGM3IfbN7OPqf3z4ghEjqC X-Received: by 2002:a17:902:d34d:b0:1e8:674b:d10f with SMTP id l13-20020a170902d34d00b001e8674bd10fmr3498454plk.41.1713982532739; Wed, 24 Apr 2024 11:15:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713982532; cv=pass; d=google.com; s=arc-20160816; b=vbn1AwICk3EdcZDvsYTzwLUcrIooMH1NyncC2AKi6IBQWZ6KtKpc6Gx2okdK/5l0yU 6tlmJUHDQt7xvJvrSjgHCXp8gLwgtT573TpXL6J46GJc7UMmnYfW91I1fNSqoO5omwoG NWutudIh0/F9Izxs0WIeSuRpVT5z+hufSCUAQ1Kupg6oLCsLZk7ASe635zfNZ/ocSNqq +8dshg5yr55D1rr+Q0ITOPvRf6lUVlQDF/sKiOLLEi9N5rYMX5ZnndK4Odn9aQCVwowC 8N0662F2Y/ohEcRIJ6aSOK9WntD5ifRCvzsoYK0f3rKqW27DdX2+qyn9RbJ3mKvfyMrb jh6Q== 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=hre+1qfo7EqK6qdwIKLlxAe6OwHNU1VOtJPICRgFWag=; fh=RG925cKlzMp8D5FGyJFuoZ6FlW4MBw0+rccgPQu036E=; b=teoQ/uiG9UQLAaFzHc0ISRQPVzMP5Yba5VvHDSpi2F6oTG7Z6m0kfP+S+TubMlON6A I8ngu5PYwasOXGh/cXK/DBFgQAilwW7CTGkhNLdqnhzZQd2DxTCveP98uFPSQwrAlvnm /2okbXC/B5PY4QUmDa9pziT6PHMGJurpQpztAki9QKODA05+oVYq4EuTs3SysOWBocaW B8u2hmPB1mX06OYpHmCvmBAKuA6eNUicqr4cbfOFybAbnmTKk/zemNG8m7GaISaImEBK g5uJgfe3d/RLIu3x2HZv/zxFSxrezRxkuHUyiZBvW5yYBGIvuJ6wXU4CvURaYaB7JoXe 551g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b3CBYKil; 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-157453-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q5-20020a170902b10500b001e278594751si11687256plr.178.2024.04.24.11.15.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 11:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157453-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b3CBYKil; 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-157453-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157453-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 12E1C284173 for ; Wed, 24 Apr 2024 18:15:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63E5E16EC15; Wed, 24 Apr 2024 18:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="b3CBYKil" 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 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: 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 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; -- 2.44.0