Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3391967iog; Mon, 27 Jun 2022 15:17:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v8mmVf6TlwT0yNxAHq35RYBl0aTPcARa4is8o9WOJu1U41kRm4TY38Gf0K8o0Zq4+TH8wc X-Received: by 2002:a17:906:9ac5:b0:726:2994:6d91 with SMTP id ah5-20020a1709069ac500b0072629946d91mr15312876ejc.74.1656368272304; Mon, 27 Jun 2022 15:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656368272; cv=none; d=google.com; s=arc-20160816; b=h9eycyhOn7qFK3N+8NTj4aW636r09ETKCD30CkdGZrWI+dHHd0VnW4P1I8J4cYlNrA FCOI3forDw6HrHAnxhKLpCttCp+B7nw7UwAvAQH4y8qGz4sgRekZkhMTi4VbwxQ4jZeh YCn4Xiw4S65tMsD2lkMRvJSpL0iiV1mBnkV0Cg4llr98O1OWktL6UM46g95Htz5ITg2w SkE8NkfxG7zbnSN0VsFgttpnRvEkctvnRt4lULLzq3g3OhmvaDxZbHl4FaSbcJ8uE5KV 9SEgY/VGkf26940PnHIUojdJngmjgJkLTJ3vcYhzxga+lbAsI9b/aJmO0vkLs1eLEBPs N63A== 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=y1V4tf5lodVGxFIYxF3tTgY4WJXM26E6j2gCnxOfJEI=; b=KItg3lNHVsD9sAN6esjBXoMRLmRqacRvnh1ok/oXx9jqxRf5kwlJdraIy/YO/dry5L EBhDxaIUMhi6btsTC/No0CBK3eNCpfyGs6z2Oi70U2oCl/XRZfhJ2Y7bZg2zJLVtPzsP lSsBbZPtURwfts8TSytN5m+9w+ujB7a0NjL9mvJTbPdc5alEiDFdwYZnLilz2QC4C5rq 9bissl9I5R8ACc2DL2smmd5Cq5qgHe4PQAp2KZwkHGi/MARl5hT/chp7A2oOgrCDUD5S diJ6JiCnKAmHgcYEhncfGQQM6lBuMmwTKGVDB7uTkx0k/BRpYw8ZlYBZNGWHn7dkYcut zqGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hZwKv9cV; 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 lg15-20020a170906f88f00b006e7f255f245si11871568ejb.36.2022.06.27.15.17.26; Mon, 27 Jun 2022 15:17:52 -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=hZwKv9cV; 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 S242185AbiF0WBL (ORCPT + 99 others); Mon, 27 Jun 2022 18:01:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241570AbiF0Vzr (ORCPT ); Mon, 27 Jun 2022 17:55:47 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C11C713DFB; Mon, 27 Jun 2022 14:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656366906; x=1687902906; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8BrPNw5ZeAWOOfIQSyGr7Gu6ZgI+pfpvXp44VqIh+yU=; b=hZwKv9cVOsw/Ly1G7e+KhD88ab+2r/mOgk5jYSqz9fbft32EqogalpWO y66bXHxSS2A76NJ/xN5sdarbdePWv9aErQNENPB7Qk5OOTV8Eee2gIsdy IYIhO3xqF2ATs2UEgITEzbZXR4nnFjcXQVt2thdMFLfZHo1YFyb2QVHsx ii7bTE41GS1/IVhite94B0zIWpGCEyQexOFnNbtvuUT2NBbBPp2hIy1Ij RhFr0SsxIkjiZm48F9qV4dgSa2tw9sn7wo1iItzvw3tvEjbECDGltekRH Dt0qaHQ3JtdJfK3FIoRnqKcGzsmkR3AEgwMJByFraX8NdZWEhFf+9zyyB w==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="279116131" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="279116131" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 14:55:00 -0700 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="657863711" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 14:55:00 -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 Subject: [PATCH v7 084/102] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Mon, 27 Jun 2022 14:54:16 -0700 Message-Id: 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=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 If the control reaches EXIT_REASON_OTHER_SMI, #SMI is delivered and handled right after returning from the TDX module to KVM nothing needs to be done in KVM. Continue TDX vcpu execution. Signed-off-by: Isaku Yamahata Reviewed-by: Paolo Bonzini --- arch/x86/include/uapi/asm/vmx.h | 1 + arch/x86/kvm/vmx/tdx.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/arch/x86/include/uapi/asm/vmx.h b/arch/x86/include/uapi/asm/vmx.h index a5faf6d88f1b..b3a30ef3efdd 100644 --- a/arch/x86/include/uapi/asm/vmx.h +++ b/arch/x86/include/uapi/asm/vmx.h @@ -34,6 +34,7 @@ #define EXIT_REASON_TRIPLE_FAULT 2 #define EXIT_REASON_INIT_SIGNAL 3 #define EXIT_REASON_SIPI_SIGNAL 4 +#define EXIT_REASON_OTHER_SMI 6 #define EXIT_REASON_INTERRUPT_WINDOW 7 #define EXIT_REASON_NMI_WINDOW 8 diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c index c29501a69167..e5268bfa8d27 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1209,6 +1209,13 @@ int tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath) WARN_ON_ONCE(fastpath != EXIT_FASTPATH_NONE); switch (exit_reason.basic) { + case EXIT_REASON_OTHER_SMI: + /* + * If reach here, it's not a Machine Check System Management + * Interrupt(MSMI). #SMI is delivered and handled right after + * SEAMRET, nothing needs to be done in KVM. + */ + return 1; default: break; } -- 2.25.1