Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1639406lqe; Mon, 8 Apr 2024 15:36:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWM36JM8WoEv2S7xR3pFVnOefNn1WHFZANbEmdtk8iX1XjzjPYa4xYsC7mLpg5v4cPagU8IOWSab0q2+CnWUviFc+ZNcNpZKPs0ZaXJ4g== X-Google-Smtp-Source: AGHT+IEM+VkG7pxGlg16PtCqdtIRHs/tS3bxlOGpEx/M6wgqO0moEdfIGxlh3fZbEoqskQZOYyrF X-Received: by 2002:a05:6a20:d707:b0:1a7:5fbf:3774 with SMTP id iz7-20020a056a20d70700b001a75fbf3774mr6863151pzb.55.1712615792653; Mon, 08 Apr 2024 15:36:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712615792; cv=pass; d=google.com; s=arc-20160816; b=WRnWmaoP8h8o7x+LE4u4j52tyPR9X5fC/C4kEhf9Rj4P/GeM2HTVBrF3SM3jxVZong LoUwYRhXH6bGIeqtLDA9LTX67KNNPAUy4qoxiaPoCveEXjf//IoeL0jraVUujg6P8B5A Bstv7XI9sakfks6QOXSFhuQTiI9T2vevF0fH6ccGZR9Gq1gxJDnm+vxDmTW4TQDAMob2 xoubNkv/RSC/2Pl9YsgdhZx7zfREn6p8YNLT3J+qgSnCMfIP4fSRR1Br+3ZR3pf/JXz8 n5cBBY/A5J3A35jBkQrV0poW73sNi7/v7MvGt0pLRnGPFT6mBiRJPMmtM1EjZzjYCfgp xhkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=H3IyoUWCaMuOsrSmdtiAaHOAeX0T2/iesX+PuEFhG/o=; fh=jhwR9PKXUGvt3n3dt+SvCJsbBkC95Sqp5pcGdzRSago=; b=WG5aQ5wivO16KE2/O+H/z4f4ptWpHCT1fhScx1b05pi1eFKvurypYf1bUfV7rB8QKS +A7BiExaqfnA8bpA7ZwiWbYnrs0p3NiyWAutywV6ZGI5JlJhZrKi6HzSd4zoSm32hTpb RRDOVvHVlbHxyAWHXZu6wnBYeXq2Gj2Ji/VS+ewJMt0xQZ8fkFsw9apY3u1VURt0GYHh Qu6emGNZeREhD5By5cHG6N+dyEe43JtJsE1wDb3PEaw5mtGwLKlG3dUtfZTQzvWpE0QI 4xb1L7C40eBOan/JaSBRyu1lHDJ/8kCHH+XBwkYY4KOENiqlxCOjymRjX/R+BSf+ovzZ 9nFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=duLf6SKb; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-135977-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135977-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id hk6-20020a17090b224600b002a53367602esi2269404pjb.176.2024.04.08.15.36.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 15:36:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135977-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=@google.com header.s=20230601 header.b=duLf6SKb; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-135977-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135977-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 547F7282084 for ; Mon, 8 Apr 2024 22:36:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA28252F95; Mon, 8 Apr 2024 22:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="duLf6SKb" Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 93E7817745 for ; Mon, 8 Apr 2024 22:36:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712615775; cv=none; b=Qfk7txuCsWPnkXCh/aBBxEwLMb1zMMFzhvtoP2fcsqtgOBsomclN54/Zz4bEdQnJudpqmX/hmPpN9SG1l5Xyjd8VStnCFnRjP67VrBLs1XFW39K0uYG3jWmyA+8Ng63Ulu2z4DR74bdinSMrtF+RAOJLWbiPqYdWSWNfjVyg6MI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712615775; c=relaxed/simple; bh=wd9auWj6neAH4mwPBANg9G0rtjJL6aqclc7lajDKiYg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hma8U7ZKjL8EW85naVTW3zsSiHR8tMk1Q9Ihndpysa0ffTZuTnFLfV06//6h4rrrL2conQtN74/Q9uTHr8y0MkhqJz8l9N6LF2tSqMnohxlGtKLaQ5Hyiyw4k6yieWpPX4mXcJNbqrZ09Af742EJuAX1A4ZeZ5rkOJe+tWGv8Mc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=duLf6SKb; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1e278ebfea1so46377745ad.0 for ; Mon, 08 Apr 2024 15:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712615773; x=1713220573; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=H3IyoUWCaMuOsrSmdtiAaHOAeX0T2/iesX+PuEFhG/o=; b=duLf6SKbk9ruf+aEZLiUtDpW0RGBgbPH30ZOBaR1wAaybjARXGQUQ994/OaZmZlOid A18DKxs3nd0A340wmKgBZtU91VKnlhAw6uVCEhX1Iiu5EU0Nki9wRrrackSe5N50PZXq C7t6A8xTtYI2WeJB1AgNG09I5lHnzle3OfURmBgupr2/J9/W6tePa0lyMdePy1a5gdWZ L+Dm9Ky8eH7M39zwMiSmCiB2dnepn7Az6sqQ5wHDaSJcm5lW9nndKlUmWlRcRsrLNgri EYMqD9BzrRyOC00KTabTi3ZmbQCuu9Vk4R++CnXpHRB7ijewPsQs7BJNBiaswKhD8OKN GN0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712615773; x=1713220573; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=H3IyoUWCaMuOsrSmdtiAaHOAeX0T2/iesX+PuEFhG/o=; b=U93hJ3sMsyomfyDRMuDgGR5D6ge2X7DBWphxFFchUmKkRU8Dk8RLfS50Yz2oVLEX1B ePAo9NHgWE6pdjtZOrZpUFmdN0b9nc8jw3sWrbWofULpDwUDHex58Qp5M4PUJc1tkv4E qM+WgYsT9L3jRy7fUIITO1ywiPA5TkYft/62bdEFnxbLrYiTuVehWfrmAKOab4LtNal1 TWqqAtIJIF7MzzP6wqzotb1fTdutZP8+OHT+pHvVXS/CbxVp91cRy42DSukimzQqI8ar zXoIL+HdmgiQuSPni15oxXuQlcWYMOrX+J1JCPkrdbFWPWc2iKVpqdTuLyOhsrHc5fyV BHcw== X-Forwarded-Encrypted: i=1; AJvYcCVk2V9bbupCFl8n3bHc582GPxsSejK9fHnHIeEJ+oVch6TMl6Jjgj/D2gjlrb4CL3rlF8akaWsV96rJY6NNdpOJyTIeHh25DFfFj0oK X-Gm-Message-State: AOJu0YxpFntcLan6Ac6qX19kH1OEeex/QvcDjhuivmkA/aK9AbXA02yA CHP70HRb2Des+l0wWSHzbbuy3I7DpD4Urxi+A+a7nrYvshmgb9qAdZtE3TzWUgwXjEkTQyRzNXW yDA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:ea01:b0:1e2:b75e:37b5 with SMTP id s1-20020a170902ea0100b001e2b75e37b5mr352811plg.2.1712615772902; Mon, 08 Apr 2024 15:36:12 -0700 (PDT) Date: Mon, 8 Apr 2024 15:36:11 -0700 In-Reply-To: <5faaeaa7bc66dbc4ea86a64ef8e8f9b22fd22ef4.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240405165844.1018872-1-seanjc@google.com> <73b40363-1063-4cb3-b744-9c90bae900b5@intel.com> <5faaeaa7bc66dbc4ea86a64ef8e8f9b22fd22ef4.camel@intel.com> Message-ID: Subject: Re: [ANNOUNCE] PUCK Notes - 2024.04.03 - TDX Upstreaming Strategy From: Sean Christopherson To: Rick P Edgecombe Cc: "davidskidmore@google.com" , Xiaoyao Li , "linux-kernel@vger.kernel.org" , "srutherford@google.com" , "kvm@vger.kernel.org" , "pankaj.gupta@amd.com" , Isaku Yamahata , Wei W Wang Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 08, 2024, Rick P Edgecombe wrote: > On Mon, 2024-04-08 at 18:51 +0000, Sean Christopherson wrote: > > > I'm not following the code examples involving struct kvm_vcpu. Since = TDX > > > configures these at a VM level, there isn't a vcpu. > >=20 > > Ah, I take it GPAW is a VM-scope knob? >=20 > Yea. >=20 > > I forget where we ended up with the ordering of TDX commands vs. creati= ng > > vCPUs.=C2=A0 Does KVM allow creating vCPU structures in advance of the = TDX INIT > > call?=C2=A0 If so, the least awful solution might be to use vCPU0's CPU= ID. >=20 > Currently the values for the directly settable CPUID leafs come via a TDX > specific init VM userspace API. Is guest.MAXPHYADDR one of those? If so, use that. > So should we look at making the TDX side follow a > KVM_GET_SUPPORTED_CPUID/KVM_SET_CPUID pattern for feature enablement? Or = am I > misreading general guidance out of this specific suggestion around GPAW?= =20 No? Where I was going with that, is _if_ vCPUs can be created (in KVM) bef= ore the GPAW is set (in the TDX module), then using vCPU0's guest.MAXPHYADDR to compute the desired GPAW may be the least awful solution, all things consid= ered.