public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jim Mattson <jmattson@google.com>
Cc: Nadav Amit <nadav.amit@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvm list <kvm@vger.kernel.org>
Subject: Re: [kvm-unit-tests PATCH] x86: Fix max VMCS field encoding index check
Date: Tue, 17 Dec 2019 16:24:10 -0800	[thread overview]
Message-ID: <20191218002410.GN11771@linux.intel.com> (raw)
In-Reply-To: <CALMp9eT+K7qwLeBb231OjNwqTaS4XE6Ci+-j_b+a=0JU__HEqg@mail.gmail.com>

On Fri, Dec 13, 2019 at 09:30:45AM -0800, Jim Mattson wrote:
> On Fri, Dec 13, 2019 at 1:13 AM Nadav Amit <nadav.amit@gmail.com> wrote:
> >
> > > On Dec 13, 2019, at 12:59 AM, Jim Mattson <jmattson@google.com> wrote:
> > >
> > > On Sat, May 18, 2019 at 4:58 PM Nadav Amit <nadav.amit@gmail.com> wrote:
> > >> The test that checks the maximum VMCS field encoding does not probe all
> > >> possible VMCS fields. As a result it might fail since the actual
> > >> IA32_VMX_VMCS_ENUM.MAX_INDEX would be higher than the expected value.
> > >>
> > >> Change the test to check that the maximum of the supported probed
> > >> VMCS fields is lower/equal than the actual reported
> > >> IA32_VMX_VMCS_ENUM.MAX_INDEX.
> > >
> > > Wouldn't it be better to probe all possible VMCS fields and keep the
> > > test for equality?
> >
> > It might take a while though…
> >
> > How about probing VMREAD/VMWRITE to MAX_INDEX in addition to all the known
> > VMCS fields and then checking for equation?
> >
> It can't take that long. VMCS field encodings are only 15 bits, and
> you can ignore the "high" part of 64-bit fields, so that leaves only
> 14 bits.

Unless kvm-unit-tests is being run in L1, in which case things like this
are painful.  That being said, I do agree that probing "all" VMCS fields
is the way to go.  Walking from highest->lowest probably won't even take
all that many VMREADS.  If it is slow, the test can be binned to its own
config.

  reply	other threads:[~2019-12-18  0:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-18 16:37 [kvm-unit-tests PATCH] x86: Fix max VMCS field encoding index check Nadav Amit
2019-05-20 14:51 ` Paolo Bonzini
2019-12-12 22:59 ` Jim Mattson
2019-12-13  9:13   ` Nadav Amit
2019-12-13 17:30     ` Jim Mattson
2019-12-18  0:24       ` Sean Christopherson [this message]
2019-12-19  8:52         ` Nadav Amit

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=20191218002410.GN11771@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=nadav.amit@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