Same nested TLB/access bit issue like x86. Use the is_pseries_lpar()
check to detect when running nested kvm on pseries LPAR to only warn on
idle-page check.

Reported-by: Anushree Mathur <[email protected]>
Signed-off-by: Ritesh Harjani (IBM) <[email protected]>
---
 .../testing/selftests/kvm/access_tracking_perf_test.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c 
b/tools/testing/selftests/kvm/access_tracking_perf_test.c
index 4415c94b2866..94bfb82f7b79 100644
--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c
+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c
@@ -470,6 +470,17 @@ static int access_tracking_unreliable(void)
                puts("Skipping idle page count sanity check, because the test 
is run nested");
                return 1;
        }
+#endif
+#ifdef __powerpc64__
+       /*
+        * Nested KVM (pSeries LPAR) can hide accessed/idle, since KVM doesn't
+        * explicitely flush the TLB for access bit update. L0 keeps
+        * translations cached so the guest won't see the idle bit cleared.
+        */
+       if (is_pseries_lpar()) {
+               puts("Skipping idle page count sanity check, because the test 
is run nested");
+               return 1;
+       }
 #endif
        /*
         * When NUMA balancing is enabled, guest memory will be unmapped to get
-- 
2.39.5


Reply via email to