Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2618902rdg; Mon, 16 Oct 2023 09:33:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1MO6iImtdb0Bt3I1GfFrqiYiIm4Vblf6upp0NDEFlANl8f+ltqsOrc5xDlGIY80kmeAiI X-Received: by 2002:a17:902:dac9:b0:1ca:8e79:53c1 with SMTP id q9-20020a170902dac900b001ca8e7953c1mr1186022plx.13.1697473980364; Mon, 16 Oct 2023 09:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697473980; cv=none; d=google.com; s=arc-20160816; b=hEk3zxsSc2sERcVPKlylfBXC3iajrFWcby8L3tEIAqaTTmbH7XzEvvaR9Td9LlYifg WOHj5IEYdy7CrcOqpJqch8FI4DProbrWppic22exA5ezBAEYYz7A88TsY7k+ZyXZU1ov tTJck6xzj6K7pSuqZkI5uVNxwUqujoWYABj/bB2ij1KK8cGpb2YIg5WlKP9hCRYFnoNt ugQqQzejsPKwHzSVN4o4s/rEqdETl/Sp5CUfY2yTsll4xXK+CEOM5GFutyrd169qFgta 0gKRc1a/F7MfKub28rF32B89194QTOhoZg7qA4BbxHb5wi2jCUG15UryCkeCKPdZf7Al j+jQ== 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=nbzhWILcr7lLsEvlim3C4hIzm9pzBOnzgPsEYgWDv84=; fh=lRdU2Q/1zx5DcPdZuWBjshA5VT5Oc9cEhB1tCFiV0Nw=; b=Qj+AFLb5ndi9La+qPgY1MD3Sb93U/OiBmu87NA5R3JYfEe9EWl+zB6Nw+wUBKFYZze hiH0JOpmY95ZeRirSAMrRwxGxzk7/8CbDmeBFNhEfhtpl5lW0RF/QmAq7411EUo8AOXn qP19wIQRhwmjsmu0fSHhpG8DBaZexVWPTa3+uUSJQz5T9wn3WwFtqLHBh9FKiyNRlSwl VuMzTHTdFkc6f2twy6I5gr3pye+7LhzvYWK/vEDG5NJWD84LwW99i551eulV/NLIm7kc 6ejG7a75GlObakAcITxe6liqu2n5kr8qR/7lBWFwJsl0H4lBvbFxz9DM3Ds6pYOAGaDr JY+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bCyozLs8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id e7-20020a17090301c700b001c3411c9b83si7642914plh.454.2023.10.16.09.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bCyozLs8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4D59980212DF; Mon, 16 Oct 2023 09:32:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229501AbjJPQcQ (ORCPT + 99 others); Mon, 16 Oct 2023 12:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234007AbjJPQbY (ORCPT ); Mon, 16 Oct 2023 12:31:24 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1204D7286; Mon, 16 Oct 2023 09:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697473360; x=1729009360; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=E6c9V9MUT82VCy0R4rGt4QE+KOWS8Q3ns5Q31IAK/2k=; b=bCyozLs8IVmXb+2z0v5ZBY9ijvFjtZDhKsAa5xuY+FLZ6Xw+OIHfo+Kd s3WXve8DYz4oL9HEEK+ONh+DvYFHruyNSsnSp80uMWU17SoSMVaoW6SOx pnT0nv+SAVRwHSZwXs7FgfWqlea2htVQBro+L3G0dYV6WSEgAJSI5l4cc 5z5InGt/cKFvfX2DkOZFIdY+aSDGmcnO7dn7+jeopp4LC5KLv7eieQD0J KolhMRw79nfrO4vQNkGh61jE8RNRUVctD6ILf1gqIVPIL+JStBQYrH365 wBXUqPa40mja2bmQwxXoV09otqEZ+1npq0KsFYNIHlgbvm0YeympTIKHa Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="364922137" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="364922137" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:16:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="1003006475" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="1003006475" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:16:11 -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 v16 107/116] KVM: TDX: Ignore setting up mce Date: Mon, 16 Oct 2023 09:14:59 -0700 Message-Id: <2f26eae805dea844d5ba513e2c1bb9b9a7c6554b.1697471314.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=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 09:32:50 -0700 (PDT) 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 d5ee4069f684..df84a12aa232 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -908,6 +908,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)) @@ -1063,7 +1071,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