Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1008080lqo; Fri, 17 May 2024 08:07:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8mfExsR5T+2+plEQBtELoHA6pNGFcwiO0OSjjd1RLuEx6ApgMBWGWz0YpddhUqfa2+3F8Lyb7xRxBfL4qeFkDRZHk/SgStSLzKufRpg== X-Google-Smtp-Source: AGHT+IGXNVKj3cNx2KLWD8N+oOCikYOM1bAqMLyJQ4mVeRd8xDvcN5h6H8MyNnyv2Zo2MUZx+m+D X-Received: by 2002:a17:90a:6886:b0:2ae:6e16:da91 with SMTP id 98e67ed59e1d1-2b6cc97d217mr19640559a91.29.1715958450759; Fri, 17 May 2024 08:07:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715958450; cv=pass; d=google.com; s=arc-20160816; b=LdVfV58t1kgS6BLrjdTeAtx9QzoIXt7CcHTvBRfoMGHGhKg2wd8Qonvrf406V9cqNK HB73a7B6SRfA1nwPy6YAbJjKEIJWU76SrlsxpDRK+qCAICHOWiU/1CN3U8XyzASv+qQp Oqyi3r8G6lR1B+/rljarF+sP6fCwmVWHSVHx0iUiHx3pSkzEXjz8KgeFqD1oBnWzlXZ9 HuqPnd9rQAsex3Ni6FeyE29cHG0/vTfJ7Ttxur9V4uTgbiVHSNWjTJzNfbFFoC5ahjCp foTjCLYMKqwsBSNertnECSiiZhInThqj/pZADU98TOECMEjFj0xIKoVvTJ5pb42OKdoz QLtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=90vcdryrilbiLp2GC0B+j36kxSGrzIvMk03oWLCbJRo=; fh=shh32UKsfqm2cOGE3N5NR4OGNLdCY1UqfcvpUTUsvac=; b=OwtLJkveZox4xMWoC23sbMhEtZ0J6E7ByWvrB6cAJLsGW2iyYqsQKjEP0O9JeI71MK MtvF8fD1845xMaHqoYO+iZK9sKLRdm53RkSknakofU24V4wlXITaykRvtPlyy9Lf32bn mqAJxUJ1OkEFcpsTGAWnUwjCIP+vIpPuihS+1cwU+B+4tYMLIi6atD3FOdgaPr43dC67 HdJTy0Yax4h4d1lmf5lFfE5QW1sbkyLVNHFP/VaohUj3v584Od0aq3V+5c6FyGE01ZAr s22DPbxemPEO1mvhUpZHRTrGPbo4e2/QZsKnztNtr4og8Zca8CioVgnBbeLfOusOvzWX Nf+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=ZSaTH1nF; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-182264-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b671589acasi17582815a91.126.2024.05.17.08.07.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 08:07:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182264-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=ZSaTH1nF; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-182264-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 71A012843CF for ; Fri, 17 May 2024 15:01:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A0E66BB5B; Fri, 17 May 2024 15:00:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ZSaTH1nF" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20A2A612D3 for ; Fri, 17 May 2024 15:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715958024; cv=none; b=Egw0/tTglEB45yYjJHWFozh+sqctGZOZlWcUyDdmayg9TxXNOhqMmWMBkGgwD5pOopfWaHwvBby6p25vmSzNXvJQuL/YxYtqijcPMWuvtXORAh8fgDhW0b+Lh/Lv7EzNPHiJH1kGqILux4EUJEdBU0Dr7GrT2uDx6mhrvkHedas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715958024; c=relaxed/simple; bh=0Nr8Y4+/ZJBHsC4fobZER1qRfUEhosErOFS9K3ZUB2A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=h2gCf4Prq1IrMidSlgysIqgKOv7czC7osdpr84OMp0P58rbgWkLG8vdAp5S+CGXEJfuYbTKGqk0i2z5ChaoyCrK6LT0StKPsrtJxx3klZA1Hm3WuHhASQPN4K/yS8MxHAtfyk5npVXVE2nOOA2FBHo30FC1UA4OmtoJAgu8H0y4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ZSaTH1nF; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a59c448b44aso483118566b.2 for ; Fri, 17 May 2024 08:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1715958020; x=1716562820; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=90vcdryrilbiLp2GC0B+j36kxSGrzIvMk03oWLCbJRo=; b=ZSaTH1nFQtgMhpDBgCZaTp+lrD2iwRsMFVQ9BWXVQGee9YpO2j3tzVretodIfB6ddk 5gq8+/MUtxSTaM1wev0serOA5UxzH6d9MJ0rZVLRkQIX9MV4KtC7GDU56rO8RYtuqbHj FWmqKymDvC+rH7r4jflQKay5yF4dKTqw9BmdNMkY7tTUeBr5kmqwGbbZRsWhgx9TfJAf 5N249nf+AMxWArbBnTZLbHILERYPKaWsnifjYxhEFVhlZxgLDJLwndK/ABLQSYvujSGQ 0EFRkI7KQAwfKB7bzQi5/m9ojYHEr+sclnlSUAuaAVO9eY+S/XvjTULjQ2ghWt6o9WrD MD7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715958020; x=1716562820; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=90vcdryrilbiLp2GC0B+j36kxSGrzIvMk03oWLCbJRo=; b=lAcrNcrAb/foFdGm1ThAuyV3KQ6K9sdxXCybSUzqqXyMz0CecrvDb+OHN+DDUyOzT7 Nlpx5APVbAU/KKxFAD40rXPNzmABmeYBlno8CPdf7Nv9vT0x08ewaGIn3pCV0wOcu1f2 VKdYw0DBqHPHo/8sUIX61RCngGZu+JzNDOr+W12Jy7tVXDH56ZAVCG2Al5M3huh7JrjS 3hhq8sQvO2kFuSWV0TY7fMX06wZrkVUkvSBdg9Gut8GEnFC1yapameiGQTiFQ0zwvBeW FsUlgxdXCXnUSZ1h6WkUAYip6Kw5MC4iQ+fdVm+q8ozf2EwEDlHr8D7ct/fdoZ3o61xN Nfug== X-Forwarded-Encrypted: i=1; AJvYcCUXmXDPuGavoTtfx46wPl8OwXmLCq2Ffa0bKoRO0VnRHCzqvqPBgq/9bDPr09bOgmCkXzosB1jDoFSacSXsn8iaMjP+rPQKSvvsT4zD X-Gm-Message-State: AOJu0Yz7WFamUxUNeY0XLWNSyo5RAg7T7Mx5BQytn3xcV3GBHxjgm6aX kAjvoNQqVJL4qYCc7y7ulYwtd91kOE/VvPHgcKkM7Li8BDtNr1e8Zbqoa4RDqrk= X-Received: by 2002:a17:906:3cf1:b0:a5a:8248:253e with SMTP id a640c23a62f3a-a5a82482592mr717938266b.36.1715958020542; Fri, 17 May 2024 08:00:20 -0700 (PDT) Received: from ?IPV6:2003:e5:873c:a500:6aaf:b7a7:7c29:ae5c? (p200300e5873ca5006aafb7a77c29ae5c.dip0.t-ipconnect.de. [2003:e5:873c:a500:6aaf:b7a7:7c29:ae5c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17894d57sm1131261766b.73.2024.05.17.08.00.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 May 2024 08:00:20 -0700 (PDT) Message-ID: Date: Fri, 17 May 2024 17:00:19 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v19 039/130] KVM: TDX: initialize VM with TDX specific parameters To: "Kirill A. Shutemov" Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, 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, Xiaoyao Li References: <5eca97e6a3978cf4dcf1cff21be6ec8b639a66b9.1708933498.git.isaku.yamahata@intel.com> <46mh5hinsv5mup2x7jv4iu2floxmajo2igrxb3haru3cgjukbg@v44nspjozm4h> Content-Language: en-US From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 17.05.24 16:53, Kirill A. Shutemov wrote: > On Fri, May 17, 2024 at 04:37:16PM +0200, Juergen Gross wrote: >> On 17.05.24 16:32, Kirill A. Shutemov wrote: >>> On Mon, Feb 26, 2024 at 12:25:41AM -0800, isaku.yamahata@intel.com wrote: >>>> @@ -725,6 +967,17 @@ static int __init tdx_module_setup(void) >>>> tdx_info->nr_tdcs_pages = tdcs_base_size / PAGE_SIZE; >>>> + /* >>>> + * Make TDH.VP.ENTER preserve RBP so that the stack unwinder >>>> + * always work around it. Query the feature. >>>> + */ >>>> + if (!(tdx_info->features0 & MD_FIELD_ID_FEATURES0_NO_RBP_MOD) && >>>> + !IS_ENABLED(CONFIG_FRAME_POINTER)) { >>> >>> I think it supposed to be IS_ENABLED(CONFIG_FRAME_POINTER). "!" shouldn't >>> be here. >> >> No, I don't think so. >> >> With CONFIG_FRAME_POINTER %rbp is being saved and restored, so there is no >> problem in case the seamcall is clobbering it. > > Could you check setup_tdparams() in your tree? > > Commit > > [SEAM-WORKAROUND] KVM: TDX: Don't use NO_RBP_MOD for backward compatibility > > in my tree comments out the setting TDX_CONTROL_FLAG_NO_RBP_MOD. > > I now remember there was problem in EDK2 using RBP. So the patch is > temporary until EDK2 is fixed. > I have the following line in setup_tdparams() (not commented out): td_params->exec_controls = TDX_CONTROL_FLAG_NO_RBP_MOD; Juergen