Re: Comparing PROT_EXEC-only pages on different CPUs

From: Jamie Lokier
Date: Thu Jul 01 2004 - 23:06:53 EST


Thanks for your input, Richard.

Richard Henderson wrote:
> > Richard raises an interesting point: exec-only pages are useless if
> > the code needs to read jump tables and constant pools. It seems very
> > likely Alpha and IA64 have these.
>
> Only if the processor is crippled enough that mixing jump tables and
> constant pools in the same pages as code is considered reasonable.

That's a good point, if the i-cache and/or DTLB are separate from
d-cache and/or DTLB. Then it makes more sense to put tables in a
separate address block.

However if the caches are unified then it makes sense to put them
together. Somehow I doubt if any of these 64-bit chips have unified
i- and d-caches though :)

> Anyway, that's a strawman -- it's the toolchain's job to get the bits
> on the pt_load segments correct.
>
> If the pt_load segment or the mmap prot argument says execute-only,
> then you should honor it.

In other words, PA-RISC and SH64 kernels _should_ create exec-only
pages if requested, as the hardware can do it, right?

And the toolchain _should_ ask read permssion for code segments, if
(and only if) the compiler has generated code which needs that, right?

I very much agree.

(Fwiw, Alpha does gives read permission to a write-only request, even
on chips which don't need that for byte writes to work. Isn't that a
similar case?)

Thanks,
-- Jamie
-
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/