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 50554C6FA99 for ; Sun, 12 Mar 2023 18:07:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232221AbjCLSHg (ORCPT ); Sun, 12 Mar 2023 14:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbjCLSFb (ORCPT ); Sun, 12 Mar 2023 14:05:31 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4560F51C94; Sun, 12 Mar 2023 11:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678644075; x=1710180075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bvpcgAwVpeg7/WO0yoOb3OVe2kFQf5ZCphhJWw13l8E=; b=YrCNnlr4K2GTD7olreGiCs+u1aK/DAqe6Wi2OfWLrhe0m7HMARqWj7cE 3AXecXr6YUr4nV/x+BzUZsR3l4pID88811xyCDLxm68z6ZRMZQeNTKAts 9NF/X7KvMCpFoUv/St/VAmPZ5WZsiTq+TexlshHY4uWm8v1Ap7BI9Qbx/ tmYMDX7KjrsymuyiBA0vmSWdj5nAXZuR9bO3gnDXsgbHO8TP64ZSy3pnd dWunldtJG0oxX/32/9rlyHoSiuTbox/8edWfLVFrha46apZ1mS6GSR28X feF+MhYLCT6Bko8q6GMKSnaN2n1fdqaRxx6seVzdrGjOZDQsMdUx/LnNp Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="316660132" X-IronPort-AV: E=Sophos;i="5.98,254,1673942400"; d="scan'208";a="316660132" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2023 10:58:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="742596857" X-IronPort-AV: E=Sophos;i="5.98,254,1673942400"; d="scan'208";a="742596857" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2023 10:58:17 -0700 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 v13 107/113] KVM: TDX: Ignore setting up mce Date: Sun, 12 Mar 2023 10:57:11 -0700 Message-Id: <65f24d01a65b3ee0de991ecf6af555cf378f5d45.1678643052.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 6ec7b6e5b9c2..dfa072253397 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -893,6 +893,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)) @@ -1049,7 +1057,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