Re: [PATCH 2/3] powerpc ioremap_prot



On Wed, 30 Apr 2008 08:07:53 +1000
Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote:


On Tue, 2008-04-29 at 11:17 -0700, Andrew Morton wrote:

Given that x86 implements ioremap_prot() as a regular C function, it
would
be nicer to require that all architectures do that. Especially as
macros
suck.

Your powerpc implementation of ioremap_prot() has a different
signature
from the x86 one: `phys_addr_t address' versus `resource_size_t
phys_addr'.
Can that be improved?

Well, we already had ioremap_flags() which is the same thing, that's why
I made it just a #define :-)

But I'm pondering removing our ioremap_flags completely in favor of
ioremap_prot. This was just a patch to "make it work" so Rik could move
on with his core patch (btw. Rik, you got the SOBs in the wrong order on
that one).

Regarding the difference, well, it has to do with us historically using
that phys_addr_t type for ioremap. I can try to look into changing that
but it will take a bit more effort.

It does seem pretty bad to create the same-named function in two
architectures, only with sometimes-different argument types.

A minimal fix would be to make powerpc's implementation be an out-of-line C
function which takes a resource_size_t and which calls ioremap_flags()?

static inline pte_t pte_mkspecial(pte_t pte) {
return pte; }
+static inline unsigned long pte_pgprot(pte_t pte) {
+ return __pgprot(pte_val(pte)) & PAGE_PROT_BITS; }

ick. \n's are cheap.

Yeah well, just adapted to the style of the other ones around it :-)

I'm not a big believer in making new code match broken old code.

Those things have been there forever, I think we can even blame
pre-paulus maintainership here !

I blame Rusty.

I'll change them all in one go in a different patch if you want.

whatever ;)
--
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/



Relevant Pages

  • Re: Page fault scalability patch V18: Drop first acquisition of ptl
    ... It relies upon page_table_lock for pte atomicity. ... >> architectures then they have no solution to the scalability problem. ... > corner and I have reworked the patches numerous times. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()
    ... On Thursday 24 January 2008 04:05, Linus Torvalds wrote: ... For a non-present pte, none of the other bits are defined, and for ... all we know there might be architectures out there that require them to ... you just possibly randomly corrupted the pte. ...
    (Linux-Kernel)
  • Re: [patch 2.6.13-rc4] fix get_user_pages bug
    ... > Or should we change s390 to set a flag in the pte just for this purpose? ... architectures except s390 handle_pte_faultwill then create a pte with ... With the physical dirty bit patch pte_dirtyis ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: Fw: [PATCH] ia64: race flushing icache in do_no_page path
    ... lazy_mmu_prot_update needs to be called whenever the permissions on pte ... But those architectures which have a non-empty ... Extra flush_icache_page routines will add cost to archs that ... Though for ia64 implementation, this ends ...
    (Linux-Kernel)