Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2624006rdg; Mon, 16 Oct 2023 09:41:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFB8l6BWF5AfdehPICUaw3jcKWLzGVbTntPQCYCVf1+txeKbxUtI2n7dSCQJmvDgGrT3bLk X-Received: by 2002:a17:90a:de8a:b0:277:422d:3a0f with SMTP id n10-20020a17090ade8a00b00277422d3a0fmr12069987pjv.17.1697474510545; Mon, 16 Oct 2023 09:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697474510; cv=none; d=google.com; s=arc-20160816; b=eRUTV7EBc0MCm1SYo2NsA0WsiFy27xFGg6PA1ODH3oss5JPQlpgNShCEfkYc2jTWf8 Cq8TsNIxQW229p3iVdA1HgKiu8EtacIpPiADkxQEcsYSzCq2apqDkIKOl79MsKQakFyr t77gth2PbRTFcRMMdh9Qcaw72U6q27jtu47S76VWOhKFguW9DkuG/yEeGjtKm/RbKefc MPq9hTXpGi1gz7yNWzeWGMz4IGwWxj7QqB2ULNJnIScOB8K125PTdGLutqnX7NANxY/e +uzG89hXXkHK6z3rpkwUTEve6d9yC4Y7DhCQY3HpGx0tuMmkseDbv6Tt5tjOS7WRPHFL y/1g== 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=6o+jXQ1hj4u1KyxWsTvOHatb4/HlpArRxsj0oVfbAPk=; fh=lRdU2Q/1zx5DcPdZuWBjshA5VT5Oc9cEhB1tCFiV0Nw=; b=GXviN1HemrK33FL7y+XxHpML5hnrJlyAzAuNfUpqG0d7X6yVGaHjng4+h9nnXnojXh lTqaQrUzKB3wvC3RdcQaMM/HQxFWFXCtynxViB3Zev5yP8uPmFZQS4A9F57jBf+rSUF1 WXvvLWL4ynHhd32U/64pqPiKqZ++Ps63xgY8t6u6ta5269N8K3JRDFyb6WE4RkqMv5Ov X2/9OCQuC1EkMbZQdqLQKPb8pitE2uK5TkeTs4B00nddeJTOfCN0oHxpa+HGSB4zwbFR YJFRvyszY9zKpjBjeev0uhcZ2M3eST3oJyulDMcDh2Dj2oxRtGls6RqSSkQDIJD7GmQT naNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ai0vhFYL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id me17-20020a17090b17d100b0026b4d5844ccsi7063099pjb.27.2023.10.16.09.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:41:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ai0vhFYL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id C90DB808724A; Mon, 16 Oct 2023 09:40:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234482AbjJPQiy (ORCPT + 99 others); Mon, 16 Oct 2023 12:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234469AbjJPQhh (ORCPT ); Mon, 16 Oct 2023 12:37:37 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10BC4684; Mon, 16 Oct 2023 09:20: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=1697473206; x=1729009206; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jMjX3i5VILZd+3oydEMQ6MGtayaSTsJxSC4eSsm58dw=; b=ai0vhFYLKo6zzRsoCC6WZG9c+CX6VU+KgxVDQd1l6/3Z3XQOgEs+vp/4 R1vxFzeItI9z3cu4s9QNx8Vy5N+Hu3Qa31ENa4Eu4UBZhtVsKgGwLYQPW Hf+0IuVKXLYCKhqjshe1/ikJRsSHYM0WgTmRVsZXxkxFhHhJs/q0qdaXK 6SDvYXkBJ3qS/OoyeThn5S3R0BEZFjRieJNLVcp548Gv7Hp+FmEkA9LRd JGDbxBj5ufCStms8JYhNU6EWuFOfMKDzljV5cv0frIUb902KK0isMKX6A yig5BnDWHj0nNlfJE09EqxwzHm63shbqBwWS9CtpeNPIfGoWruDE7tHMq g==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="364921999" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="364921999" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:16:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="846448267" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="846448267" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:16:01 -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 084/116] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Mon, 16 Oct 2023 09:14:36 -0700 Message-Id: <31a43bf32cb48b408ed447e93b06e2480ca9ab85.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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 09:40:42 -0700 (PDT) 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 306d555dda35..618c2ecec26a 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1339,6 +1339,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