Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp172824rdb; Mon, 22 Jan 2024 16:20:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfoHT0luVPxwv1WaT7JxOq45nTzyLpBb3Nho8K4nIswMyDYQ5xCgWyTTqwCXHKq3JN/xQu X-Received: by 2002:a05:622a:15d4:b0:42a:4a98:ff57 with SMTP id d20-20020a05622a15d400b0042a4a98ff57mr81871qty.57.1705969235759; Mon, 22 Jan 2024 16:20:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705969235; cv=pass; d=google.com; s=arc-20160816; b=aRMnWF7CPnYc4AFz+OQQZ5+dBhRZb8l0+c/enWHgI7zli57zoItEeW7tA97pETuKRV q3dScb7U9Sddynf4S/kpmXO9D0EY4N9qOAw96VF0NLooaK7Gz5BKseAi1z3I2Umui14/ l2vo80nlyKGwOdlL/1I+faOm5wPL8pvrAmVKRckfm9ER/q8ppgI2CBtFEaPVqn6tHYIx i0OsUv8BhwArjAs5YK8cdkeCYnDkSRmPJ8PFVAmWzaW6SceizEi3VTD/YeOmgh3nLXk+ H7vNEfQbsxhgCItcWtjR+kwqYCGcV8MjxpYKFdrHkb6vpdZ90ZJn79MHp0pB2UD08hqE swZA== 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=VTJ2bfaeb0N38B6YUKVBIydm/XIeQJ8lA0vBSd8P2Ts=; fh=Itbyk7CEvizIrzGEESCqq3I2tZgG1kc/GkVOa3S7Hsg=; b=ScXJJrO5LVns429d+46NzaLAPHpQMLCeR8i06ZInARcTsq+FZ84fYMXt4BXZb2r429 lRmTND3c1p4yB/7QTcIOwytzGEbp/nY8+3LHWEOF3b970W3p2WfHdoIkPeTUUeozdr3Q AE7WaPvOwQ0e29i66e6e0Y4XYL8EC5BYiMT6u/8LR5uQe5AblSvqG1FA+NVheqGO6R4o xdZ5d1xqgNO7YopI+GmLswq+Xu9U91VTliROBOd0C6Ut5V8V2FQUDERVC+JEOKDhKCfe epV1OQFxyPJTlQtp+0XJaL+K+Xmh4TZtfmMEcMfxpi3soaMFPwqI1K4eGUYs+27ny1j/ qGMQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pvhh1hnq; 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-34421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34421-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. [147.75.199.223]) by mx.google.com with ESMTPS id v18-20020a05622a145200b0042a39eca0b5si4338984qtx.264.2024.01.22.16.20.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 16:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pvhh1hnq; 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-34421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34421-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 4AB311C261DD for ; Tue, 23 Jan 2024 00:20:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CC7181AB1; Mon, 22 Jan 2024 23:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Pvhh1hnq" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (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 CF27180022; Mon, 22 Jan 2024 23:56:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705967775; cv=none; b=qpNpRP3P7HH0jRYwOuxJ7IaH4zKkWUqg2TAjy4lXbvVdwlG6ZIVk1QluXoBoF9ZZfTOEs966lWZ2D4lKaRQwJhBO1kmd5AOfnQPHRREwD7BmON3QNEyYOPy9ftQUnj1idIvRi4Jv2kdfLg2QxEageEa1wfP+Ud+QfPHjlWOhu3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705967775; c=relaxed/simple; bh=Qf651cuEvP7fTIzGoEsdyFciHi5RVrBo2fUxvhs+SZk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KvSiWQ27K4rPHNqojcVZBWh16qkBy3wZHy3/lz6q8DREp0wnc5wzVykJmemmE9RVlDE2iRWzWbQRzOMw8vydwWxWQUOG3ufv6k8Z2RnojKnDvWn3DaHsfXU9Jfyqq8lcIsQBbnUsoRRB+jJb4coWdm5mliW94oL1tJb3HahkI9s= 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=Pvhh1hnq; arc=none smtp.client-ip=192.55.52.120 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=1705967773; x=1737503773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qf651cuEvP7fTIzGoEsdyFciHi5RVrBo2fUxvhs+SZk=; b=Pvhh1hnqvUaw9CDbfKRYiyZwOzbwWc2oflx/y3YQNv0X67C86PSBKZQI OpzKQGSfBl1kbCNQBSbGgBEjs8lF45hpG1wbFo4+hp10vDOL4UczaZyXx 0R1bRsvOnlx0AHVpeSIaFTQP9p1H90hO47p0etDwb8lMwRnPkRyTiPzf6 GL/72ZWFIwdPddLwCfEETVtIwm8iPtmqe/eWg7iLrpxAkYeEIsHCdQ967 2JmELda6MLW7C5RtjSTVQWmuoetJLoeTJmAldkbju9pVaEHC1MSBa681J MoKtrZ4NHiRTxNJ/N7AY/21Ppyv2vNgyuPcbfl/hbV/jV6WXJqCBHPtmm w==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="400217933" X-IronPort-AV: E=Sophos;i="6.05,212,1701158400"; d="scan'208";a="400217933" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 15:55:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,212,1701158400"; d="scan'208";a="27818024" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 15:55:57 -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 v18 112/121] KVM: TDX: Ignore setting up mce Date: Mon, 22 Jan 2024 15:54:28 -0800 Message-Id: <1f515ee02374468b165ddd4740a50ba2a34e4947.1705965635.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 adaf61bb754c..3a5cd705694e 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -912,6 +912,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)) @@ -1067,7 +1075,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