Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2671570rwd; Sun, 28 May 2023 21:52:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DmQ5nNN71+K1CqgZx8IS9O1zM7in69k/A7yA2+2xTH8ksTkSJWduVHzpxOcHixB3kbtp1 X-Received: by 2002:a05:6a20:6f0e:b0:10b:40a9:ec48 with SMTP id gt14-20020a056a206f0e00b0010b40a9ec48mr6653055pzb.29.1685335958402; Sun, 28 May 2023 21:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685335958; cv=none; d=google.com; s=arc-20160816; b=tB9ynb7Rpj0l2yX5Gw8JmcyouGvREQqH3LTmTfRIrMJd6irBNsh9QBQLGH+ZdIKhvL JL+ZvkQIaigMTB5qbWLFsKwt2G0W96yflVBY+g7Aw1tJ4XM+NHU5Kpg9o6GHWkC0dFrD I1NDKpHyiTOAVI+N3ebg6A2nFGdZQDbXLxv3OSa+uQB8Rl4+6Hvs7AkzgkmHf6DjnoyJ gjGMUa3AR+JbP9+OjbhwDrovHnh00/iK8VyY02O293jZ6M7jq+NbuV3zo7wMQcKmhijs IhlwXe+ADovh1fV8axom7RZymOhhRUShWEy73CutidrylAK2AmXahWZOyQrZN1go3Vc1 PcPQ== 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=rB5Rtc4KE//m35MYHoNOdzv+JyNnm8vpMMjBdrYEfaM=; b=Zut0A4PEaeqw2suvwC5XW1fv2jFhkuGzh5zjFabRQv/dhFykrPudWklPkOph02D++L eLzJKCOaeGdoRBm+VR4YL8qUhdfhyZbh5KEQOqfMTKWFewh5opZD4gq2Q8PAZc7DrRGh 03sRUAVe5NuBoRiYMURPqKdXCy/b3GaefzmeCmzEMxSbh+2x+I4DFFwZMa/d9vBQtGk+ II6NUZw7TYYCn+QbrwRto5ZVfJBkXiMm2Guwxor5YqHHWYAcokHRZRfJq0gPdpxFREiA kCqEhEuxfJbC6Bf/vCtbI0iMeEE1OXLFK35qYHAZzXnRNCE0ST9fhHOp75DbEJIw2aiD OGCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XU1vWH2k; 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 y8-20020a63b508000000b0053f477a4659si6390758pge.320.2023.05.28.21.52.26; Sun, 28 May 2023 21:52:38 -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=XU1vWH2k; 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 S232739AbjE2EfR (ORCPT + 99 others); Mon, 29 May 2023 00:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232314AbjE2E3u (ORCPT ); Mon, 29 May 2023 00:29:50 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26EF61BDB; Sun, 28 May 2023 21:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685334353; x=1716870353; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Zn8TLu0FwyDA4czmv6a7Kk3xGjiTmUFgR+wXBqGlkjE=; b=XU1vWH2kfvnjYbNn5HU7jmgKIx0siBYnf24cJBAAka7ek0os1GWlsoTC QZQZJtJsBp7RJXzXIx4/rE0Pcr2F786ZL3/3ANKmnyhRAqeUdKuGZNrqy esl1ivp77JE1QwFcMulcLRn7XtNuv5hjc6zgqFzY62cixonSEDotaN0nM Nm0D6QLo5dfnb2NtS/OYOtORoABODMvfZ8h3+Gt8gf2DtWnVpcY8R/E5a p/hQ/ntId1VC4ppbiWU06FedKsUvV97XTw49YolnVNAg9+8ZFoVk3OCHn qhl9bgQnJBr7fUF3saCqie2tfu4rbS6mzaxJskOoi+rQvwx2eXI017+8o Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="334966260" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="334966260" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="775784524" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="775784524" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:36 -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 Subject: [PATCH v14 085/113] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Sun, 28 May 2023 21:20:07 -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=-4.6 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 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 685724c06c34..c3cb65301158 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1194,6 +1194,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