All of lore.kernel.org
 help / color / mirror / Atom feed
From: Babu Moger <babu.moger@amd.com>
To: unlisted-recipients:; (no To-header on input)
Cc: pbonzini@redhat.com, thuth@redhat.com, drjones@redhat.com,
	kvm@vger.kernel.org, babu.moger@amd.com
Subject: [kvm-unit-tests PATCH 1/2] x86: access: Fix timeout failure by limiting number of flag combinations
Date: Fri, 06 Aug 2021 11:08:37 -0500	[thread overview]
Message-ID: <162826611747.32391.16149996928851353357.stgit@bmoger-ubuntu> (raw)
In-Reply-To: <162826604263.32391.7580736822527851972.stgit@bmoger-ubuntu>

From: Babu Moger <Babu.Moger@amd.com>

The test ./x86/access fails with a timeout. This is due to the number test
combination. The test cases increase exponentially as the features get
enabled. The new machine adds the feature AC_CPU_CR4_PKE. The default
timeout is 180 seconds. Seen this problem both on AMD and Intel machines.

#./tests/access
qemu-system-x86_64: terminating on signal 15 from pid 20050 (timeout)
FAIL access (timeout; duration=180)

This test can take about 7 minutes without timeout.
time ./tests/access
58982405 tests, 0 failures
PASS access

real	7m10.063s
user	7m9.063s
sys	0m0.309s

Fix the problem by adding few more limit checks.

Signed-off-by: Babu Moger <Babu.Moger@amd.com>
---
 x86/access.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x86/access.c b/x86/access.c
index 47807cc..e371dd5 100644
--- a/x86/access.c
+++ b/x86/access.c
@@ -317,9 +317,9 @@ static _Bool ac_test_legal(ac_test_t *at)
     /*
      * Shorten the test by avoiding testing too many reserved bit combinations
      */
-    if ((F(AC_PDE_BIT51) + F(AC_PDE_BIT36) + F(AC_PDE_BIT13)) > 1)
+    if ((F(AC_PDE_BIT51) + F(AC_PDE_BIT36) + F(AC_PDE_BIT13) + F(AC_CPU_CR4_PKE)) > 1)
         return false;
-    if ((F(AC_PTE_BIT51) + F(AC_PTE_BIT36)) > 1)
+    if ((F(AC_PTE_BIT51) + F(AC_PTE_BIT36) + F(AC_CPU_CR4_PKE)) > 1)
         return false;
 
     return true;


  reply	other threads:[~2021-08-06 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 16:08 [kvm-unit-tests PATCH 0/2] Couple of SVM fixes Babu Moger
2021-08-06 16:08 ` Babu Moger [this message]
     [not found]   ` <YQ1pA9nN6DP0veQ1@google.com>
2021-08-09 19:43     ` [kvm-unit-tests PATCH 1/2] x86: access: Fix timeout failure by limiting number of flag combinations Babu Moger
2021-08-10 16:59       ` Babu Moger
2021-08-10 23:38         ` Babu Moger
2021-08-11  7:09           ` Paolo Bonzini
2021-08-11 16:03             ` Babu Moger
2021-08-11 16:13               ` Sean Christopherson
2021-08-11 16:43                 ` Babu Moger
2021-08-06 16:08 ` [kvm-unit-tests PATCH 2/2] nSVM: Fix NPT reserved bits test hang Babu Moger

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=162826611747.32391.16149996928851353357.stgit@bmoger-ubuntu \
    --to=babu.moger@amd.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@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.