From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFF63C04E53 for ; Wed, 15 May 2019 16:57:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9DF8A20862 for ; Wed, 15 May 2019 16:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbfEOQ5C (ORCPT ); Wed, 15 May 2019 12:57:02 -0400 Received: from mga17.intel.com ([192.55.52.151]:15363 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726681AbfEOQ5C (ORCPT ); Wed, 15 May 2019 12:57:02 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2019 09:57:01 -0700 X-ExtLoop1: 1 Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.36]) by orsmga006.jf.intel.com with ESMTP; 15 May 2019 09:57:00 -0700 Date: Wed, 15 May 2019 09:57:01 -0700 From: Sean Christopherson To: Nadav Amit Cc: Paolo Bonzini , kvm@vger.kernel.org, Jim Mattson Subject: Re: [kvm-unit-tests PATCH 2/2] x86: nVMX: Set guest as active after NMI/INTR-window tests Message-ID: <20190515165701.GD5875@linux.intel.com> References: <20190508102715.685-1-namit@vmware.com> <20190508102715.685-3-namit@vmware.com> <20190509203241.GB12810@linux.intel.com> <16444EC3-7BB8-4FD4-8F1C-30ADFEB5E9CC@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16444EC3-7BB8-4FD4-8F1C-30ADFEB5E9CC@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, May 09, 2019 at 02:29:45PM -0700, Nadav Amit wrote: > > On May 9, 2019, at 1:32 PM, Sean Christopherson wrote: > > > > On Wed, May 08, 2019 at 03:27:15AM -0700, Nadav Amit wrote: > >> From: Nadav Amit > >> > >> 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 > >> Cc: Sean Christopherson > >> Signed-off-by: Nadav Amit > >> --- > >> 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.