Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDCCEC7EE2D for ; Mon, 27 Feb 2023 08:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232153AbjB0IcW (ORCPT ); Mon, 27 Feb 2023 03:32:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231961AbjB0IaP (ORCPT ); Mon, 27 Feb 2023 03:30:15 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94B041D925; Mon, 27 Feb 2023 00:27:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677486421; x=1709022421; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RlLLDqsjdsWGZZGnbwmWrW/7AkVVVP9WsV72zRvKFMk=; b=S11P3KjvOEVOWJEVCd6zcoNFF1bBXRZj9l36BhYOnm5eSmfgvTKpXGED munJP6u+L5I2Uwr6/XqcXKjVAqNqQHnbnGBP7TS4KvQiGk0iePwVstM3N IbbODhjN4His3BkVprt9kWDvwTl2+gcjI4Ez5MqWKjkbj9bkKUh4hMxA1 l9M0XlpdnuDQNUUzSi2BUU6aOsobzt3szpt6+LEKSL2ocV6JgI/zxv9ez C0pF3MUQz8oIz6wOd56fLVx1a/3O7KrEV68PLwCvAkgdXj1z1OQvqVb0Y nGJPHyjqvWLZ7pQGtQZmjJ1QrsIMUWdwZ3FF1j8ri+3fudA37sF8VrjyA Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="317609109" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="317609109" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2023 00:24:21 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="783242444" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="783242444" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2023 00:24:20 -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 , Kai Huang , Zhi Wang Subject: [PATCH v12 100/106] KVM: TDX: Ignore setting up mce Date: Mon, 27 Feb 2023 00:23:39 -0800 Message-Id: <4e6af93ad7f1970dc058bca1ffbedf5cd6b936f4.1677484918.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 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 340e76e1b59e..73ea15754102 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -871,6 +871,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)) @@ -1027,7 +1035,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