Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2671922rwd; Sun, 28 May 2023 21:53:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7rVcOVM5aJ0w53jTAt5OW47A63ivXS/8jtfr1Z5Sjz8g8WUHYLCh2S4B6Q3+JM16j0dNMW X-Received: by 2002:a05:6a00:1896:b0:643:59cd:6cad with SMTP id x22-20020a056a00189600b0064359cd6cadmr14714905pfh.24.1685335992641; Sun, 28 May 2023 21:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685335992; cv=none; d=google.com; s=arc-20160816; b=z+RSS72HcUZl/dpbMh42knQpJB6ApD/rOshfENL/mO7mM3XLztxddHJsdtZOsmGiei wGp11EBXSGoIJw20KtcX5Bl2bLKaqec3hbr+/sXw8qKkCMhQV27DKIa+zXMKCTjYN6s7 4Mx/hZHHYaj/HjpmwYxGUcXoX/hof6NP8JJkl3IUQWbBTiQ5ZFeyhtqiAF7OS7wa5yw+ MR3oNX60XvaGDalT4BRkr5Acy5xKl38HGnS4K0J/XXaajN5uIVz+j79Ga+MZLR0j5WvY hAs58km4sZjT7xgusghwCz4GitPGBTMZ8pHv+T5BxLQwnAcPNnWGf+OW3aVnleBrs6aY gAVQ== 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=env3z1bAnYFnvOCXFmL0jno3KVb5QMho20KHkEO5Ymw=; b=LU0fq9Sk9RRfIMnwS5QhOxFm+TOChpR+JP1ugFB9AaAPLgRoxE3R74JJZPYHVictvs AAVnimtUjqr2t9uj1MhBfR6gEzGHwY0LS8wBIXoynjpDrL6Uh3CVBe5nfbNlFZdpGApR vxIWjcWns63vCzrMlD2j8zVId/x32LXBQz7nL9K8543zJ9HfP9nNf0zy/AkCtVXBeczz 5/3gw+mxSmZZSRp5vU/JdLryIMFQdRbaQt97TzAGv7bt88KmRkGUGMPr07ZnTAxpUO0y ptfyqwSjExISfUhgHCBrRHkHFnWPij5iju/50FvdOqlG6QTscIt5vEY+aNEnn3oakeG4 ebNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gsV/5yeM"; 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 i13-20020a633c4d000000b0053ef5472639si8746798pgn.489.2023.05.28.21.53.00; Sun, 28 May 2023 21:53:12 -0700 (PDT) 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="gsV/5yeM"; 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 S232791AbjE2Ef0 (ORCPT + 99 others); Mon, 29 May 2023 00:35:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231931AbjE2E3J (ORCPT ); Mon, 29 May 2023 00:29:09 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A8D71994; Sun, 28 May 2023 21:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685334328; x=1716870328; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TwRh/qBYWtdzY0K5rpEp1XOxoWVON5CiOdjF1fV85Fw=; b=gsV/5yeMOl18vZJFQ3avU8AUHzXqgui/ITxu4Gn2HdBCCAzzY6K5tXH0 rMc9Mga3ulNwY3h2fNKgBxWurbY4YrBTJFEBwP/ROlItxHNG6rqtJmNAL 9ykN65kErPfVsb3HKP6znmPio50ESAtNdy06b3motXELmPmD6AlXGuJ9B k4+DLSYkaUtDGi5lxuFxeKPbJRvA7pjvTShcdcQULET/8vnGUNmD2ggGy ywDGV5mE1ImNa+VhAsC2loKY2jy5s3/dJ+AbWoyxgZ2A8m6/q7jZHvlDy 9oyHFHU/RwhZPxQVW9yFURJc24calwl003yyElTfHZUkhZ/UMv+9s088t g==; X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="356993528" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="356993528" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="830223591" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="830223591" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:52 -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 , chen.bo@intel.com Subject: [PATCH v14 106/113] KVM: TDX: Ignore setting up mce Date: Sun, 28 May 2023 21:20:28 -0700 Message-Id: <6f78609a8ef4314fcf4786a29fb581a1ce6b6d81.1685333728.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.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 166bf274e597..23e6caaa4cfc 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -892,6 +892,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)) @@ -1048,7 +1056,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