All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Nadav Amit <nadav.amit@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Jim Mattson <jmattson@google.com>
Subject: Re: [kvm-unit-tests PATCH 2/2] x86: nVMX: Set guest as active after NMI/INTR-window tests
Date: Wed, 15 May 2019 09:57:01 -0700	[thread overview]
Message-ID: <20190515165701.GD5875@linux.intel.com> (raw)
In-Reply-To: <16444EC3-7BB8-4FD4-8F1C-30ADFEB5E9CC@gmail.com>

On Thu, May 09, 2019 at 02:29:45PM -0700, Nadav Amit wrote:
> > On May 9, 2019, at 1:32 PM, Sean Christopherson <sean.j.christopherson@intel.com> wrote:
> > 
> > On Wed, May 08, 2019 at 03:27:15AM -0700, Nadav Amit wrote:
> >> From: Nadav Amit <nadav.amit@gmail.com>
> >> 
> >> Intel SDM 26.6.5 says regarding interrupt-window exiting that: "These
> >> events wake the logical processor if it just entered the HLT state
> >> because of a VM entry." A similar statement is told about NMI-window
> >> exiting.
> >> 
> >> However, running tests which are similar to verify_nmi_window_exit() and
> >> verify_intr_window_exit() on bare-metal suggests that real CPUs do not
> >> wake up. Until someone figures what the correct behavior is, just reset
> >> the activity state to "active" after each test to prevent the whole
> >> test-suite from getting stuck.
> >> 
> >> Cc: Jim Mattson <jmattson@google.com>
> >> Cc: Sean Christopherson <sean.j.christopherson@intel.com>
> >> Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
> >> ---
> >> x86/vmx_tests.c | 2 ++
> >> 1 file changed, 2 insertions(+)
> >> 
> >> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> >> index f921286..2d6b12d 100644
> >> --- a/x86/vmx_tests.c
> >> +++ b/x86/vmx_tests.c
> >> @@ -7063,6 +7063,7 @@ static void verify_nmi_window_exit(u64 rip)
> >> 	report("Activity state (%ld) is 'ACTIVE'",
> >> 	       vmcs_read(GUEST_ACTV_STATE) == ACTV_ACTIVE,
> >> 	       vmcs_read(GUEST_ACTV_STATE));
> >> +	vmcs_write(GUEST_ACTV_STATE, ACTV_ACTIVE);
> > 
> > Don't you need to remove (or modify) the above report() as well to avoid
> > failing the current test?
> 
> Thanks for checking it (in your second email).
> 
> So should I remove this test completely for v2? Or do you have any different
> test you want to run?

I'd say just remove the activity state check.  KVM is technically broken,
and is unlikely to be fixed any time soon.  I don't see much value in
adding more code to the test just to highlight that KVM doesn't strictly
adhere to the SDM for activity state transitions.

      reply	other threads:[~2019-05-15 16:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 10:27 [kvm-unit-tests PATCH 0/2] x86: nVMX: Fix NMI/INTR-window tests Nadav Amit
2019-05-08 10:27 ` [kvm-unit-tests PATCH 1/2] x86: nVMX: Use #DB in nmi and intr tests Nadav Amit
2019-05-08 23:11   ` Jim Mattson
2019-05-08 23:35     ` Nadav Amit
2019-05-20 15:52       ` Paolo Bonzini
2019-05-20 16:39         ` Nadav Amit
2019-05-20 17:21           ` Paolo Bonzini
2019-05-08 10:27 ` [kvm-unit-tests PATCH 2/2] x86: nVMX: Set guest as active after NMI/INTR-window tests Nadav Amit
2019-05-08 23:21   ` Jim Mattson
2019-05-08 23:38     ` Nadav Amit
2019-05-09 20:48       ` Sean Christopherson
2019-05-09 20:32   ` Sean Christopherson
2019-05-09 21:29     ` Nadav Amit
2019-05-15 16:57       ` Sean Christopherson [this message]

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=20190515165701.GD5875@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 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.