Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2235400rdf; Mon, 6 Nov 2023 08:17:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0gp77B/iYLaS3Z+1O+8U8lVsXJqDNnqG3RHXAXOP+8F7FzhZIKFNH2R0cbEDlYDYvNGuK X-Received: by 2002:aca:b05:0:b0:3af:e67d:8295 with SMTP id 5-20020aca0b05000000b003afe67d8295mr33764365oil.40.1699287474056; Mon, 06 Nov 2023 08:17:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699287474; cv=none; d=google.com; s=arc-20160816; b=BJAZwZBorqQHHN8nlkRGE/dUzq6pMptuZxzEVG8TFcFNlDBOLFF5V+nn8BDT4MW/Ed oglliMcVivxFtiyUvNsaf4QCGVpffsm/jEI5No7KmqcD5nkMJuLCpIk95cTIVG2V54eP q8n8uAb5DGwhplts29WxOorX2F8dSg4InvnL4m/TFhkz0tAkrp1gJKZ4fWUUu5PRp3nC t79cUtjmG923NTXgusFYI9+90DkaVeApHP1kGITH2xFq6sbs0Cz2Pub4DzGvyliVsBM0 1IGrHsrlBuhjAWLyBhbhz8vU3XxxOZMm6Uq6kLPM5RZwE/5uP4NgmfnGWeVxoxCeXPHQ Pa3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=lUV8zKIdpTV0f8ZMhx633GQ2l+XRSBNMcsvYJoEfTx4=; fh=/miUcVpYH8nMZuF+OwSqBCUvyHUtCx9XxINkNV+hgqM=; b=yue3FfSet3ch6SC525LJF7NnlgHcOEZ0eJUKZCHe0IXcdyJFsJGfVgCVELVIkwocuh fnRSA34FEqF2aXq91BkCiFCNlHcd4Pl8T7wGqgyLfwtMJpxJYxCaCFjzW0WJm1qDb5YL st/NjL5emjoN4xQdxFHQRv8/PCvrF2iqk6IBad01cHGCLNFY1WFq45WmB8Hv4LhT1GY5 7IUw1XtOcv0gNQZ7fB7He0QwlLygoFoL9a9nYijavnZde3RQNQkZEI42SFjjQAqya46c 6mGSyXaYJsW7fnPD1GecNdVXLcFIRsxXJ6zWAI8rGEUP7n8yMIuN6NJ6j07Jmlc+qHyh To6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3o8M6NtH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b18-20020a056a000cd200b0069342aef90bsi8535394pfv.3.2023.11.06.08.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 08:17:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3o8M6NtH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8FF1A8028843; Mon, 6 Nov 2023 08:17:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232345AbjKFQRv (ORCPT + 99 others); Mon, 6 Nov 2023 11:17:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231995AbjKFQRt (ORCPT ); Mon, 6 Nov 2023 11:17:49 -0500 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EEF6D47 for ; Mon, 6 Nov 2023 08:17:46 -0800 (PST) Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-66d190a8f87so30187276d6.0 for ; Mon, 06 Nov 2023 08:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1699287466; x=1699892266; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lUV8zKIdpTV0f8ZMhx633GQ2l+XRSBNMcsvYJoEfTx4=; b=3o8M6NtHBemcOm+WImExN2FSkf9rn450dHn/P65eZjlIW2aCrACWXBwOyfiWzwA0QA df03rptJDJdDFyoyBXZQMrx8x+zr4/6Yho5Vq99CZOwdBOT1kOO4ZrxBi5VSfG7/g+i2 42W6TbW7eDdDtEnIrogMhtX8k2PHMwCNFCtBhwTOp5ZndPZSh88xacBL38yksWV4tbmd YssaPajDRIXn9V+UEvZla/fNVG9vrw3IAHWjNnhcIL+B6UWMtixB3zKHyQ0J9uJjpjLT ADMfKVdRzDOZC3f8Kf0ejMMB6+1chRy6YFVtxYxOc27YRb4a/ZBquILr8L4z6bW4Z1s9 dFlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699287466; x=1699892266; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lUV8zKIdpTV0f8ZMhx633GQ2l+XRSBNMcsvYJoEfTx4=; b=bS2mOAhVIf+EcD2TxstrDTMXjlevsoJvrsogl1vChzrfr4cfC/gxfhnKuzde6kv1aB r1EmIrWvYz4e1JJKL4iEvrNam0bh7IMRPN9YyZrWIPNxyFwqPzwl/8HIXhcT/5l8wrl1 GxXSggagX6H23I8CS4Zf21CBiVw6v599TQD5T0yTaVxbMMFr5/p33icK6gJkNdi3OAo9 UVO4nvLeJuFc5np63j0l7YuF1Y792Or2A/JuPLL0LkSOFpVOl40+sSYq7wRR+C5GVHt/ LJEWr1y+SioZF53g3B8BlFsHhFAp+b3oCLQ8e2F6zrl5wJe3jrM49u+W59CgJb+MIp2Y /Sug== X-Gm-Message-State: AOJu0YwEg4iY2RJl1cXVblk/Mc0c7BDaSmn+c8/VCTQVRadVEzQ4vu5A tFa5upmh+EcAhvEY3rkAmgJzqvSgGD5gI2YVJLvrtg== X-Received: by 2002:ad4:5c83:0:b0:670:9f8d:f7be with SMTP id o3-20020ad45c83000000b006709f8df7bemr44676404qvh.13.1699287465633; Mon, 06 Nov 2023 08:17:45 -0800 (PST) MIME-Version: 1.0 References: <20231105163040.14904-1-pbonzini@redhat.com> <20231105163040.14904-28-pbonzini@redhat.com> In-Reply-To: From: Fuad Tabba Date: Mon, 6 Nov 2023 16:17:09 +0000 Message-ID: Subject: Re: [PATCH 27/34] KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type To: Sean Christopherson 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?B?TWlja2HDq2wgU2FsYcO8bg==?= , 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 X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 08:17:52 -0800 (PST) On Mon, Nov 6, 2023 at 4:04=E2=80=AFPM Sean Christopherson wrote: > > 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. "m= ode" > > > tracks physical and virtual address properties, as well as the prefer= red > > > 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= of > > > helpers. Guest private memory is effectively usable only by confiden= tial > > > VM types, and it's expected that x86 will double down and require uni= que > > > 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 > > > --- > > > > 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, on= ly x86 > supports KVM_CREATE_GUEST_MEMFD, and x86 only supports it for private mem= ory. > 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. sgtm /fuad