Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp560809rwb; Thu, 12 Jan 2023 09:19:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXu9Sy33kE9K+BKmD6+I3hBsDINpkKQGfjwBWhLbNsoaXnll4vacYD/KGIm8XcfO6YIgqqaB X-Received: by 2002:a17:906:3a85:b0:7c4:f0b5:fedc with SMTP id y5-20020a1709063a8500b007c4f0b5fedcmr65160535ejd.65.1673543980205; Thu, 12 Jan 2023 09:19:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673543980; cv=none; d=google.com; s=arc-20160816; b=LuEeDj8BM09Prlfa+xqP4m8NSq198cinTsxp3f9HXdidXZ1P/IizrnLff+MxcJVCkK kfKqkrL5Bz/8eV69rSiz+jX77rAHjLkeBMAGtHrHRYdkDf2Lq4yFpEiMIwEkKDylF3GA o1EwxFnOKzC9ZwZzT8Db1eyB1/PQq8VUtgm7aVgsfLtyRjag9DSG5IahmnAR8wVRup13 oUo+A8+szmRpNGoCBWjMamZDx3yz3DP73K0DSDyl0q61dNDeWButejBM6mZvuOQtG7vn P76b6lIVsvYvdMBexh2NL6qNIOoUGzzpYpZiEIbG+dbcDDy+dq7S7wQzmRn3M0ihh2na X4Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=an/ZYhrHc1BczQcnsdY3bJWGWbZClyyCzc49+ZNSGYY=; b=o8TOtcLCSveFbuEo/j6rS6ehMnAKNAtmv5fMQOr/gJPesYhJ8PeDzQJpU7jsVpLp1H cIWurCAFvtKKlHGyqqHwmemrxHjz3hA7Qy2lACm3YBa9DxVIBc0JCsheZ1S8aAU73/uR TJKldkGONuEqsjip9JQDmzIh+wbH0XIFL3xA8EAIdGbjUY2cABP1jjLrTN2EZ897CBMO g5I43iPmcSLJf2JlMjzfqR9JpHJcqtGtCshtwHc+lTR8l5GAz0SU8B+f4A0fdjxUyQu7 9GdwHkW43eFG+dgQCO/SoT99McP8wtJogBhu0XemDfLVavyNs/8snaXpcRCvWq0+xoc9 vh8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jUPj4vrd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020a1709062b1200b007c1b8be3723si13752526ejg.197.2023.01.12.09.19.28; Thu, 12 Jan 2023 09:19:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jUPj4vrd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240300AbjALQmg (ORCPT + 50 others); Thu, 12 Jan 2023 11:42:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjALQha (ORCPT ); Thu, 12 Jan 2023 11:37:30 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F96BDEC4; Thu, 12 Jan 2023 08:33:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673541230; x=1705077230; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DSap38ow2p9M39iZdLN9RDM/2L7UhJz9YKLjOI/nQcs=; b=jUPj4vrdu/+o8JoI2WvoBycUzykE3yJI3DBBU577raKL186JJCXReHnI i74+2RT/En4c3y/UvdVf3q5sn6kaLE6uSAv2di5zlTxH7mPGO4ISSg8BZ OwSoZfCcboNDbgOEyfpv2xTtbjRU+lBzYEFGKTDwbdj3aKeTYauZztYsO qloGzIgSf/oi7H1k229f28PIOkXdul+oXXgBHha4jLloKIAetgt1N0A+5 +kiH5JOHJoxPRMRNqbmPW0LpAnXZNZufcrLJPyPE21eAFy1JWpcH6Q/Vq jchP0nxosAou20c8Yi9DDaRbUuJFp3fi/utx/Ebzzu+lLfYBmizK+QYYr g==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="386089814" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="386089814" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 08:33:39 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="726372623" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="726372623" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 08:33:39 -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 , David Matlack Subject: [PATCH v11 108/113] KVM: TDX: Ignore setting up mce Date: Thu, 12 Jan 2023 08:32:56 -0800 Message-Id: <73966c5979f2d44e5df6604a7ee4c5544d8cbc8b.1673539699.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 bb9fac604ea7..b4d1cc3736a6 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -795,6 +795,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 void vt_get_exit_info(struct kvm_vcpu *vcpu, u32 *reason, u64 *info1, u64 *info2, u32 *intr_info, u32 *error_code) { @@ -950,7 +958,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