]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: selftests: Limit dirty_log_test's s390x workaround to s390x
authorMaxim Levitsky <mlevitsk@redhat.com>
Sat, 11 Jan 2025 00:29:52 +0000 (16:29 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 12 Feb 2025 17:00:55 +0000 (09:00 -0800)
s390 specific workaround causes the dirty-log mode of the test to dirty
all guest memory on the first iteration, which is very slow when the test
is run in a nested VM.

Limit this workaround to s390x.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20250111003004.1235645-9-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/dirty_log_test.c

index 2aee047b8b1c26233641c9d534d3197d6c7c8fa6..55a3854994341150f9605dfb0ba9c23ad8b79c02 100644 (file)
@@ -98,6 +98,7 @@ static void guest_code(void)
        uint64_t addr;
        int i;
 
+#ifdef __s390x__
        /*
         * On s390x, all pages of a 1M segment are initially marked as dirty
         * when a page of the segment is written to for the very first time.
@@ -108,6 +109,7 @@ static void guest_code(void)
                addr = guest_test_virt_mem + i * guest_page_size;
                vcpu_arch_put_guest(*(uint64_t *)addr, READ_ONCE(iteration));
        }
+#endif
 
        while (true) {
                for (i = 0; i < TEST_PAGES_PER_LOOP; i++) {