[lkml]   [2008]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 00 of 10] x86: unify asm/pgtable.h
Andi Kleen wrote:
>> of the if()? If not, can't we just remove it and avoid this present
>> problem?
> That would just hide your problem.

The "problem" is a BUG() in pageattr_64.c:change_page_attr(), which to
me looks spurious. It arises because __PAGE_KERNEL_* doesn't contain
_PAGE_GLOBAL, but PAGE_KERNEL_* does. When ioremap()
change_page_attr(), it does so in a way that guarentees that the test

if (pgprot_val(prot) != pgprot_val(ref_prot)) {

in __change_page_attr() always succeeds. When I folded _PAGE_GLOBAL
into the __PAGE_KERNEL_* definitions, it mostly works except it causes
this if() to fail, falling into the otherwise dead else clause and
triggers a BUG().

I'm not really sure what the logic in here is supposed to be doing, but
it seems to me that it isn't the difference between global and
non-global mappings (I guess its really testing for cached vs uncached

Or to put it another way, what's the underlying rationale for making
__PAGE_KERNEL_* not include the GLOBAL flag, but including it in the
pgprot versions? It means that code like this in ioremap_64.c:

err = change_page_attr_addr(vaddr,npages,__pgprot(__PAGE_KERNEL|flags));

is subtly different from using PAGE_KERNEL | flags, because the latter
also includes _PAGE_GLOBAL.


 \ /
  Last update: 2008-01-09 02:41    [W:0.054 / U:1.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site