+ pta->gpa = (vm_get_max_gfn(vm) - guest_num_pages) * pta->guest_page_size;Also not related to this patch, but another case for align.
+ pta->gpa &= ~(pta->host_page_size - 1);
if (backing_src == VM_MEM_SRC_ANONYMOUS_THP ||also align
backing_src == VM_MEM_SRC_ANONYMOUS_HUGETLB)
- guest_test_phys_mem &= ~(KVM_UTIL_HUGEPAGE_ALIGNMENT - 1);
-
+ pta->gpa &= ~(KVM_UTIL_HUGEPAGE_ALIGNMENT - 1);
#ifdef __s390x__And here again (oof)
/* Align to 1M (segment size) */
- guest_test_phys_mem &= ~((1 << 20) - 1);
+ pta->gpa &= ~((1 << 20) - 1);
Yep, I'll fix all these and the align() comment in v2.