Re: [PATCH 00 of 10] x86: unify asm/pgtable.h

From: Andi Kleen
Date: Tue Jan 08 2008 - 20:11:29 EST


> Is _PAGE_GLOBAL causing the first if() to fall through to the second

Yes it obviously is.


> clause? Because otherwise it shouldn't have any effect on the pte_huge()
> test.

>
> Gah! This can't be right! I think the original change_page_attr() code is
> plain buggy.

It has a few rough edges. I was fixing various issues in the c_p_a() patch
series I posted recently.

The code bugs when you set the same area to the same protection several
times. That likely happens here.

The cpa series adds a helpful comment explaining this.

/*
* When you're here you either set the same page to PAGE_KERNEL
* two times in a row or the page table reference counting is
* broken again. To catch the later bug for now (sorry)
*/
printk(KERN_ERR "address %lx\n", address);
dump_pagetable(address);
BUG();

I've been considering taking it out, but is there ever a good reason
to do that? I left it in because it catches bugs in c_p_a itself.

-Andi

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/