Skip to content

Commit bffed38

Browse files
Andrew Jonesbonzini
authored andcommitted
kvm: selftests: aarch64: dirty_log_test: fix unaligned memslot size
The memory slot size must be aligned to the host's page size. When testing a guest with a 4k page size on a host with a 64k page size, then 3 guest pages are not host page size aligned. Since we just need a nearly arbitrary number of extra pages to ensure the memslot is not aligned to a 64 host-page boundary for this test, then we can use 16, as that's 64k aligned, but not 64 * 64k aligned. Fixes: 76d58e0 ("KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size", 2019-04-17) Signed-off-by: Andrew Jones <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 19ec166 commit bffed38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/dirty_log_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static void run_test(enum vm_guest_mode mode, unsigned long iterations,
293293
* A little more than 1G of guest page sized pages. Cover the
294294
* case where the size is not aligned to 64 pages.
295295
*/
296-
guest_num_pages = (1ul << (30 - guest_page_shift)) + 3;
296+
guest_num_pages = (1ul << (30 - guest_page_shift)) + 16;
297297
host_page_size = getpagesize();
298298
host_num_pages = (guest_num_pages * guest_page_size) / host_page_size +
299299
!!((guest_num_pages * guest_page_size) % host_page_size);

0 commit comments

Comments
 (0)