* [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests
@ 2020-02-04 19:48 Sean Christopherson
2020-02-05 11:37 ` Vitaly Kuznetsov
2020-02-05 15:26 ` Paolo Bonzini
0 siblings, 2 replies; 5+ messages in thread
From: Sean Christopherson @ 2020-02-04 19:48 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: kvm
Use the host CPU model for the PCID tests to allow testing the various
combinations of PCID and INVPCID enabled/disabled without having to
manually change the kvm-unit-tests command line. I.e. give users the
option of changing the command line *OR* running on a (virtual) CPU
with or without PCID and/or INVPCID.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
x86/unittests.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index aae1523..25f4535 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -228,7 +228,7 @@ extra_params = --append "10000000 `date +%s`"
[pcid]
file = pcid.flat
-extra_params = -cpu qemu64,+pcid
+extra_params = -cpu host
arch = x86_64
[rdpru]
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests
2020-02-04 19:48 [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests Sean Christopherson
@ 2020-02-05 11:37 ` Vitaly Kuznetsov
2020-02-05 14:36 ` Sean Christopherson
2020-02-05 15:26 ` Paolo Bonzini
1 sibling, 1 reply; 5+ messages in thread
From: Vitaly Kuznetsov @ 2020-02-05 11:37 UTC (permalink / raw)
To: Sean Christopherson; +Cc: kvm, Paolo Bonzini
Sean Christopherson <sean.j.christopherson@intel.com> writes:
> Use the host CPU model for the PCID tests to allow testing the various
> combinations of PCID and INVPCID enabled/disabled without having to
> manually change the kvm-unit-tests command line. I.e. give users the
> option of changing the command line *OR* running on a (virtual) CPU
> with or without PCID and/or INVPCID.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
> x86/unittests.cfg | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/x86/unittests.cfg b/x86/unittests.cfg
> index aae1523..25f4535 100644
> --- a/x86/unittests.cfg
> +++ b/x86/unittests.cfg
> @@ -228,7 +228,7 @@ extra_params = --append "10000000 `date +%s`"
>
> [pcid]
> file = pcid.flat
> -extra_params = -cpu qemu64,+pcid
> +extra_params = -cpu host
> arch = x86_64
>
> [rdpru]
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Actually, is there any reason for *not* using '-cpu host' in any of the
tests?
--
Vitaly
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests
2020-02-05 11:37 ` Vitaly Kuznetsov
@ 2020-02-05 14:36 ` Sean Christopherson
0 siblings, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2020-02-05 14:36 UTC (permalink / raw)
To: Vitaly Kuznetsov; +Cc: kvm, Paolo Bonzini
On Wed, Feb 05, 2020 at 12:37:11PM +0100, Vitaly Kuznetsov wrote:
> Sean Christopherson <sean.j.christopherson@intel.com> writes:
>
> > Use the host CPU model for the PCID tests to allow testing the various
> > combinations of PCID and INVPCID enabled/disabled without having to
> > manually change the kvm-unit-tests command line. I.e. give users the
> > option of changing the command line *OR* running on a (virtual) CPU
> > with or without PCID and/or INVPCID.
> >
> > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> > ---
> > x86/unittests.cfg | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/x86/unittests.cfg b/x86/unittests.cfg
> > index aae1523..25f4535 100644
> > --- a/x86/unittests.cfg
> > +++ b/x86/unittests.cfg
> > @@ -228,7 +228,7 @@ extra_params = --append "10000000 `date +%s`"
> >
> > [pcid]
> > file = pcid.flat
> > -extra_params = -cpu qemu64,+pcid
> > +extra_params = -cpu host
> > arch = x86_64
> >
> > [rdpru]
>
> Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>
> Actually, is there any reason for *not* using '-cpu host' in any of the
> tests?
Emulation tests, e.g. for UMIP, will want "-cpu <base>,+<feature>", but I
can't think of any reason why <base> shouldn't be host.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests
2020-02-04 19:48 [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests Sean Christopherson
2020-02-05 11:37 ` Vitaly Kuznetsov
@ 2020-02-05 15:26 ` Paolo Bonzini
2020-02-05 15:44 ` Sean Christopherson
1 sibling, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2020-02-05 15:26 UTC (permalink / raw)
To: Sean Christopherson; +Cc: kvm
On 04/02/20 20:48, Sean Christopherson wrote:
> Use the host CPU model for the PCID tests to allow testing the various
> combinations of PCID and INVPCID enabled/disabled without having to
> manually change the kvm-unit-tests command line. I.e. give users the
> option of changing the command line *OR* running on a (virtual) CPU
> with or without PCID and/or INVPCID.
I don't understand. :)
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
> x86/unittests.cfg | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/x86/unittests.cfg b/x86/unittests.cfg
> index aae1523..25f4535 100644
> --- a/x86/unittests.cfg
> +++ b/x86/unittests.cfg
> @@ -228,7 +228,7 @@ extra_params = --append "10000000 `date +%s`"
>
> [pcid]
> file = pcid.flat
> -extra_params = -cpu qemu64,+pcid
> +extra_params = -cpu host
> arch = x86_64
>
> [rdpru]
>
The main reason not to use "-cpu host" is that it is not supported by
QEMU TCG (binary translation mode). But there is no reason not to use
"-cpu max", which works with TCG and is synonym with "-cpu host" on KVM. :)
Paolo
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests
2020-02-05 15:26 ` Paolo Bonzini
@ 2020-02-05 15:44 ` Sean Christopherson
0 siblings, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2020-02-05 15:44 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: kvm
On Wed, Feb 05, 2020 at 04:26:40PM +0100, Paolo Bonzini wrote:
> On 04/02/20 20:48, Sean Christopherson wrote:
> > Use the host CPU model for the PCID tests to allow testing the various
> > combinations of PCID and INVPCID enabled/disabled without having to
> > manually change the kvm-unit-tests command line. I.e. give users the
> > option of changing the command line *OR* running on a (virtual) CPU
> > with or without PCID and/or INVPCID.
>
> I don't understand. :)
I was trying to test a change in the code that clears INVPCID in guest's
CPUID if PCID isn't supported. To do that, I ran the PCID unit test in L1,
using L0 Qemu to hide PCID and/or INVPCID from L1 to iterate over the four
combinations of PCID and INVPCID being enabled/disabled. But the test in
L1 never exercised INVPCID=y because unittest.cfg runs with the test with
"-cpu=qemu64,+pcid".
By using qemu64, the only way to test INVPCID=y is to manually run the test
a different "-cpu..." command. The idea behind "-cpu=host" is to enable
running different combinations of the test in L1 by hiding features from L1
instead of by running the test with different commands.
In other words, if I create an L1 with PCID=y and INVPCID=y, I expect that
running the as-configured PCID unit tests would actually test PCID=Y and
INVPCID=y.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-02-05 15:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 19:48 [kvm-unit-tests PATCH] x86: Use "-cpu host" for PCID tests Sean Christopherson
2020-02-05 11:37 ` Vitaly Kuznetsov
2020-02-05 14:36 ` Sean Christopherson
2020-02-05 15:26 ` Paolo Bonzini
2020-02-05 15:44 ` Sean Christopherson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.