[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGtprH9C9qTSBC8zB+q0K7ZgT=gs6hHy=i=1AQ80cD0U1vg7nA@mail.gmail.com>
Date: Wed, 14 Sep 2022 12:12:16 -0700
From: Vishal Annapurve <vannapurve@...gle.com>
To: David Matlack <dmatlack@...gle.com>
Cc: x86 <x86@...nel.org>, kvm list <kvm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-kselftest@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>, shuah <shuah@...nel.org>,
Ben Gardon <bgardon@...gle.com>,
Sean Christopherson <seanjc@...gle.com>,
Oliver Upton <oupton@...gle.com>, peterx@...hat.com,
Vitaly Kuznetsov <vkuznets@...hat.com>, drjones@...hat.com
Subject: Re: [V1 PATCH 3/5] selftests: kvm: x86: Execute vmcall/vmmcall
according to CPU type
On Thu, Sep 8, 2022 at 3:54 PM David Matlack <dmatlack@...gle.com> wrote:
>
> Please use "KVM: selftest: ..." for the shortlog.
>
Ack.
> On Sat, Sep 03, 2022 at 01:28:47AM +0000, Vishal Annapurve wrote:
> > Modify following APIs for x86 implementation:
> > 1) kvm_arch_main : Query the cpu vendor and cache the value in advance.
> > 2) kvm_arch_post_vm_load: Populate cpu type in the guest memory so that
> > guest doesn't need to execute cpuid instruction again.
>
> This commit message only describes a subset of the changes in this
> commit, and does not provide any context on why the changes are being
> made (other than a clue about avoiding CPUID).
>
> I also think this could be split up into 2 separate commits.
>
Ack, will add more details to the commit log. Though since
is_amd_cpu/is_intel_cpu is used by both selftest VMM and selftest
guest logic, I would prefer to not split this change into two. For
now, I will upload the series with this change being a single patch.
We can discuss again if this split is really needed.
Regards,
Vishal
> I would suggest first patch changes is_{intel,amd}_cpu() to return a cached
> result. e.g.
>
> KVM: selftests: Precompute the result for is_{intel,amd}_cpu()
>
> Cache the vendor CPU type in a global variable so that multiple calls
> to is_intel_cpu() do not need to re-execute CPUID. This will be useful
> in a follow-up commit to check if running on AMD or Intel from within
> a selftest guest where executing CPUID requires a VM-exit.
>
> Then add support for AMD to kvm_hypercall():
>
> KVM: selftests: Add AMD support to kvm_hypercall()
>
> Add support for AMD hypercalls to kvm_hypercall() so that it can be
> used in selftests running on Intel or AMD hosts. This will be used in
> a follow up commit to ...
>
> As part of this change, sync the global variable is_cpu_amd into the
> guest so the guest can determine which hypercall instruction to use
> without needing to re-execute CPUID for every hypercall.
>
Powered by blists - more mailing lists