Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263555AbUGABFb (ORCPT ); Wed, 30 Jun 2004 21:05:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263596AbUGABFb (ORCPT ); Wed, 30 Jun 2004 21:05:31 -0400 Received: from modemcable166.48-200-24.mc.videotron.ca ([24.200.48.166]:10906 "EHLO xanadu.home") by vger.kernel.org with ESMTP id S263555AbUGABFZ (ORCPT ); Wed, 30 Jun 2004 21:05:25 -0400 Date: Wed, 30 Jun 2004 21:05:15 -0400 (EDT) From: Nicolas Pitre X-X-Sender: nico@xanadu.home To: Jamie Lokier cc: Ian Molton , , lkml Subject: Re: A question about PROT_NONE on ARM and ARM26 In-Reply-To: <20040630233014.GC32560@mail.shareable.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 990 Lines: 34 On Thu, 1 Jul 2004, Jamie Lokier wrote: > Russell King wrote: > > Ok, this could work, but there's one gotcha - TASK_SIZE-4 doesn't fit > > in an 8-bit rotated constants, so we need 2 extra instructions: > > > > __get_user_4: > > mov r1, #TASK_SIZE > > sub r1, r1, #4 > > cmp r0, r1 > > 4: ldrlet r1, [r0] > > movle r0, #0 > > movle pc, lr > > ... > > One more possibility: > > 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. Nicolas - 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/