Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp991285lqo; Fri, 17 May 2024 07:41:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwiYQyVbgWbK6nLqMFu38m3ML8DfIuZ+dGA06ZR+7Auf+s9Q5BM+b4ZXGLxV5CZeTZok5owwYkipnObHa1SaVMazqkARyB4i87bNKqtg== X-Google-Smtp-Source: AGHT+IHo4ZNhANVauNwxWzEb7A8Yx1BfmNoMTz3KMklHj6vCks3qr/BpXSRf0pB8bxSuhkuDJUue X-Received: by 2002:a17:906:694a:b0:a59:e3b8:ab7b with SMTP id a640c23a62f3a-a5a2d6796bcmr1270479466b.74.1715956887321; Fri, 17 May 2024 07:41:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715956887; cv=pass; d=google.com; s=arc-20160816; b=popwc5ac/Nhf3b9OoeuQ9mdESVu7FkkOnnYe3emCIgBYB588GbQsaZL3mkSp4PtM5p 7z0qqq3kpYBfx5W1xHocTB1HZhqx1EtdDEmtZnRQ3GtMmpXBle8lkY2yWpzHQgcy6WUm wlVGspnK8FF24HGY5FzanZ1Zi74zL31f0Os4RKD9sQ9hgTZbk+Gzgx9kdRz//9Cdf0Bu f4I/yL7DyYfCuE4Oj+tgp7pmIMyWlxfk1ubuXNv2EZV2cNesHqnNT0YLk5mzEl61BIv/ cNmgWLELaSTzRQ8mgWnTOvSTaHobVaYSV9o9dzJQj5pbDuwlh+8sm87EHYsyCqP6q4/n 24xw== 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=IpxWOoD3a9X/7OMQ55V6D3OxY47LY/GdGUUaKG9USqc=; fh=BzlYhsZSalR/NHwPyv/VN5a0oJrlm1C0rMz1IM8JA6A=; b=NnJnRWwwPrkZRHKDh2G/xYjXxDPIUGsXfYc6rPzY1jQX4xHRSh3yR0hPSW3BmauNVB rJg55cKwmOz0CfujmnbzNz7BFmjHJIO9fP5vdt9rnGA1pnsvTfA4lJEJGcQ+SLBuIYrH +/ZeioIFIDEzkzaipmMpyVnyO7oZ/pMQI4XSZqVQ98KYgPHvD+LXn3vG0Ay20Udf6Hh6 a85MvVYq4M1ZnZ21yq4+zKpCbs0CG826ScadUPj3RisfR1O/eNlMlLWAtgsYNRrn04Xt jab2FccKMRN7CEmnt4uDbZbIJPABFhHA2W+JqNBs/WQHCHKEy7sXm2UNfTVYq5DRc5oQ 1cRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="FAn/xIrt"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-182218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182218-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-a5a179463d1si944431466b.147.2024.05.17.07.41.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 07:41:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182218-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="FAn/xIrt"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-182218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182218-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 E75691F25263 for ; Fri, 17 May 2024 14:41:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60D6C79F6; Fri, 17 May 2024 14:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FAn/xIrt" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 401F91A2C2E for ; Fri, 17 May 2024 14:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715956873; cv=none; b=tZySEISI7s9miDofFPujimMMMEYml0zaQvcxciLOoFxFHZnqUAWnfdCez+1EP2frCLOeKUaAf9gy/zkwAKFClpSD9YRCFdIcEbodDTFREP81iMUFAd7kd9b8Q7tv/HiKIUHeOscf4akWRp5jQXw8PEOk/UtQn9lVuAUL8UVAq4I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715956873; c=relaxed/simple; bh=rW+AcPY2tzXirbdA/kRmX80I2r8guayIOpJV3BkKouw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YB8xTap4mFRbB8vHyYFoBwrjuQmuLb2pzWxKImse3DvaFVrhPEZZy65VmwTgDZsv9JdvP2k7bYmUElLeptlSFYlCtsRx6m53noYmBRkA2SO+TU+cE8/DfxOf7hl9FNGwjNeDuc/ull4+erpPLRBkrv1BfElJFTQ/fp2DIywH5OU= 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=FAn/xIrt; arc=none smtp.client-ip=192.198.163.16 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=1715956872; x=1747492872; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rW+AcPY2tzXirbdA/kRmX80I2r8guayIOpJV3BkKouw=; b=FAn/xIrtf2Y5HSbGGR5Bxc2aq8zam+W9yH1Wlw0LpUj2MdeJTOY02TrV CgMH6X/VG/kibsGEd52uGNW86ZlL7rWkGv2AvSIiyeHIZp/hhFxnkIDBp TwfcR4eTBM0u/E+WZ7RrNd2B9qt1KrafVehJn7GsY+h+3Q8oxfkYyhE6H igH9nUZUhk1OAglsPHn57nxWvAOlRWd3DSerqpuDAak3ylKCvk3vYKXu1 vkgDabx6NyulxOADeYUOPfCpRdsPapCz3WJQbYX5xaU9okRwLlgY1OIk+ 6laQUEHm0yH2TcS2nedYyDzJfJT8ZvdBo1pj7sUEZCRAxIkFv71GU1acb A==; X-CSE-ConnectionGUID: ybGnZyB5TRSFBfFrKLHaxg== X-CSE-MsgGUID: ++KG4bqcRiCS6brARPXAXg== X-IronPort-AV: E=McAfee;i="6600,9927,11075"; a="11575324" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11575324" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 07:41:12 -0700 X-CSE-ConnectionGUID: 0Uv71e+2R3Oe3+tlO1mslg== X-CSE-MsgGUID: rHDQmHarTUaby29111YBiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="63014232" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 17 May 2024 07:41:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 2693819E; Fri, 17 May 2024 17:41:08 +0300 (EEST) Date: Fri, 17 May 2024 17:41:08 +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: <756f73joovi4i4mwn2r2cfhvxhsbejj4ymz653mi6djkyhzxts@mcnzn2amuunr> References: <20240517121450.20420-1-jgross@suse.com> <2a2guben2ysyeb43rzg6zelzpa57o24ufai3mi6ocewwvgu63l@c7dle47q7hzw> 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: <2a2guben2ysyeb43rzg6zelzpa57o24ufai3mi6ocewwvgu63l@c7dle47q7hzw> On Fri, May 17, 2024 at 05:39:51PM +0300, Kirill A. Shutemov wrote: > On Fri, May 17, 2024 at 04:08:03PM +0200, Juergen Gross wrote: > > On 17.05.24 15:55, Kirill A. Shutemov wrote: > > > 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. > > > > > > > Yes, I know. I'm using the patch series: > > > > [PATCH v19 000/130] KVM TDX basic feature support > > > > which I think does exactly that (see setup_tdparams() and tdx_module_setup()). > > Looks like the check is broken: > > https://lore.kernel.org/all/46mh5hinsv5mup2x7jv4iu2floxmajo2igrxb3haru3cgjukbg@v44nspjozm4h/ Err.. I think I confused myself. Please ignore. -- Kiryl Shutsemau / Kirill A. Shutemov