Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp959962lqo; Fri, 17 May 2024 06:56:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2cd6BdjZBkETHyJO972PBw4KVV6ObOpoDdCtl93yNa6MjnvEdeDHwKe8cVVMkvmGRQVg91zzBXmuWDMKYglfFsTmhWkVlcCzF6SV1GQ== X-Google-Smtp-Source: AGHT+IEcR1gN+z15B4gFop2SKseewj5vQkbm18+3mD7YzwPk/levUsl6MaIDE/+YbKLp7g5iPLxv X-Received: by 2002:a17:906:3558:b0:a59:c345:17fb with SMTP id a640c23a62f3a-a5a11557164mr2161018566b.5.1715954161946; Fri, 17 May 2024 06:56:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715954161; cv=pass; d=google.com; s=arc-20160816; b=snKH3WThIJF0N3Xr/aS1ePVpMIPP4Y6elYIufoc9q7uAAcmvCOHXE2Aqfo2B+faop0 QJnocxJ0FNvPSKZg82fGA1vCToGpj4+flfK+4j31L3Gi2zpAGmLBBpYEsBNHd+lE2jmW p/SX20tpTCTeOwwuRUlnAD2GTtOu+EH2F2ZoIF+b+mmikUMz7orttmGJD5bMr9DN7RCs I5TZSOkl42g1IIrdkWEF09CqRa+VhfYPUPyLdDdBVr0vf/RFq9UMuKdnEjyL3hbALmnM Zkjrk01UOHcSGDifBw2GGQe9dYlrsvgP2fD3ZvILChtol7Row1NKwfgH9c/x6OZQWS+A ptJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RuomBFibvgqYvr/KKIbDA9g3PuKqQ2VJ9vuyr36lATA=; fh=BzlYhsZSalR/NHwPyv/VN5a0oJrlm1C0rMz1IM8JA6A=; b=qEAsvccThdDIcKHV3oYueQ2CStS0U/izOL8MvfKDWbhYpU9dANVr7K/g88aPJsiaOk Jdh5Sv1mxBQc7qHYlIr74rTDJUw3Zlq38625Ckitwvk9L/VnK3ZAKnKozKA6p7yerI81 bp5ipT/G5HBVw8nszhYg/0bmCi6JUDZzt8lVCiR4ZNr159B1u/zn38s8mg17dUvqcIaM 4XVhu/kUJvE0M2g2zFmFWuDY8oV/OBqIPMyOAcco1F7jbh4U8ZXjHU6MesYZG0Km81Cq iY55UqOxysA0QpPonkcsllDii4Hsp99NNfK2/K0cnW/7o7GUSv9LoLla17UQQTbGmpkI FR7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ndM3ozU3; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-182164-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182164-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. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be69aasi993239666b.830.2024.05.17.06.56.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 06:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182164-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ndM3ozU3; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-182164-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182164-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 AD3DF1F23302 for ; Fri, 17 May 2024 13:56:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2D4055E58; Fri, 17 May 2024 13:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ndM3ozU3" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 F30214F896 for ; Fri, 17 May 2024 13:55:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715954155; cv=none; b=YCjVjfyfqjM08IBalyNHrpx1Yepf0GLs/hV77i8M6tyc7kBJvZbnQ4DWtDQWUZ0Aqid8B6d7LDsqDjAwM8JAdajsGxdg068atun5zEIwGaqwMkIt0Fm0RlX3/asBAwYTKO1k1kHiyCxjNujhe1lasgiaezlDYjMqrCSShbUdmxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715954155; c=relaxed/simple; bh=Zx71wp0+ZUyZy+QAnwGWH0R4N3tMIW4ToXLu0Ve/5MI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XUq6C4T8ZLkJwrgpzDbJebHgYQe7V9Owj4/LjGZnXjKGDPmNPgXBCiB7oer9W46tvaCbWj74CmHTFnhHnxdc4I+peXPyvrccxttJoweZCmrkaO4277xnn3zz5h6+Hz4QaLI2nVXIiEfgWYF8taIzC0cuqDXLDZkWXMJ8y8mMYio= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ndM3ozU3; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715954154; x=1747490154; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Zx71wp0+ZUyZy+QAnwGWH0R4N3tMIW4ToXLu0Ve/5MI=; b=ndM3ozU3jNeIYQCE6HkRdOZhGThLcKhYwIqjzx/Xf4W+bLWO+dEf6Rbo 499J9CpoJFR1WeDirfWddnoJ+SFH389k8G+Oz+7rcK8l96GkM11h7CK11 D/8fNxYJKHY3OcYQ13xPXMPJJAxuTGWxjT9ts89GJ0cmfX53HbAStb+WY 8dWiZLBGYq/Dz3zmast2+jWLO3ALfgRZEAkybHoC2k4XcxA30dkAcC6BN /kx/BhWGhvJlQ393LnTqvYJlccFBU6v6jR81OVfmHZrJkedpTvR0Zpv5w QgzHfsH4F0kUg7fCv5fXxfANHD9DOStFjzTUA5nWmymboQaCvZmaFmCw7 A==; X-CSE-ConnectionGUID: 8bdw88aMSPGsHBAQRqbfRQ== X-CSE-MsgGUID: 4/2Q6W+jSZ6xnCrcIRpaIA== X-IronPort-AV: E=McAfee;i="6600,9927,11075"; a="22805138" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="22805138" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 06:55:53 -0700 X-CSE-ConnectionGUID: cqG2K85WSfSK22mc3P7LGA== X-CSE-MsgGUID: kC61XqpfSiWdFXYnyF+feA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31937696" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 17 May 2024 06:55:51 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id D712819E; Fri, 17 May 2024 16:55:49 +0300 (EEST) Date: Fri, 17 May 2024 16:55:49 +0300 From: "Kirill A. Shutemov" To: Juergen Gross Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-coco@lists.linux.dev, Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: Re: [PATCH] x86/kvm/tdx: Save %rbp in TDX_MODULE_CALL Message-ID: References: <20240517121450.20420-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240517121450.20420-1-jgross@suse.com> On Fri, May 17, 2024 at 02:14:50PM +0200, Juergen Gross wrote: > While testing TDX host support patches, a crash of the host has been > observed a few instructions after doing a seamcall. Reason was a > clobbered %rbp (set to 0), which occurred in spite of the TDX module > offering the feature NOT to modify %rbp across TDX module calls. > > In order not having to build the host kernel with CONFIG_FRAME_POINTER, > save %rbp across a seamcall/tdcall. There's a feature in TDX module 1.5 that prevents RBP modification across TDH.VP.ENTER SEAMCALL. See NO_RBP_MOD in TDX Module 1.5 ABI spec. I think it has to be enabled for all TDs and TDX modules that don't support it need to be rejected. -- Kiryl Shutsemau / Kirill A. Shutemov