static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
 {
+#ifdef CONFIG_PAGE_TABLE_ISOLATION
+       pmd.pud.p4d.pgd = pti_set_user_pgtbl(&pmdp->pud.p4d.pgd, pmd.pud.p4d.pgd);
+#endif
        *pmdp = pmd;
 }
 
 #ifdef CONFIG_SMP
 static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp)
 {
+#ifdef CONFIG_PAGE_TABLE_ISOLATION
+       pti_set_user_pgtbl(&xp->pud.p4d.pgd, __pgd(0));
+#endif
        return __pmd(xchg((pmdval_t *)xp, 0));
 }
 #else
 #ifdef CONFIG_SMP
 static inline pud_t native_pudp_get_and_clear(pud_t *xp)
 {
+#ifdef CONFIG_PAGE_TABLE_ISOLATION
+       pti_set_user_pgtbl(&xp->p4d.pgd, __pgd(0));
+#endif
        return __pud(xchg((pudval_t *)xp, 0));
 }
 #else