Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp169215rdb; Mon, 22 Jan 2024 16:11:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoc4S7L9jk2t+iKaS7Q0yGCgLm0/XE190aI60K2vlOjkPx2RIu+oBNBauhRzQYpazvhptg X-Received: by 2002:a05:622a:1710:b0:42a:3ce2:7b1e with SMTP id h16-20020a05622a171000b0042a3ce27b1emr70374qtk.0.1705968698790; Mon, 22 Jan 2024 16:11:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705968698; cv=pass; d=google.com; s=arc-20160816; b=Z92CCPRXHAC3L/WM+Gahx+JNzjqIkvf8tZp3HMXVPQ5+dAJ3uxG0CcezrZvPb71vIs NeAs8mE1Nl+cD7HrlPFwsLYFupvPda4RCVWRU+YPchl4qu1fZ841njPFfX229ihLse4b siPZQiPsPSPQ97wuJNNxnhnPfcxQaA9VUevp+CiBTjIYQqmOFQOiaZ6ZuOn6YgCowztT ieHK0jdZ70qPMoAdbL8u4MrFJw9r2IhPNc6WMJhAFJT1ou3Sl45iE4a/aUUwcpZdZKpV hBOPZ6L2xlSqAtIei5u/IvM6oOQmMqW2hbDCo0Of423dKU6asja8YINmH+aSOaQfxyKm MBzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ryN+tivSzoRO3dL6pyD1/uNEkyYxJf9wW2HUqdYpdOU=; fh=Itbyk7CEvizIrzGEESCqq3I2tZgG1kc/GkVOa3S7Hsg=; b=QZ2TXEJQgPO8tQNLD1fK7jsE1qEMr4SmoLXI29JNd788A/0w1aNrUwPb03wa0bU+I+ ngCWwEaXSYvzekjlGDpQaGBYPV2XEIlyfZepC2JEqaNyrxdPCyWVVtALvjRmFSfaJEfG qzgv7Lm6mQmFkX1JPpKbFCztf+lszCro3qPZIHpXE3zfKVBBqodzZa0GngokRMI9zarU uQlL5dFKD/5Bx8pwVvQYtVMlLP178ndN+6KlOtqvoTUSQGvGShQE1Zx/0o5bFSupP3k8 3xAHhGxUKvcfJUkKiiCKO73BCrLlrulxFx9max41hJibdiFPDa954XwmC1ccr+ihnplb DvmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aZ84WWJL; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-34395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h3-20020ac85843000000b0042a450e0fa9si2001875qth.332.2024.01.22.16.11.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 16:11:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aZ84WWJL; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-34395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7E4D71C21168 for ; Tue, 23 Jan 2024 00:11:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F7076D1C0; Mon, 22 Jan 2024 23:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aZ84WWJL" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AF9866B43; Mon, 22 Jan 2024 23:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705967759; cv=none; b=Gi5MdOSWomPVNk0twXmbxuIBTDG1/Ut5hInDXi51nnLGchhFYpjGC2Jw3dbAl6TdC8+LlKrO4VUA0V55dz66BsOCs5KZTU3DSG6EfnX7U9148OY2h65EFWu483gf1ehhbwyePuYMtdLtutQ2kBCwRIxCkA6j2pv2lygR1BXgx5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705967759; c=relaxed/simple; bh=xQ4H8znaS1RNe7RViBMqg4j1DVaGcHrtOegsMB9SZOY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b890xubQs0MKLoE0cMNwcfZ9doHXoptXb8sr+MTKqsYCBGOOxIuI7j30FYLWgu/fQRrmhhPyCh1vh8WuhImbXsPDDZlbWxOPCnug4LOH7que3smoiUjF9ba4gpYC+2Ru5xd4H+/w3ZPGnB/cpaSW3VVZs+ED31CdcS/zHxiXOaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aZ84WWJL; arc=none smtp.client-ip=192.55.52.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705967755; x=1737503755; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xQ4H8znaS1RNe7RViBMqg4j1DVaGcHrtOegsMB9SZOY=; b=aZ84WWJL1Il9dcIQ2V5FL6AIZmq+ZwvC97xhEXwxFWVFbg8eBXN2Ni7Z 073zSq74Hnf+BegY9j8hZP39o3ddMzsDWDssmKNNxDGE9oDKysz7DyfBD OoDWLd/x01Qfh8p5RAgSLb+8pm1k/I5rSp8LQk5xPH0d7Y+6UTYd4esWI cctah049Xr18U0LbWuR/nmgYAMULIBkbklpJ8D0zyQGOxsoZ8b6qKIONy 4zwVL6vbBHjmiQPBDn0nTR26P/aegQo6SDKny7mYp5wWriGPz84PgeNwh iJJdiOp3aj3lMeImr46dgYaveRZ9B4MV9i8181dz7CwlYOAaPv3DAjy5T g==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="400217825" X-IronPort-AV: E=Sophos;i="6.05,212,1701158400"; d="scan'208";a="400217825" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 15:55:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,212,1701158400"; d="scan'208";a="27817946" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 15:55:47 -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 , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com Subject: [PATCH v18 089/121] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Mon, 22 Jan 2024 15:54:05 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 cb4a8a8d8e1b..96f43ce288c3 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1390,6 +1390,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