From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 68E9629401 for ; Mon, 6 Nov 2023 16:04:20 +0000 (UTC) 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hXv6FZ6w" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-5a9012ab0adso64335467b3.1 for ; Mon, 06 Nov 2023 08:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1699286659; x=1699891459; darn=lists.linux.dev; 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=vBcfSXW+7b0RYZr/CwodaGuIC1t2rSK8z82L7NdJqdg=; b=hXv6FZ6w8ZG2YeweyxC8SjGB6Iyoh82NIqqLvrFvOpAN/7TgByY4mwcaKYDnQ3troC OcYzzISJjwOKtn/2Nj2EFa5OtYR4zi1PBakKB7NeummU+MEuRnqtsdhWqCWHMjKG6V6x AXockVY+8TMUhJDMBFoPWC8cg1m0sdGAF0qJtpHcgtKNSyP0dq5+wkRyrObqAiuriDAm dBwcGvvvsgQjKXVBBJ8TMwQF/qlvoYPBOmAW17SxiIICHPnD7jbjHobM7poejlio/lq1 m+DUB54fGoMB5ULLrwndsAFyYr3LnIX2kA7Q4FJVSBxtvdkD5XWDP60OxOHEjTevk2u5 XT1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699286659; x=1699891459; 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=vBcfSXW+7b0RYZr/CwodaGuIC1t2rSK8z82L7NdJqdg=; b=b5KjtxPHp5ca8SKqo1Lnoh6aT3JjUQh3/D9IxAo88wk3H6BySmmJ9NUBNn2kjGNaH5 WqVVIjxAssgvfJ1ppOm6eez3bss/ycAEBlw8T7Lf2uTwAJPetcJAZdsd0ZhKUiCIFboZ HB4SPGhayA0W+xZnxsIGbwGpO/Wj52jCuuzxzgMLVfnofi4tUjaLHelZ5ny/PT+InCie EHGdmjg8ocGNjlhYdBbIwIxY9+0nTx5g5q2fjbqZS4swo/kP6XAckKe4XFeS2pd+FAg6 4AkbGCv7ILtvoUMDrIQgDDX+yTPtTJjBaqbdhfFfk7BG/EOl0QcsRMFfWiBA3Y9AO5Bs HfHA== X-Gm-Message-State: AOJu0YzkbFI6kayHRpLrwCsV+4WvRsMOypyWUsYTknlvyb330xFK1fIP ypaDsFH5El4H9sx7mEDpdKPF3cbPIqQ= X-Google-Smtp-Source: AGHT+IG4M/eznhqFxpL/eWUumIXP2aANvxiOg95OzhM2lh4aiDVuodrpXWON7UbLhWxQPiRYqqCoKKt9NcE= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:830d:0:b0:5a8:6162:b69 with SMTP id t13-20020a81830d000000b005a861620b69mr214046ywf.3.1699286659321; Mon, 06 Nov 2023 08:04:19 -0800 (PST) Date: Mon, 6 Nov 2023 08:04:17 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231105163040.14904-1-pbonzini@redhat.com> <20231105163040.14904-28-pbonzini@redhat.com> Message-ID: Subject: Re: [PATCH 27/34] KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type From: Sean Christopherson To: Fuad Tabba Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , "=?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?=" , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A. Shutemov" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 06, 2023, Fuad Tabba wrote: > On Sun, Nov 5, 2023 at 4:34=E2=80=AFPM Paolo Bonzini wrote: > > > > From: Sean Christopherson > > > > Add a "vm_shape" structure to encapsulate the selftests-defined "mode", > > along with the KVM-defined "type" for use when creating a new VM. "mod= e" > > tracks physical and virtual address properties, as well as the preferre= d > > backing memory type, while "type" corresponds to the VM type. > > > > Taking the VM type will allow adding tests for KVM_CREATE_GUEST_MEMFD, > > a.k.a. guest private memory, without needing an entirely separate set o= f > > helpers. Guest private memory is effectively usable only by confidenti= al > > VM types, and it's expected that x86 will double down and require uniqu= e > > VM types for TDX and SNP guests. > > > > Signed-off-by: Sean Christopherson > > Message-Id: <20231027182217.3615211-30-seanjc@google.com> > > Signed-off-by: Paolo Bonzini > > --- >=20 > nit: as in a prior selftest commit messages, references in the commit > message to guest _private_ memory. Should these be changed to just > guest memory? Hmm, no, "private" is mostly appropriate here. At this point in time, only= x86 supports KVM_CREATE_GUEST_MEMFD, and x86 only supports it for private memor= y. And the purpose of letting x86 selftests specify KVM_X86_SW_PROTECTED_VM, i= .e. the reason this patch exists, is purely to get private memory. Maybe tweak the second paragraph to this? Taking the VM type will allow adding tests for KVM_CREATE_GUEST_MEMFD without needing an entirely separate set of helpers. At this time, guest_memfd is effectively usable only by confidential VM types in the form of guest private memory, and it's expected that x86 will double down and require unique VM types for TDX and SNP guests.