Skip to contentSkip to conversation

question (bug?) in xeno-linux code

DISCUSSION Runting Shi 1 participant 1 message Apr 18, 2006

lore
Share & tools
lore
#0 lore raw

Hey, in xeno-linux, arch/i386/mm/pgtable-xen.c (line 363),

why are we doing set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));

shouldn't it be set_pgd(&pgd[USER_PTRS_PER_PGD + i], __pgd(1 + __pa(pmd))) or something?

I am just wondering why the for loop is there at all....

Thanks,

Elaine

for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
                        pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
                        if (!pmd)
                                goto out_oom;
                        set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));
                }