[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3265903.Gp9iD1LkVC@wuerfel>
Date: Fri, 02 Sep 2011 10:02:38 +0200
From: Arnd Bergmann <arnd@...db.de>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Pedro Alves <pedro@...esourcery.com>, Avi Kivity <avi@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Christoph Hellwig <hch@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
"H.J. Lu" <hjl.tools@...il.com>, Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Richard Kuo <rkuo@...eaurora.org>,
Mark Salter <msalter@...hat.com>,
Jonas Bonn <jonas@...thpole.se>,
Tobias Klauser <tklauser@...tanz.ch>
Subject: Re: RFD: x32 ABI system call numbers
On Thursday 01 September 2011 18:51:35 H. Peter Anvin wrote:
> On 09/01/2011 05:49 PM, Pedro Alves wrote:
> >>>
> >>> struct iovec
> >>> {
> >>> void __user *iov_base; /* BSD uses caddr_t (1003.1g requires
> >>> void *) */
> >>> __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
> >>> } __attribute__((x32_abi_64));
> >>>
> >>> typedef long time_t __attribute__((x32_abi_64));
> >>>
> >>> The x32_abi_64 attribute converts pointers and longs back to 64-bit and
> >>> adjusts the alignment accordingly. If we tag all userspace visible
> >>> structures with this attribute, we can use the 64-bit ABI without changes.
> >
> > I would expect no new gcc extension to be needed for that -- there's the
> > mode attribute (you can read DI as 64-bit):
> >
> > typedef void * __kernel_ptr64 __attribute ((mode(DI)));
> >
> > struct iovec
> > {
> > __kernel_ptr64 iov_base;
> > ...
> > };
> >
>
> Does that work for *writing*, too? That might be a very useful little
> escape hatch for some particularly tight corners.
I've tried to use that extension in other contexts without much success,
mostly I believe because gcc back-end support for it needs to be there
but wasn't at the time I tried. If the x32 back-end does this correctly,
you win.
A different gcc extension that might turn out to be useful here is the
named address space extension that lets you annotate a pointer to
be different from other pointers. On the SPU architecture we use this
for the destinction between local 18 bit pointers and 64-bit pointers
into the user process address space.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists