From: Sean Christopherson <seanjc@google.com>
To: David Dunn <daviddunn@google.com>
Cc: pbonzini@redhat.com, jmattson@google.com,
like.xu.linux@gmail.com, kvm@vger.kernel.org
Subject: Re: [PATCH v6 2/3] KVM: selftests: Allow creation of selftest VM without vcpus
Date: Mon, 14 Feb 2022 20:06:57 +0000 [thread overview]
Message-ID: <Ygq2YWwS5XcDGD2j@google.com> (raw)
In-Reply-To: <20220209172945.1495014-3-daviddunn@google.com>
Shortlog and new function name are a bit confusing. The framework already supports
creating VMs without vCPUs, what it doesn't provide is a helper to load the guest
code and do the other "default" stuff.
That said, the framework is such an absolute mess that I'm fine going with
vm_create_without_vcpus() for now, carving out a more appropriate name will be an
exercise in futility without a large-scale renaming and refactoring of the other
crud.
So just a different shortlog I supposed, though even that seems doomed to be
contradictory. Maybe something like this?
KVM: selftests: Carve out helper to create "default" VM without vCPUs
Default in quotes because the selftests already have a goofy interpretation of
"default".
On Wed, Feb 09, 2022, David Dunn wrote:
> Break out portion of vm_create_with_vcpus so that selftests can modify
> the VM prior to creating vcpus.
>
> Signed-off-by: David Dunn <daviddunn@google.com>
> ---
> .../selftests/kvm/include/kvm_util_base.h | 3 ++
> tools/testing/selftests/kvm/lib/kvm_util.c | 35 +++++++++++++++----
> 2 files changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h
> index 4ed6aa049a91..2bdf96f520aa 100644
> --- a/tools/testing/selftests/kvm/include/kvm_util_base.h
> +++ b/tools/testing/selftests/kvm/include/kvm_util_base.h
> @@ -336,6 +336,9 @@ struct kvm_vm *vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus,
> uint32_t num_percpu_pages, void *guest_code,
> uint32_t vcpuids[]);
>
> +/* First phase of vm_create_with_vcpus, allows customization before vcpu add */
Eh, drop the comment, the association is obvious from the code, and it's just one
more thing that needs to be updated when this stuff finally gets cleaned up.
> +struct kvm_vm *vm_create_without_vcpus(enum vm_guest_mode mode, uint64_t pages);
> +
> /*
> * Adds a vCPU with reasonable defaults (e.g. a stack)
> *
next prev parent reply other threads:[~2022-02-14 20:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 17:29 [PATCH v6 0/3] KVM: x86: Provide per VM capability for disabling PMU virtualization David Dunn
2022-02-09 17:29 ` [PATCH v6 1/3] " David Dunn
2022-02-14 19:53 ` Sean Christopherson
2022-02-09 17:29 ` [PATCH v6 2/3] KVM: selftests: Allow creation of selftest VM without vcpus David Dunn
2022-02-14 20:06 ` Sean Christopherson [this message]
2022-02-09 17:29 ` [PATCH v6 3/3] KVM: selftests: Verify disabling PMU virtualization via KVM_CAP_CONFIG_PMU David Dunn
2022-02-14 20:13 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ygq2YWwS5XcDGD2j@google.com \
--to=seanjc@google.com \
--cc=daviddunn@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox