+ /*
+ * Our caller grabbed the KVM mmu_lock with a successful
+ * mmu_notifier_retry, so we're safe to walk the page table.
+ */
+ switch (dev_pagemap_mapping_shift(hva, current->mm)) {
+ case PMD_SHIFT:
+ case PUD_SIZE:
Shouldn't this be PUD_SHIFT?
But I agree with Paolo, that this is simply
return dev_pagemap_mapping_shift(hva, current->mm) > PAGE_SHIFT;