VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Ralph Campbell <rcampbell@nvidia.com> 2020-07-01 15:53:52 -0700 committer: Jason Gunthorpe <jgg@nvidia.com> 2020-07-10 16:24:28 -0300 commit: e478425bec930e9368c6efdc78d2e5d85eadc18e parent: 3b50a6e536d2d843857ffe5f923eff7be4222afe
Commit Summary:
mm/hmm: add tests for hmm_pfn_to_map_order()
Diffstat:
1 file changed, 4 insertions, 0 deletions
diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index a2a82262b97b..9aa577afc269 100644
--- a/lib/test_hmm.c
+++ b/lib/test_hmm.c
@@ -766,6 +766,10 @@ static void dmirror_mkentry(struct dmirror *dmirror, struct hmm_range *range,
 		*perm |= HMM_DMIRROR_PROT_WRITE;
 	else
 		*perm |= HMM_DMIRROR_PROT_READ;
+	if (hmm_pfn_to_map_order(entry) + PAGE_SHIFT == PMD_SHIFT)
+		*perm |= HMM_DMIRROR_PROT_PMD;
+	else if (hmm_pfn_to_map_order(entry) + PAGE_SHIFT == PUD_SHIFT)
+		*perm |= HMM_DMIRROR_PROT_PUD;
 }
 
 static bool dmirror_snapshot_invalidate(struct mmu_interval_notifier *mni,