Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp274130rwb; Tue, 25 Jul 2023 15:53:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlFYtqqZZUllLOuqQoLqvPyX1andSP4GmezsvBXIareT0fcZ3FtLWrseZKWhdhg4842XH0p8 X-Received: by 2002:a05:6358:a088:b0:132:db25:bbfc with SMTP id u8-20020a056358a08800b00132db25bbfcmr207097rwn.2.1690325583918; Tue, 25 Jul 2023 15:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690325583; cv=none; d=google.com; s=arc-20160816; b=JdSenu8BG65cX9diee4dh+mwTutVe8iZu6UMkgMNpO0dv6tmz6h23FHQKUgCiGDrIc SgskTu7KiYzvYfEbxXiHnQoapAmuNigig/iN2Flq4SoB2rXft/PO2WqieDOYdxgGdhHA 6COjTDeXZEhJmp2yyYljHvBYc0VFhgdyqMwEVB+KlVhm7u/wDTMDk4tpvYg2Ib1RFePL hnhU2Znkj0h0O4YVSvPQ/YOVMDSRMQWC/9xWne2YMBYP6J1dHerPma9GskwKND6xWG7h 8rlXtsFLY3hAgtGHAuBGd8/L3tccUk/3/eWQQPr2+byqdNUIEGLboazW3PHm6CusEeVc /MMw== 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=iDkDopNT11lghrpCYupzm+W+m4woV26oYAsadH1UfXk=; fh=juxwNcA6iKwLISFgUCNwdoIYC0NKLUseq3xZdq25RR4=; b=QZ+OetJFcTMTE/p2fdJhKxYy+Qnsn9BKWlEIy3DOZRGJC60tk7VOvYvHRBE5hOQVFE w4PFP50U4Yqz2HsLt/DX63X1qGGUDtyHRYEMyTQ6N154DPd6qGSawKnEnR6rcL39y4jp KZAb6hOdKrOJ/S+nC0iLGCzi0JGIInRle5TiwNXw4qgkWwoKcoFc0o1KH5ymV27QHWV/ tpX1VZeWDeNiA7b9oqI/SuJMlhW/xC0OaU/6+BU0RjpwDNq6LaUPDpULwe8O3XGGMKYE M5RTGyjjbaaiNr3uv85waFp8MRQca4AkeG55ukMZR7ShE8+SCh7RpLjO6R0dEFZadegi wDMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="HV/mvXgF"; 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 j69-20020a638048000000b00563dc551161si780507pgd.164.2023.07.25.15.52.39; Tue, 25 Jul 2023 15:53:03 -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="HV/mvXgF"; 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 S232667AbjGYWY1 (ORCPT + 99 others); Tue, 25 Jul 2023 18:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232555AbjGYWWU (ORCPT ); Tue, 25 Jul 2023 18:22:20 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAF74C3F; Tue, 25 Jul 2023 15:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690323466; x=1721859466; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WcaDgfkogRdzhJ1xqHvkpBoLwuvf368y385r/77EQew=; b=HV/mvXgFtYiGXq2ZUaE5JVKv+q+07RyT26xO7kn8oitB5/A0XROPlWO+ h4DJEdpUV5SGi2f5uo3Up871EjVII00CGnkpVXUuvIEco9WQTZw3Cw/cG fUdhZMzQ2kEmizDOmge7rat/bwfIdii53yhGgKw2zEVaKWu/cevq7U7a1 36L3F2DwIMHcy7+mTeJ629WxyjuaxzDR3mPXbkVQEUy/b870XJEDRMjwe opIa4YZF7LfnSi6SVlgqE6hXx403CUQuFI9obhGAJwtqfOFvz8D0vavR0 5n6vySLaFnqIdx9Ishvreo0NXOPGQ4GnXuSgk1uyEW1xabWXntNPWwwQn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="367882665" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="367882665" 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:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="840001872" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="840001872" 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:15:59 -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 085/115] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Tue, 25 Jul 2023 15:14:36 -0700 Message-Id: <68d4f34501980bb0d352e97a339571684b222a2f.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 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 0dfd6ea07aa0..0d92253ea40e 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1196,6 +1196,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