Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1182751rbb; Mon, 26 Feb 2024 01:01:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV/uYRbslHc2V9dUR6fMeK7bGIuvOz/w+sbMq3gS5W4jdXYRFLCI57A7a2rFUJRzUOxiXJ5+8fBWLC03qXt2z/qUDRlIEegFyo4mxpWrA== X-Google-Smtp-Source: AGHT+IFDsNe74T5va/Untr0V2ugEXHAbsKg6oOHknMpopDel0p8mGmzbibFtNBhTBvCf2rGg11Fz X-Received: by 2002:a05:6402:1a5c:b0:564:7921:37c3 with SMTP id bf28-20020a0564021a5c00b00564792137c3mr4078432edb.19.1708938081309; Mon, 26 Feb 2024 01:01:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708938081; cv=pass; d=google.com; s=arc-20160816; b=i0YnPu5jconVL65BOfhFnkP513lpB+T/zQ76lqFJoHuXyiB3ZHbLXz1EVdzGCjYN5n OrQnFMiwjcexB5ZbAyVuc5rrUKvkp4t0OqSg/0+FzbJpx/nUhOuUhDxO3dhow80KKNqx FocyKImhXgNU9NAhdhiKFYPq70zp56XErAl4ixGM3dHB6e6rMRkswsZkuq041JAExslV icv5VSuV+tdPDIuA8eQKlmuCOTsacX1NUpW2OMM+3+xY1lQW55H9QeqGecP083y0haHy Lf7tVlgJqgMMHXmA9chKE6uIxN1DBlTMb9RzB0iPfz3zKe7BraMrY0JNzD4u9Yq7S5/g IAPQ== 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=4NjTWR9pJt90B9M50xUbDHMhOfBXN2o/M98+vGWZ8/M=; fh=Itbyk7CEvizIrzGEESCqq3I2tZgG1kc/GkVOa3S7Hsg=; b=qi7e2XDeuugiL7qLs6crAoFtPg6faXwtbGmSJtmRI3M6ctsVPg6k4sVU8R4Fa5rDpV safCCW6TvpmQuWumZ0emF8YXxvjrLxL7/LJdrdt3pQWDCP5faoGoh3zbgeV8CeHQAuQQ wcNKJMRR61Qw/8y21fxdBECjDeJQMxzuHDbyiIKKUADxOhxY0DxJzuzMIADSVQIJBw5K rRqwrhAjg7Dp1MmxVZT7GOvetkdijGujDxHiTsqGzY2rXEMzF+av/8hNnWkgymvx6UHH 5TsUyTpRVjkUpg8MyXKYOZBA8nqOV4wH5imO1agyNeoD/GcKurs/oGvQJ6fw3V5qqCeW +zQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dwxbCuCl; 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-80863-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o23-20020a509b17000000b00564bbfc405csi1880802edi.451.2024.02.26.01.01.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:01:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80863-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dwxbCuCl; 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-80863-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80863-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 521861F242B1 for ; Mon, 26 Feb 2024 09:01:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8891D80053; Mon, 26 Feb 2024 08:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dwxbCuCl" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 13C937E583; Mon, 26 Feb 2024 08:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936139; cv=none; b=YVFj8Ad+Y3oEoqKhopnGdpFL8jyKaXbBOlnNoqo6U1YOb19DqWTi37mQu2LbiVmjAD8MiREq1Iyvc2De0p3K5EgphvWqnEpqy6zTpw0zP9P/T/3USdeF2SimVRF4xjlcHtGwyUEqb1uySqOo1P1G9cM9VZj5tMQMps6AAwiHydM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936139; c=relaxed/simple; bh=3tymZz66rzCmQ3uC8SJb3tbWD7d20lTx/+E3/aBaoK4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KzPJ3z9FLfv67OI/VHX/t65gymhFhDXsaW+R3c8u6LUT8dO6+mkaUh3dqeQAkS1ql35sptVbioQAh6z6kV+bgIXc1ouaIdrlwC0bjHR1YjS7eHBqsfn7GcXNxf472eJq5Yy9ks4qFdbjH5k1OVAt3oNTBK34O5L0wYQI0qKuPQI= 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=dwxbCuCl; arc=none smtp.client-ip=198.175.65.19 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=1708936138; x=1740472138; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3tymZz66rzCmQ3uC8SJb3tbWD7d20lTx/+E3/aBaoK4=; b=dwxbCuClA5R87LNB8WiCzcFz+RnsuzEV1PsaJbrU2he+Xupj2U+hs6zr c8YQjjFiMNVrKw4b8vlSlQSw1dBY1qqzvVmDHzGIghNFB+sYyc8dUuKGF ikyQCIKJLjIRRloF2ai5a775ADflYbS9tdBiCy6yQiGqpO+3eZY7tL1Rb DGdfiVsW5SL0dBSGYB52joi8DNHULW1kH0n7Y9cx73f2QK5fK9hrBRgNt losF7c+CdoIWyuB4LZLmqj9O/R/nA71kuL5uW3W3a1PqY43bQ/2FSnuh0 JLskXJIlrzw0Ic1j8JF3RB1ePEHb6JqUWA33vn8R0vsJpZQWMiukthop0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="3069596" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="3069596" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:28:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="11272684" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:28:57 -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 v19 100/130] KVM: TDX: handle EXIT_REASON_OTHER_SMI Date: Mon, 26 Feb 2024 00:26:42 -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 cba0fd5029be..2f68e6f2b53a 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1345,6 +1345,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