linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Roland McGrath <roland@redhat.com>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i386 uaccess to fixmap pages
Date: Thu, 8 May 2003 21:31:19 -0700	[thread overview]
Message-ID: <20030508213119.58dd490d.akpm@digeo.com> (raw)
In-Reply-To: <200305090203.h4923CM11039@magilla.sf.frob.com>

Roland McGrath <roland@redhat.com> wrote:
>
> This patch against 2.5.69 makes uaccess (i.e., access_ok and get/put_user)
> to user-accessible fixmap addresses on x86 work.

This doesn't apply against Linus's current tree.

> -#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
> +#define access_ok(type,addr,size) (__range_ok(addr,size) == 0 || \
> +				   __fixmap_access_ok((unsigned long)(addr), \
> +						      (size), (type)))

Your patch increases the kernel text by nearly 1%.  That's rather a lot for
what is a fairly esoteric feature.


   text    data     bss     dec     hex filename
2805911  592912  732516 4131339  3f0a0b /tmp/vmlinux
2825167  592982  732516 4150665  3f5589 vmlinux

Would it be possible to avoid this by just taking the fault and fixing
things up in the exception handler?

>  #else
>  
> -#define access_ok(type,addr,size) ( (__range_ok(addr,size) == 0) && \
> +#define access_ok(type,addr,size) ((__range_ok(addr,size) == 0) ? \
>  			 ((type) == VERIFY_READ || boot_cpu_data.wp_works_ok || \
> -			  __verify_write((void *)(addr),(size))))
> +			  __verify_write((void *)(addr),(size))) : \
> +			  __fixmap_access_ok((unsigned long)(addr),size,type))

You'll be wanting to parenthesise `size' and `type' here.


For some reason the patch causes gcc-2.95.3 to choke over the

	__put_user(d_off, &lastdirent->d_off);

statement in sys_getdents64().


fs/readdir.c: In function `sys_getdents64':
fs/readdir.c:285: internal error--unrecognizable insn:
(insn 138 212 147 (set (reg:SI 3 %ebx)
        (asm_operands/v ("1:	movl %%eax,0(%2)
2:	movl %%edx,4(%2)
3:
.section .fixup,"ax"
4:	movl %3,%0
	jmp 3b
.previous
.section __ex_table,"a"
	.align 4
	.long 1b,4b
	.long 2b,4b
.previous") ("=r") 0[ 
                (reg:DI 1 %edx)
                (reg:SI 0 %eax)
                (const_int -14 [0xfffffff2])
                (reg:SI 3 %ebx)
            ] 
            [ 
                (asm_input:DI ("A"))
                (asm_input:SI ("r"))
                (asm_input:SI ("i"))
                (asm_input:SI ("0"))
            ]  ("fs/readdir.c") 277)) -1 (insn_list 112 (insn_list 119 (insn_list 137 (nil))))
    (nil))
make[1]: *** [fs/readdir.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [fs] Error 2

  reply	other threads:[~2003-05-09  4:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-09  2:03 [PATCH] i386 uaccess to fixmap pages Roland McGrath
2003-05-09  4:31 ` Andrew Morton [this message]
2003-05-09  8:55   ` Roland McGrath
2003-05-09  9:19     ` Andrew Morton
2003-05-09  9:40       ` Roland McGrath
2003-05-09 10:43       ` Roland McGrath
2003-05-09 11:42         ` Dave Jones
2003-05-09 11:55         ` Alan Cox
2003-05-09 12:40     ` Jamie Lokier
2003-05-09 16:06       ` Linus Torvalds
2003-05-09 16:38         ` Dave Hansen
2003-05-09 15:55           ` Martin J. Bligh
2003-05-09 18:20             ` William Lee Irwin III
2003-05-09 16:48           ` Linus Torvalds
2003-05-09 17:16             ` Dave Hansen
2003-05-10  3:26         ` H. Peter Anvin
2003-05-10 15:31           ` Jamie Lokier
2003-05-10 17:23             ` Ulrich Drepper
2003-05-10 19:23             ` H. Peter Anvin
2003-05-10 20:52               ` Jamie Lokier
2003-05-09 17:28 Chuck Ebbert
2003-05-09 17:49 ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030508213119.58dd490d.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).