[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhR5DGdCx9XzBc9ZpgV3ckG_-6NB-DvPT3QG8ScPj+EW-34uA@mail.gmail.com>
Date: Thu, 14 Aug 2025 23:29:15 -0500
From: Sagi Shahar <sagis@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: linux-kselftest@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <shuah@...nel.org>, Ackerley Tng <ackerleytng@...gle.com>,
Ryan Afranji <afranji@...gle.com>, Andrew Jones <ajones@...tanamicro.com>,
Isaku Yamahata <isaku.yamahata@...el.com>, Erdem Aktas <erdemaktas@...gle.com>,
Rick Edgecombe <rick.p.edgecombe@...el.com>, Roger Wang <runanwang@...gle.com>,
Binbin Wu <binbin.wu@...ux.intel.com>, Oliver Upton <oliver.upton@...ux.dev>,
"Pratik R. Sampat" <pratikrajesh.sampat@....com>, Reinette Chatre <reinette.chatre@...el.com>,
Ira Weiny <ira.weiny@...el.com>, linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH v8 04/30] KVM: selftests: Add vCPU descriptor table
initialization utility
On Mon, Aug 11, 2025 at 1:25 PM Sean Christopherson <seanjc@...gle.com> wrote:
>
> On Thu, Aug 07, 2025, Sagi Shahar wrote:
> > From: Ackerley Tng <ackerleytng@...gle.com>
> >
> > Turn vCPU descriptor table initialization into a utility for use by tests
> > needing finer control, for example for TDX TD creation.
>
> NAK. "needing finer control" is not a sufficient explanation for why _this_
> patch is necessary. There's also zero argument made throughout any of these
> patches as to why this pattern:
>
> vm = td_create();
> td_initialize(vm, VM_MEM_SRC_ANONYMOUS, 0);
> vcpu = td_vcpu_add(vm, 0, guest_io_writes);
> td_finalize(vm);
>
> is the best approach. IMO it is NOT the best approach. I would much rather we
> structure things so that creating TDs can use APIs like this:
>
> static inline struct kvm_vm *td_create_with_vcpus(uint32_t nr_vcpus,
> void *guest_code,
> struct kvm_vcpu *vcpus[])
> {
> return __vm_create_with_vcpus(VM_SHAPE_TDX, nr_vcpus, 0, guest_code, vcpus);
> }
>
> instead of open coding an entirely different set of APIs for creating TDs, which
> is not maintanable.
Dropping this patch in the next version.
Powered by blists - more mailing lists