Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp901189lqp; Thu, 23 May 2024 03:38:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVp5ceUUYP6POCKQYux7D+EnzxAdrLZz4E14q2Tk2L42uTYb+ykEAgMiIJMeVnkVNCjJ0XraPPdzAwicePOF6lu2xo7foTee7Bt+Ko+WA== X-Google-Smtp-Source: AGHT+IF1jkV7giwMxdWhkKpjrGV++UM4CXVs24QYKOFts92dqEo8lKhdxexaajWLqdB3OS00Ksjw X-Received: by 2002:a50:9b12:0:b0:572:a723:f1f4 with SMTP id 4fb4d7f45d1cf-57832a01b31mr3227628a12.3.1716460684806; Thu, 23 May 2024 03:38:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716460684; cv=pass; d=google.com; s=arc-20160816; b=ZbLbd+iacxly9mfTzwVg+rXS391HIgDf+uWsiAEJscin6xVibtnmYUTUrxE3KIb2jS 02/MwSeCIcxTi9zh2S/bJ0cUTcAHuFwINpbe7RZwh5u0CFeY2TAz+TIuLiZer5tVaJzS iQNZwVvFGPD0B6dUTZXVE0HS1MEULCxMzRYMKO+F9EQLS6epy1PDTBs/yhgYFWhxBE5P 5ARTUCDm+9X1DmephbZcKQIw1H4M9UeIFKiz4xYF3osqHJ7Sn3ZsfcEAmZ4kRVjlfI1h I+pCxJQ2j214APgovXgEksBH5k9ZA+JDBjv9ZJeC76zaI8VxVT+5pw3xun9jP18/0pWl dcTQ== 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=D0kV23LycN4hVbBu97CSf0VaI8PE3Pmkshp0J0gEaj8=; fh=MH+NSBM4yfAsmO7te+JEwagzQAT4R1b10hVk893nHDA=; b=S9vce15AvEAfu8VMQcFnv3v55ZzogXQUkrqsNQcfxvWMcP2tTBZM9+Otm1Sid15hmr bPlftgWh8cUv13vdOM5SvcWqXGyMetQFvDIOceHg7NGKUC8Ih1133OWbWEvMMcePMX85 MZeA3xzbYmiaBq7Ej1udKa9Lmrygk3R0ZQZ9gxWkb3eFVT4SMjWz4GCfUMtgiHdmxnCY ZYcSgIegdgrns8KeeIroC2XkV6ANTMhPhs8rrrNtANS25iaiE1VzLVtGWw0dcseO4OoK Q6qe1mIaNhi0gABXndcY5ItEJ+DFvtmqBxVepGpCG9+qnfk3QzdSwFnG1it3AH3CqGIM e3Yw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=DO7urK4D; 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-187342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c36d63csi15478353a12.541.2024.05.23.03.38.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:38:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187342-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=@suse.com header.s=google header.b=DO7urK4D; 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-187342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187342-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 616CF1F24086 for ; Thu, 23 May 2024 10:38:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D01E91442F7; Thu, 23 May 2024 10:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="DO7urK4D" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 D2C2D13D286 for ; Thu, 23 May 2024 10:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716460675; cv=none; b=hQ5fsvtqI+spvDG4jvllJVkrhbT7vtgZ99qYNlrYk+wDodduf6e2GRvLGvdrUTXyTP9TgfXi18CzBRxZxe/RIoj7+3vS4LJ6QhyUKFpPZfXneLZd/CFcPVcxfv31z2lDUdNN6Lo/Ir7U6yLmPmFD5Ak3XD3MP99HRabamRs848I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716460675; c=relaxed/simple; bh=AwGWt421U9KLZgTiRjEhxg/oYE8y8Lp33lj1qoibEKo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cV0QB30QiuxtrrsGET+Uz3qV/ws/hwMC8DeA8/9+aCSrCPfCiUoVGK/7Z8bUdzbFpeit/R/+xTcBGUmS1y71IwndUS42R4KaRrgbwsNtD5d37v/N6GNgXfscNgSTzlGMXrvFGD2R+TJIM4eQXuIB9reA83C6pQ24ahqeUPM8YXM= 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=DO7urK4D; arc=none smtp.client-ip=209.85.218.51 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-f51.google.com with SMTP id a640c23a62f3a-a5a2d0d8644so1002799166b.1 for ; Thu, 23 May 2024 03:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1716460670; x=1717065470; 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=D0kV23LycN4hVbBu97CSf0VaI8PE3Pmkshp0J0gEaj8=; b=DO7urK4DwQ3v8YNMbjJ3fmsL5di7v86W2BNOmE8YwCjFFIrRVeZfwIrigByGc6FhUo eL4osXapHZEyskzoVTbp4kcq9zigu6erChQE+50UJSTbzViJEfe5Po87fYaRaH6enLg3 qoj8I3pM5+6GooEuKgr4Bm24+ujCvDgqGzW/yVBL2fg/BY576vIPS13+hG/MtfLhROgm HS5jfRMhShzGi9kPQBvI3f2rGcAvwr1tq6SX349VOn1bpsDWcveZ+xjbTtyWUnChX746 XrAJV6O5tvWayb2/t1YY8eyKeFHdQ+C2tcAkiowKISloQg1p/LyMK3g5i1yFMvblscVV zHIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716460670; x=1717065470; 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=D0kV23LycN4hVbBu97CSf0VaI8PE3Pmkshp0J0gEaj8=; b=AMDFASKuhaM7ktujRl0WfWrw6WAIP1fCiRprfGF4XLpf9xfLk9znjvYI1FVyt77JSX pREFRjFtvunQlMxBbHqvFuAlLaOy9BqMcap7+81DVAZxmPreJr/7U8Cg/94CDr2kahmj TK0v9UsT6xEuoGVihm70HVoHEE/ifkHY9DcWOw2zMfpHhQHxYdVVYmNbVWgUSq7n8etE +XULQH17n6ejWTeBZAXMFe7ESE5pQW1hqX0JzWUheTCCwP10Nibbhg7VZ42/6qZsj9NP rF5Ky4EPyoS/W5Fw2gCPNDTeTk54QdcU9G+ykq9D9hi5uwqjEBCTpjRi6zysO4IS8g81 s1uQ== X-Forwarded-Encrypted: i=1; AJvYcCUYlo5s19iX3nLxLORQ35LiLoaAkKkOnnVhq8G4CCEaGW3Cq8vCkaloFjeDJAF4izM5BPJUIwWGo6VUhwB6rhfvE5Ky8eie0NkQ3R8R X-Gm-Message-State: AOJu0YwVsERiVMS6pfQXXiKCfany1jYgT/k6idM1HJKC82qsiyHA261V sDXFGfFVQ0g8WS3HW4lCr/OPQDEGTZ15WunZvFRuXEvIPLh2djVMgorZ9UGOEQk= X-Received: by 2002:a17:906:3b87:b0:a59:c28a:7eb6 with SMTP id a640c23a62f3a-a622805efc9mr323362266b.24.1716460670211; Thu, 23 May 2024 03:37:50 -0700 (PDT) Received: from ?IPV6:2003:e5:8729:4000:29eb:6d9d:3214:39d2? (p200300e58729400029eb6d9d321439d2.dip0.t-ipconnect.de. [2003:e5:8729:4000:29eb:6d9d:3214:39d2]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a691870absm1456382566b.124.2024.05.23.03.37.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 May 2024 03:37:50 -0700 (PDT) Message-ID: <23559fcc-97ab-47a2-8832-699c05c4a387@suse.com> Date: Thu, 23 May 2024 12:37:49 +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: 8bit On 23.05.24 12:35, Kirill A. Shutemov wrote: > On Fri, May 17, 2024 at 07:25:01PM +0300, Kirill A. Shutemov wrote: >> On Fri, May 17, 2024 at 05:00:19PM +0200, Jürgen Groß wrote: >>> 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; >> >> Could you check if it is visible from the guest side? > > Jürgen, have you tried it? > No, I'm not yet at the point where I can boot a guest successfully. Juergen