Re: [discuss] Re: BUG in x86_64 hugepage support

Nishanth Aravamudan
2006-03-15T15:15:29Z

On 15.03.2006 [09:50:17 +0100], Jan Beulich wrote:
> >diff -urpN 2.6.16-rc6-mm1/mm/hugetlb.c 2.6.16-rc6-mm1-dev/mm/hugetlb.c
> >--- 2.6.16-rc6-mm1/mm/hugetlb.c 2006-03-14 22:49:44.000000000 -0800
> >+++ 2.6.16-rc6-mm1-dev/mm/hugetlb.c 2006-03-14 22:51:31.000000000 -0800
> >@@ -740,6 +740,7 @@ void hugetlb_change_protection(struct vm
> > continue;
> > if (!pte_none(*ptep)) {
> > pte = huge_ptep_get_and_clear(mm, address, ptep);
> >+ pgprot_val(newprot) |= _PAGE_PSE;
> > pte = pte_modify(pte, newprot);
> > set_huge_pte_at(mm, address, ptep, pte);
> > lazy_mmu_prot_update(pte);
>
> This is architecture independent code - you shouldn't be using
> _PAGE_PSE here. Probably x86-64 (and then likely also i386) should
> define their own set_huge_pte_at(), and use that# to or in the needed
> flag?

Good point, makes sense to me.