Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp545117lqo; Wed, 8 May 2024 07:41:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWb6BwBIUpOQzc4gFxBb9gny34vAaqxjVj5waOoAwSTY9z6sD/4U4cxMMsrQzcm+NGNNcGCKdfgaAmYQ6v7AzAROXT+sxv2zm61Bi2v7w== X-Google-Smtp-Source: AGHT+IG2K+3Gfb+0n9/fG0Lu2lWqBMgBzrr09vQFYBWbtUH6OKqwggO76qoxux7lA2WugJeqex/P X-Received: by 2002:a05:6a21:35c6:b0:1a7:3b4b:4153 with SMTP id adf61e73a8af0-1afc8dc8a0amr3123206637.58.1715179293629; Wed, 08 May 2024 07:41:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715179293; cv=pass; d=google.com; s=arc-20160816; b=jgtMBX0BRuFvTgov/5ZjnLEovfM7+WWUblsIz9HBmC2d3EsY3e75d4jv3YHhjbFrWj GaUjc/V+qm9eCX1AsjduQPwFjmdhMwYhJemmXWF9cyWRjndpMDrvQv7kRT+5EbJtB5WH SUZVJxncYDvvlTKq4eckoh987T3Gv93Mw4OYmNwGa2ETDYiaLWdihc3XkfF6d7hcaUdO AdHM2jG4qjtmDUsBtv/oSZP5CfaCBhMn34Kka8h9NoQZlADMiwzoTEQoB/i+w3VMfR4+ /dHaTi1FAiv4fHJBUWFGXt/JD5iYLdbRZr9KCycR0/7F0CpKD06aaRKEvcfufXug8wAI TWIg== 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=5RcWN2WrSwXdTO88vEMTaGe9Rxg692ER5j0jmQd42is=; fh=FTu1AUymr5rnJ1CmPHaCIXv4HgIy4nnfEgC+Cl+rMlk=; b=DEzukUGyr5XYDpvudQlR23opWvgmTWEPDgbuRtsNOyGsa6wxOPm7fcbAvtQkvTqB9S i2bOrOECoGtnceP1W2wX2G42wSY2OBw4VUGEm4epY0EOMmM/1k4BGTdv0Dw01Dq9n+oG sSOBJK27qZNee1EZwm9K0IBHFdfPr3ty8Ktx0w9bbpLGJjZRuSyV6TyzWkektQaKtuYs u00uRF5lucmEMLAVd118pLD17l6I0kL72u1SgL1V0mU+vZ0/Z/XcMt2/IqLAD95/gs/J 1Gb+Z3tGKANEvUXjoX5ND4RlJ36PNJVB2mqwBBAATU/KLnyOOOXNYQ9cOr3DLAOXa8XV luXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uPtt3h1P; 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-173420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173420-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m9-20020a633f09000000b005dc87994572si9979353pga.346.2024.05.08.07.41.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 07:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uPtt3h1P; 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-173420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173420-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 0354C288342 for ; Wed, 8 May 2024 14:38:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B23B126F06; Wed, 8 May 2024 14:38:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uPtt3h1P" Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.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 672B084E14 for ; Wed, 8 May 2024 14:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715179095; cv=none; b=O6NR10f5rkX+OZt7JJJJPLDDyStOyfndakYGL2qgry64ZLRU/BxLKCq0RgRqZI5Hf1g2tGfDq2BNM6DjKWlK/jWhwJ1cWhbnfJw7Y4GWjG/IuqjvCLhWr1JojAERQCm+jgbGhzTGhCwpFR1nOa3PKvZRZkRrnVn8gJbPQSn9bSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715179095; c=relaxed/simple; bh=aFboWOrm7H2FhmOYJG+9bfDnrcpnZ8PDxm7a8GEEJ4g=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kbPhN2p2RDFU2Vk7IxgDz6D6oD2bhbY2WacF2Tkb+bUJzSc1unh6Tm+5IVCFEO6TpRDo0QzG/n489S7FnwBzek44RkAEFyjryectwlp1hyIqzvRVCYuZ7DF/uxyK+pYnFNnxDnDsDHQTus6KG8BdMcHuXEKM574A8+9ScOmDJ2k= 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=uPtt3h1P; arc=none smtp.client-ip=209.85.210.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-pf1-f202.google.com with SMTP id d2e1a72fcca58-6f44b2e0bf2so4189246b3a.0 for ; Wed, 08 May 2024 07:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715179094; x=1715783894; 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=5RcWN2WrSwXdTO88vEMTaGe9Rxg692ER5j0jmQd42is=; b=uPtt3h1PkOXIdJcvlsb/xZ1fOtiQrUwJ0XHavUZuG4P0COu80adKXoIuF5A4NZdETE qJBtAZ1A9iwWBXKRwBo8//GWhu08ddvLcB2Z1MDDdVRdmfFD/AzGmjJl1M5XCya9RI8m pwIAfQLmE3vFVgGTJsdQmMowIMt0dgULbJixJn4hAQt3dnQHoFpqQ04pcxrh3z/N16ga 9qPyCc6+KnlhrGgAMu2fY+JwoBLOPq/a05Ft77aJgavaA6ecZACQQ76DV/lGGZ906dkp bnoH1Vwsrh099J84CJvvsldAM75/N7RLnluJ58QoJYi4l3b7rB0O8eHzr/1SHgle9s0i 5O9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715179094; x=1715783894; 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=5RcWN2WrSwXdTO88vEMTaGe9Rxg692ER5j0jmQd42is=; b=IXrDhuw1Tha85BntjKJ4FzBGKkP2QgPq5Uc4AKJ6eV9Wa1qe0LQ7y0oh+0/jEQ9I78 05KVYYIakVRGvDfbsLIGuSD78iqUMZvUGDwzWtFVQELdmpje4xeCcOEU8dAVuFmJeIf3 3KyqBt99og/m5RE/+DdWd1p2GAZJfx8jtxQAyEcfDMhFv80ZXM0RLogJ2wuH3H0Syr/b o8hKKOpehupXPrZT/l1q6gw/ERjrnbNKoxXiii2dV0Q4BgmZJomIuSDX1CZwUX5Axbr4 tpBa7TMD6qiaQC2ENz+rLIcUydSVksoCUJRKq3JWgHsGgkj4mxvdxt0anmAOr3O/rzJZ yzIg== X-Forwarded-Encrypted: i=1; AJvYcCVQLgYI5ysuHZ+RbN9EZ4ozL6O3tgB2GRlxX5gWSuu5Q6R/ZKdH16jxd733JV/i68rezg2hohLTIGsZjPlVZIW9zxVqQEnkouBZXtA5 X-Gm-Message-State: AOJu0YzWiLt1Jyx7Mhkw2JPBNuvrnFYmEUbCRswMdRhcO/RXlckJacrO qKCEmnYA6G+fRu/fz6EMcYC8kV6zfQlSkE2orarXNOm0aN3yp8tkaboB2m8Zdk0XoY0EayuNKp0 f4A== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:1414:b0:6ea:ad01:358f with SMTP id d2e1a72fcca58-6f49c30dd08mr57761b3a.6.1715179093524; Wed, 08 May 2024 07:38:13 -0700 (PDT) Date: Wed, 8 May 2024 07:38:11 -0700 In-Reply-To: <2c8cf51456efab39beb8b4af75fc0331d7902542.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240404121327.3107131-1-pbonzini@redhat.com> <20240404121327.3107131-8-pbonzini@redhat.com> <43d1ade0461868016165e964e2bc97f280aee9d4.camel@intel.com> <2c8cf51456efab39beb8b4af75fc0331d7902542.camel@intel.com> Message-ID: Subject: Re: [PATCH v5 07/17] KVM: x86: add fields to struct kvm_arch for CoCo features From: Sean Christopherson To: Rick P Edgecombe Cc: "kvm@vger.kernel.org" , "pbonzini@redhat.com" , "linux-kernel@vger.kernel.org" , Yan Y Zhao , "michael.roth@amd.com" , Isaku Yamahata Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, May 08, 2024, Rick P Edgecombe wrote: > On Tue, 2024-05-07 at 17:21 -0700, Sean Christopherson wrote: > > > Can you elaborate on the reason for a per-memslot flag? We are discus= sing > > > this > > > design point internally, and also the intersection with the previous > > > attempts to > > > do something similar with a per-vm flag[0]. > > >=20 > > > I'm wondering if the intention is to try to make a memslot flag, so i= t can > > > be > > > expanded for the normal VM usage. > >=20 > > Sure, I'll go with that answer.=C2=A0 Like I said, off-the-cuff. > >=20 > > There's no concrete motiviation, it's more that _if_ we're going to exp= ose > > a knob to userspace, then I'd prefer to make it as precise as possible = to > > minimize the changes of KVM ending up back in ABI hell again. > >=20 > > > Because the discussion on the original attempts, it seems safer to ke= ep this > > > behavior more limited (TDX only) for now.=C2=A0 And for TDX's usage a= struct kvm > > > bool fits best because all memslots need to be set to zap_leafs_only = =3D true, > > > anyway. > >=20 > > No they don't.=C2=A0 They might be set that way in practice for QEMU, b= ut it's > > not strictly required.=C2=A0 E.g. nothing would prevent a VMM from expo= sing a > > shared- only memslot to a guest.=C2=A0 The memslots that burned KVM the= first > > time around were related to VFIO devices, and I wouldn't put it past > > someone to be crazy enough > > to expose an passhtrough an untrusted device to a TDX guest. >=20 > Ok, thanks for clarification. So it's more of a strategic thing to move m= ore > zapping logic into userspace so the logic can change without introducing = kernel > regressions. You're _really_ reading too much into my suggestion. As above, my suggesti= on was very spur of the momemnt. I haven't put much thought into the tradeoff= s and side effects.