lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201109020149.10780.pedro@codesourcery.com>
Date:	Fri, 2 Sep 2011 01:49:10 +0100
From:	Pedro Alves <pedro@...esourcery.com>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Avi Kivity <avi@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Arnd Bergmann <arnd@...db.de>,
	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 15:13:30, H. Peter Anvin wrote:
> On 09/01/2011 06:30 AM, Avi Kivity wrote:
> > On 08/31/2011 08:09 PM, H. Peter Anvin wrote:
> >>>  I really think that "x32" should try to aim *VERY* hard at using the
> >>>  64-bit system calls, and seeing itself as being a "32-bit application
> >>>  in a 64-bit world".  That's not just true for time_t (which I think
> >>>  should be 64-bit on anything new that expects to survive for any
> >>>  amount of time), but in general.
> >>
> >> We're trying for it.  The things we're trying to avoid is to muck (too
> >> much) with the compat layer for the mega-multiplex system calls like
> >> ioctl.  We can't just use the 64-bit ioctl because ioctl structures
> >> generally contain pointers.
> >>
> > 
> >      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;
   ...
 };

-- 
Pedro Alves
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ