-#define pgd_populate(mm, pgd, pud) BUG()
-#define pgd_populate_kernel(mm, pgd, pud) BUG()
+static inline void pgd_populate_kernel(struct mm_struct *mm,
+ pgd_t *pgd, pud_t *pud)
+{
+ pgd_val(*pgd) = _REGION2_ENTRY | __pa(pud);
+}
+
+static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
+{
+ pgd_t *shadow_pgd = get_shadow_table(pgd);
+ pud_t *shadow_pud = get_shadow_table(pud);
+
+ if (shadow_pgd && shadow_pud)
+ pgd_populate_kernel(mm, shadow_pgd, shadow_pud);
+ pgd_populate_kernel(mm, pgd, pud);
+}