kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [kvm-unit-tests PATCH] x86/access: Fix intermittent test failure
@ 2021-04-09  7:55 Yang Weijiang
  2021-04-09 17:29 ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Yang Weijiang @ 2021-04-09  7:55 UTC (permalink / raw)
  To: pbonzini, kvm; +Cc: Yang Weijiang

During kvm-unit-test, below failure pattern is observed, this is due to testing thread
migration + cache "lazy" flush during test, so forcely flush the cache to avoid the issue.
Pin the test app to certain physical CPU can fix the issue as well. The error report is
misleading, pke is the victim of the issue.

test user cr4.pke: FAIL: error code 5 expected 4
Dump mapping: address: 0x123400000000
------L4: 21ea007
------L3: 21eb007
------L2: 21ec000
------L1: 2000000

Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
---
 x86/access.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/x86/access.c b/x86/access.c
index 7dc9eb6..379d533 100644
--- a/x86/access.c
+++ b/x86/access.c
@@ -211,6 +211,8 @@ static unsigned set_cr4_smep(int smep)
         ptl2[2] |= PT_USER_MASK;
     if (!r)
         shadow_cr4 = cr4;
+
+    invlpg((void *)(ptl2[2] & ~PAGE_SIZE));
     return r;
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-13  4:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  7:55 [PATCH] [kvm-unit-tests PATCH] x86/access: Fix intermittent test failure Yang Weijiang
2021-04-09 17:29 ` Paolo Bonzini
2021-04-09 18:59   ` Sean Christopherson
2021-04-10 14:16     ` Paolo Bonzini
2021-04-12 13:25     ` Yang Weijiang
2021-04-12 18:30       ` Sean Christopherson
2021-04-13  3:13         ` Yang Weijiang
2021-04-13  4:44           ` Yang Weijiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).