Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp577893rwb; Thu, 12 Jan 2023 09:32:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXuxmKRTifRxAEeo3lEcEqUM26ys1ZAkwL8ZpGelCSO2pMcEV8RuIcJgA7T0k30vPmI5OR7z X-Received: by 2002:aa7:d28c:0:b0:497:4311:59c7 with SMTP id w12-20020aa7d28c000000b00497431159c7mr20050270edq.18.1673544727070; Thu, 12 Jan 2023 09:32:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673544727; cv=none; d=google.com; s=arc-20160816; b=djQx1uCNw15HZSKPiF/0KGHQg/dNEbhAN5P04FoHcxq0+kHOpZsGlY4AY7JBcYSr+G 3Lp/RDcxzfM3OqbVQ9Jf0w78HUFgW/x9F6vSenoQWKhkDo7yrBoOvlcZdCfFVOB2GrhC ZTpq5+VZWDYE3u15sPzez9YXIIo3HcN3UabcMDhQXHGfxP8HxL8kdN3X83dLUAXRX5/6 Q9YciSRpsVp+baPBPVLDoNF+NVesrroZ4F51nkDTpcuDDdwSYl2B61HkK7TQ4bz4ue2j 398ZEc3b+hJWS0fZ0eu7xErC8ur1VHZRSq5Js/6kvEilLUop1I4NXuDaqovdeOgLialD J/nQ== 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=B3FZAzYEIKUeXzVmVLF4PrNRBBuPpBljPewCkQI081I=; b=cJx1YxTCl5orqA9TfCNfA/QctjNaWsHUjh1GZr3JC/m64vW4hZPmayoC+oWvUmY/7z MW7EyfVfpNW7cdT0ceuOUFv4M6KBo1AjGCt9y9JdekRTCO0Wo9rboSmWqkjSYSueOKQU KmNlePXKrTc1i/aEJo78rqid+QKYimtzP8FnAGwdAMa7vNfhtrXLsoV7QmVo1gEvQmq7 MDVCRKNhsoOMh2E17p9C6UMudn9A0iWpJT6tNTCPa0G15PdH51uzKP7Lgne8LhbnEEfj 9Bactgbp06HHyA3l1rvP5Tc0J2HQoMaJXM1DP6yuce9yVZi49rcxRy8LgCNtrMD8wxkG WdBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A3EGDnjm; 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 g14-20020a056402090e00b00468eee7250csi9463940edz.510.2023.01.12.09.31.54; Thu, 12 Jan 2023 09:32:07 -0800 (PST) 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=A3EGDnjm; 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 S240421AbjALQi6 (ORCPT + 50 others); Thu, 12 Jan 2023 11:38:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232299AbjALQhT (ORCPT ); Thu, 12 Jan 2023 11:37:19 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 434CA11158; Thu, 12 Jan 2023 08:33:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673541222; x=1705077222; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bh3Wk4cssaQgw/W4O8uzTVdB/30VUThR7zsUHnJOho8=; b=A3EGDnjmqopQZ5wRr8TVK5ljrssHprGatZnsLpW/M99Es7LCQUHC1NlU EmtLhPmyS9O9h8wptd7KXlcGp2t9pxV1X9I9e67a0udQaQlhShaHvw7FM kgHeTNaqxzD9JBbLYVhjfqYpsXSpiBk1rWIf59JbvrW9Ojbfq+nfD2MCv NJJZ01hNodSTOpn8ufYb4gw8scwFZoWuEhAIKj1Zs9iEXmgsdTtfze741 mB0J6kEqbF/Bj3Rh2thAfyua5fCKIIIKNITv5TgHqY+rksTxQpJggR0U7 vyT300xfKsAkLipjkwdBA896a04vO5BJ+Jp/TpqBW13Up6PY1k4P/ja4c A==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="386089691" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="386089691" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 08:33:35 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="726372532" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="726372532" 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; 12 Jan 2023 08:33:35 -0800 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 Subject: [PATCH v11 086/113] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Thu, 12 Jan 2023 08:32:34 -0800 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=-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 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 47ea12f23471..83df5673d5f2 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1119,6 +1119,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