Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1194698rbb; Mon, 26 Feb 2024 01:31:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW1QkJiDI/v8lOZqbFhk/fPPuXGJQkXqtZtUPNmxn/ik09zFTvZj2UVceAeuFwS0mgRkJIFJ1iE4oMWY5rTakSam73BH4SSyuA8jUk+rg== X-Google-Smtp-Source: AGHT+IE9YunhzNRz+FAJrWJvDpPmsVt3KGDeG8KViwq/XH004wC8ExMtHTe03cz+FdQBVulbsU5T X-Received: by 2002:a05:6871:589:b0:21e:c5d7:595e with SMTP id u9-20020a056871058900b0021ec5d7595emr7190352oan.57.1708939875861; Mon, 26 Feb 2024 01:31:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708939875; cv=pass; d=google.com; s=arc-20160816; b=0cGNrepPfU94E5fsXYkvXLjHh4fNGiHoUkS7PRyHfmhyVoooyOOHUvrLowCU/MBhxW YzeOKA/fbAMwOs0YFN46VoE6c6/RJHftI7gJT2hvqTAmMAkK9qOlxHIZsTKUk4QiVjyw U3aLiqdL3t9TxrgzhF2GfyUGIBa83FIfCp5h03x2SFO0PpBJ63rlWYWX+9AT9P5vkx6d IxYvJK7jMgl7JFjs9JKsS/Md+r4cFpXOJBFYzjnSJt/8EubSxDPD9NlZTTMdbbz64VLA rA+PadmZrOFbF6tP1SokN5f9ksflQL60RiOvY9FU9JC0G7d1GBd4MZcIjYRf19obyjHH Ei0w== 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=Q1VsSBffwh0WIFTxUiVQYTQqSXasRH7ER1p49K0PGms=; fh=Itbyk7CEvizIrzGEESCqq3I2tZgG1kc/GkVOa3S7Hsg=; b=nY/O3lzrnXJqYvOFKxzKwt7af9iF488Haaa5JGtr0w3HbWKyl3r5rAk0eK6Ogt9piQ xsLNQbjZ6jzUANpG1qlT73d7af9aErc8IRP1OxlidmOEOrfqHUfxgTTKYIj6toL7lNep E1PM0nyAXXzYvhPpBve13KbHtbUTOmM2sAnQQdqftrnAXUm6Z/17kns2Obg7v9mYB9L2 Zr7L84TJJmJ29trPSaKye7FQh9N5DEYqBQDNPA/wZKDPgfR6xcAIlZ8L0fP3ieTvma2H 74CywFcZGNf+jqnS5gs9mybawcd13nRwacZhjR1ApeGkdDY6SteWafdlmovk0Z37T0XE f1Rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="E7g/7d/T"; 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-80886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e34-20020a635022000000b005ceef3c53a1si3404497pgb.635.2024.02.26.01.31.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:31:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="E7g/7d/T"; 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-80886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80886-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 486D4B235F0 for ; Mon, 26 Feb 2024 09:08:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D45812F5B8; Mon, 26 Feb 2024 08:29:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=intel.com header.i=@intel.com header.b="E7g/7d/T" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 84AD112EBEE; Mon, 26 Feb 2024 08:29:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936159; cv=none; b=mKkrRLQgtADNlIc5OpAflLQBfydzZTMU26uaZRvI6+Smnm2FxfZcUhnIanJbNlmcIgdP3JZHfWv0r+z8+sWi8owu/Y2/i1beAvLza3Jovw5cDPBuJy3OI6qjCVmgsCbVNNVv3srdhqV34oUxr/3de54PlKNJT8fuqyE5UIO3BbI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936159; c=relaxed/simple; bh=VTw9bzx7BOh5z8zeVoQCv87WXQmA2rn8M3JbvT++IJ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Eg82KTqev14zqxTO1OrBPQcH2ZF2DRXdZ5T6BWI4wr14W3Qz7/agPMmPUZTQf/KOEEAtwUyF1mgarfmSNFrvjZ5NbZyRMbwBF2++rL6j79bKzv7GVtsw5C44t5DPyPGloEeNKnbWvTTwS2KgXiNMi/JRU79YnFWFBEgEbn1ONBs= 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=E7g/7d/T; arc=none smtp.client-ip=192.198.163.8 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=1708936157; x=1740472157; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VTw9bzx7BOh5z8zeVoQCv87WXQmA2rn8M3JbvT++IJ4=; b=E7g/7d/T7KT6NUDUMkVk6qcrhoR8jvLmq3tFPGcTagjl8wdihgJHNL6H W41QB9/8mMgIVeql9OI3T3c90hKmQK7XFRFvEBJ7nvIZACEStifKobWNH lZzTDGCO073r7Tc+pAKhYMwJDl1p4ogfXFpwCtNYW2OU2nx9VgTiRoBHw xnAgIQV6aUwB6DEhXCcc9NSv0pgmgD71DhxlZtbnWwYBwq5jCt5Cr8+5e Lj0U6KrFp6nnX2TprtPcnAg0DCnDmdGpKVYuExBLHQcOBT6XYlieEaUou QCn4+558BfFsjbZpDTt/s9a1e9hlAdZ2pSefA3qAdqK1IbPt61NGG6DZv Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="20751400" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="20751400" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:29:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6735133" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:29:10 -0800 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com Subject: [PATCH v19 123/130] KVM: TDX: Ignore setting up mce Date: Mon, 26 Feb 2024 00:27:05 -0800 Message-Id: <52df2fcce3f44911ee736f0abfc62c1ab05c8620.1708933498.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: Isaku Yamahata Because vmx_set_mce function is VMX specific and it cannot be used for TDX. Add vt stub to ignore setting up mce for TDX. Signed-off-by: Isaku Yamahata --- arch/x86/kvm/vmx/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c index 9fcd71999bba..7c47b02d88d8 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -899,6 +899,14 @@ static void vt_cancel_hv_timer(struct kvm_vcpu *vcpu) } #endif +static void vt_setup_mce(struct kvm_vcpu *vcpu) +{ + if (is_td_vcpu(vcpu)) + return; + + vmx_setup_mce(vcpu); +} + static int vt_mem_enc_ioctl(struct kvm *kvm, void __user *argp) { if (!is_td(kvm)) @@ -1085,7 +1093,7 @@ struct kvm_x86_ops vt_x86_ops __initdata = { .cancel_hv_timer = vt_cancel_hv_timer, #endif - .setup_mce = vmx_setup_mce, + .setup_mce = vt_setup_mce, #ifdef CONFIG_KVM_SMM .smi_allowed = vt_smi_allowed, -- 2.25.1