Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3489644rwb; Fri, 30 Sep 2022 04:29:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4GeKq2e2qRJJwIa+aBoLQBKT5zNoS9Gq/Kx7voQ4TREEuMPGaie9lMm39YujQxlrMoWxEn X-Received: by 2002:a17:906:db05:b0:741:5730:270e with SMTP id xj5-20020a170906db0500b007415730270emr5986988ejb.609.1664537379496; Fri, 30 Sep 2022 04:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664537379; cv=none; d=google.com; s=arc-20160816; b=vJS3ZSgiCJuiylav8Ouj12W49w0UOGWS+67RF8bpBKxBWLhYfHGkKsCRvyJw8yQrd5 pZP6/aCmzWSkZY0+Dnj8PRS/cu97SwG0IVoVV7VjQsKus9ZHUScCYGyyHq2occ4mgPPu t/A0sy/HJ91rPp477kiDTO+GayDjuZp+SWpdnEopsPwU9J2r6haatfzd93ab3Tzsjycw zkmDpiRGUscEVQXSv7lEUpP4qL2WzEpXV3o9c6W/SeB+ma1ZzUDIOeE6ZPR7Onw6cMhu QBdMFTFtoRmmjbs2gAvGjHTHkOW22tiJ7uidzLRsdiWa7X0m3hSpqjBdiJerr4V1yQtY IuFw== 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=MSnkPm/ku7jJsyE10BBpYEAU6HheEVHmkUBFpoQbvrI=; b=LmcovmrGQtWwAruGy746djAYCPfet1vyVcMVatFFsRe4ekR8f4dtZQvFUda7dnHwdm 1sDx6LPTcIYH0npeCB/FYLBuTDIkKVu4Pje+WcCFlnbZrkStdl8vhFQ7Zset8VyYQDmY H8ZbsdTRB1yzwqSfIEys+fq2C1xIWf4KlpJhN4PHBOSAltkwCmBU2RwyZSib+9an2RfZ fyFSwLMOs7J6x0CgLW33YEPsVh48iJyKVnEf4Th9qbxocoBmGF29RZQTudS11As2DpCH gMOd2v0iL9on9df7CZe3nJiCzaESCLgLx5qbv3PL0uu08VqaOU5CwW1vt4Le9o0jroeu ABpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hZpd8pEz; 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 e13-20020a056402190d00b00454561e3ba6si1834887edz.560.2022.09.30.04.29.09; Fri, 30 Sep 2022 04:29:39 -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=hZpd8pEz; 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 S232570AbiI3K0F (ORCPT + 99 others); Fri, 30 Sep 2022 06:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231875AbiI3KUo (ORCPT ); Fri, 30 Sep 2022 06:20:44 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECDCC1F11E0; Fri, 30 Sep 2022 03:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664533152; x=1696069152; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AljX8FFgH0+mYqTEgK3uK5bmoc3/YW38RsQiiehMTOQ=; b=hZpd8pEzJAeKmKGGtez9hYybm8zJH00qOLnufK1GYCadKV/PlAz2M1lU /nq75AnX8jlnPL7VQwDKQ/aIrwWnsl4JQRQuDP6LM86U99xL7+8poxJz8 M0DFq/HcdFQtRF4QwPBN9Hczl/n+3ODbf+/l0vRKpuejxtPvjhFBUSdON zJSv7g2ptBQds0AVjciITSRjEIbLBGYV0rFZLRCq1plbR3FGia0wwmZiX BUcR78qDVoqzab5iwy2vGeZBATZTT0GY+rewVu9ZW9XAcHFfbWuTBtWDS VjBRulWqrKmiODqLMMyL4iszTG/Kojj2Ht1qajgwkbTVou2cqgOxfocTl A==; X-IronPort-AV: E=McAfee;i="6500,9779,10485"; a="328540157" X-IronPort-AV: E=Sophos;i="5.93,358,1654585200"; d="scan'208";a="328540157" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2022 03:19:06 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10485"; a="726807785" X-IronPort-AV: E=Sophos;i="5.93,358,1654585200"; d="scan'208";a="726807785" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2022 03:19:06 -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 Subject: [PATCH v9 086/105] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Fri, 30 Sep 2022 03:18:20 -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=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 977f0cc56ab8..fbf7968bf718 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1037,6 +1037,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