Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp290331rwb; Tue, 25 Jul 2023 16:10:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlFENNPpq+kadeHKFKCqjvZ/QBg8Lyrv7TiPFk/xTjkAWQXHyxH2/KAVz9GRTXCs2G68GiiO X-Received: by 2002:a17:903:1247:b0:1b3:d4ed:8306 with SMTP id u7-20020a170903124700b001b3d4ed8306mr534709plh.19.1690326619906; Tue, 25 Jul 2023 16:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690326619; cv=none; d=google.com; s=arc-20160816; b=jAG/u+Etn42XbfmPrtyjL6ruW8r3ViaqvGhGi8TmB3p0PjlPuRYkfUux66L9PC1xcH 2EgTxDnv8HP3V2vj3H6w4bjIXvMj6EcjevVdUgwGbWZww+0t9ekokcICvzRpTOh5H9ke HQCfyCfxTNad4b45S9qxQoPbsAlb8KfYVvw8O5G2ErEQMzjldoRGxAhQhmbl+K9ZtrSl TW+UQGUkRFKJBSd3J0+m0Ke/ZXLfWdACHVRUeinG7fwNFGhmb8mhwpPwig6dKIriCDzy SBLQQbs+QcPSagmMX6Yj25rRzAtgqPNouxFpDonF6VwwHidyjpGnq9//A2POyTOW/xb8 MBCg== 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=QR2BrxigmsiQLfxJL6qvheasD8/KsOSs1BzRMxXV1+s=; fh=juxwNcA6iKwLISFgUCNwdoIYC0NKLUseq3xZdq25RR4=; b=cbC11XyF7I/fgJPhyOxBDuIU7rzwPzRxlqKRo1wbguGSELnMEWQeaW7JDoHkxv4yLv xMeauXm2YJMUpGLfruzf16/pqYocL9PE255usXwqrZkmAhaVm8iZaGj+ByrWS+6vKSWW TDqmvjQ+/O84wrLpNOtMyHy/ZGs2Hz7KbtRV8mKUSZuJp+oyLwMeVmPG7rsiinW0mp76 ttvgKweWuzMct8FyBFARnUByl439wJIsLN5HgdsWEwG7uYOKKPXmUJkmqOhLOcHjiRaV zfZrJvlKX/smj1KK8ydbxjTDQatzInlL69sYbRk9FduUJguvy+10DxBzJveqA5pNz0UI 5eSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DPWPZyU5; 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 k5-20020a170902d58500b001b9e8ec2676si12099168plh.505.2023.07.25.16.10.07; Tue, 25 Jul 2023 16:10:19 -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=DPWPZyU5; 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 S232822AbjGYW0E (ORCPT + 99 others); Tue, 25 Jul 2023 18:26:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233263AbjGYWXm (ORCPT ); Tue, 25 Jul 2023 18:23:42 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C648E47; Tue, 25 Jul 2023 15:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690323549; x=1721859549; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SygMEPperMXke5HjXl3/l5VxH7fusAvDX6P2uJF8SEo=; b=DPWPZyU5xKH64/kfl300+Ka+JOwEM0hKtbZ0sej6zbNVWlVDkio6yvby CMe1aLCrMCeihnpCRgKEIbfm2KU8IPVlCVm9cMGvyLJP43Bio4fylv216 e+s54QcRXt3z5VfrvENzVfuTgrLx8V/N2q3qfKd+wWJhfmaDCBw8i6Laq 73Yv8HOPXx1FAOdAy7HOnu8PB7E7Mj16TmbhwweqDgfUVGEDGG1xlQ1kE iZ1R3z9UI4IKaWtSGgUuJvbdgCr1OLh3ic72QkNn6VZw+syzLa/FfbHvU DzCpLAKpucL1wme/HH2Wdz/gUPNGlmgd0/3ti1LvGusQKx8kdjQU7VPa4 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="367882775" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="367882775" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 15:16:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="840001960" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="840001960" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 15:16:09 -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, hang.yuan@intel.com, tina.zhang@intel.com Subject: [PATCH v15 108/115] KVM: TDX: Ignore setting up mce Date: Tue, 25 Jul 2023 15:14:59 -0700 Message-Id: <8816f291483bf3d1ff96cd52d7fc389c49948ec4.1690322424.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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 ad74900bbc56..d235268b2a76 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)) @@ -1046,7 +1054,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