Re: A question about PROT_NONE on ARM and ARM26

From: Jamie Lokier
Date: Wed Jun 30 2004 - 20:52:02 EST


Nicolas Pitre wrote:
> > cmp r0, #(TASK_SIZE - (1<<24))
> >
> > I.e. just compare against the largest constant that can be
> > represented. For accesses to the last part of userspace, it's a
> > penalty of 4 instructions -- but it might work out to be a net gain.
>
> Maybe not. The user stack is located at the top so any user buffer
> allocated on the stack would be penalized.

I agree. I don't know if it would work out to be a net gain on
average or a net loss.

It saves a couple of instructions, but when it fails the cost is only
a few instructions anyway.

Probably for get_user & put_user, the common case _is_ to be on the
user's stack, so Russell's code would be better.

-- 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/