Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp1445852rwj; Sun, 30 Oct 2022 00:29:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4FlDnTI7BbFpcbe4nqIRR4dykPDd8TebiFuKDE61h2FLbZ7aIfdDeafelRFP1hFdqBpmKm X-Received: by 2002:a63:82c6:0:b0:46f:591f:b072 with SMTP id w189-20020a6382c6000000b0046f591fb072mr7207203pgd.0.1667114969855; Sun, 30 Oct 2022 00:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667114969; cv=none; d=google.com; s=arc-20160816; b=IxNc1NUVji3yuM1Yv7bbv4RLR7j5XEbCfG6o7NodxJ374hWuto1920aOaICSpDKFF+ y0JPgOYW15yCEQhqKBjK81mcFk1pxY5oit4ZxoYZKWgE1Ui4DA0TH8HmaA1GbDbfYaxs ZmhOiRafHCNGb3tb9vk0ITWC61YDzfoNPxD3nGTWk1KcXkFLaAKY8nG2l+OxdtehWLpz e3bEEwPJ7aDmUsbITnkzNOeTdUV6KjfPrYNbomdnofmJOzQ21GwbJeTaYCFrbgxivc69 eTK/sePeRut1bddif718mZ3i7CxJJwFaa+0WusRD2Zs4WR65v1ArNzEEclDkH9NgMKPJ WkYA== 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=zRz4lCZ6Ur2LLgUSZ7yWQJWF8yFQ816WyWiMUi+fbQA=; b=uP2JcK4AS0peai6iaaPyBwrStDNCMj5z3TSURBBx+7grAL9ET4FKUKmCd8TCJKd1JM HtN1q52CpZ3hGX1KmKPx07EmNHKee2rTJJg399KVGqMU64NfISMUtKX1auGUn6iIAXdU QrJyvdcC99UuO+QDyW+erqh8UhCZnrusoLS1SjxhEM0lgpJq4cJVcK1h60AAJKECFZfB 3sscBsEEe1c8umJs0WP1zEs1AzQSX7Pl9MuVUr1copfdjnldeGUVVonqJUsbSzKQJUKO oyLHoO2nlJiV7+ODw6ZqOABe31UEEw5uFrXhRWzUn9DthXmacuznLBChiVawrunf2pa9 L2sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SBmcALrA; 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 i6-20020a170902c94600b001780ba6c694si5661343pla.35.2022.10.30.00.29.19; Sun, 30 Oct 2022 00:29:29 -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=SBmcALrA; 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 S231489AbiJ3GcO (ORCPT + 99 others); Sun, 30 Oct 2022 02:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbiJ3Ga2 (ORCPT ); Sun, 30 Oct 2022 02:30:28 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D40E6B12; Sat, 29 Oct 2022 23:24: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=1667111093; x=1698647093; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iJoF+MfYcxL6N0xQS4giY9evG0EJzc+d/OqtX3SJcNw=; b=SBmcALrA/RX/kvmiZMyPmKPsFx+7p2DxvsA5PoOKM4AhwiQCNTwTx36m NjQL8TxZ2q99QaTSdVsANtdz+Ok+AYA4Oq886E43LdKazU7IzKnMdTpX1 4ryDpHop2e8x8GeRSo0h47GP7J3ZnLSNCSk5MztC4bl/4khU9z3d8cW9c pgjld00gULQR/mWESoD9M8NwRQ+RF/bVyywo1Vwex173+3iU0nVmWTE3f 0+m4shDXgCa150SLWw150SgOVP/tY7q4/qleaE+kcWJgVHNciXXjTuMSy LgxJqcQ6EA4z7GLaJ52NZl9NTYvYVCanGJ8EslfWhoo2psl8iYeJDm07S A==; X-IronPort-AV: E=McAfee;i="6500,9779,10515"; a="395037206" X-IronPort-AV: E=Sophos;i="5.95,225,1661842800"; d="scan'208";a="395037206" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2022 23:24:12 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10515"; a="878393128" X-IronPort-AV: E=Sophos;i="5.95,225,1661842800"; d="scan'208";a="878393128" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2022 23:24:12 -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 Subject: [PATCH v10 089/108] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Sat, 29 Oct 2022 23:23:30 -0700 Message-Id: <32d3e497b2e088ef060191f39f3f0495e2c3561a.1667110240.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.9 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 088e98232227..68d9d590ca8f 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1068,6 +1068,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