+62
−31
Loading
Ensure that a stride larger than 1 (huge page) is only used when page points to a head of a huge page and both the guest frame number (gfn) and the operation size (page_count) are aligned to the huge page size (PTRS_PER_PMD). This matches the hypervisor requirement that map/unmap operations for huge pages must be guest-aligned and cover a full huge page. Add mshv_chunk_stride() to encapsulate this alignment and page-order validation, and plumb a huge_page flag into the region chunk handlers. This prevents issuing large-page map/unmap/share operations that the hypervisor would reject due to misaligned guest mappings. Fixes: abceb429 ("mshv: Fix huge page handling in memory region traversal") Signed-off-by:Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> Reviewed-by:
Nuno Das Neves <nunodasneves@linux.microsoft.com> Reviewed-by:
Michael Kelley <mhklinux@outlook.com> Signed-off-by:
Wei Liu <wei.liu@kernel.org>