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]
Date:	Fri, 2 Sep 2011 21:44:26 -0700
From:	"H.J. Lu" <hjl.tools@...il.com>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Arnd Bergmann <arnd@...db.de>,
	Christoph Hellwig <hch@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>, 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 Fri, Sep 2, 2011 at 9:29 PM, H. Peter Anvin <hpa@...or.com> wrote:
> On 09/02/2011 09:02 PM, H.J. Lu wrote:
>>
>> I defined __SNATIVE_LONG_TYPE and  __UNATIVE_LONG_TYPE
>> in x32 header, which are native signed and unsigned long types. I
>> used them in
>>
>
> What is the definition of these macros?
>

I have

#if defined __x86_64__ && __WORDSIZE == 32
#define __INO_T_TYPE		__UQUAD_TYPE
#define __NLINK_T_TYPE		__UQUAD_TYPE
#define __OFF_T_TYPE		__SQUAD_TYPE
#define __RLIM_T_TYPE		__UQUAD_TYPE
#define	__BLKCNT_T_TYPE		__SQUAD_TYPE
#define	__FSFILCNT_T_TYPE	__UQUAD_TYPE
#define	__FSBLKCNT_T_TYPE	__UQUAD_TYPE
#define __TIME_T_TYPE		__SQUAD_TYPE
#define __BLKSIZE_T_TYPE	__SQUAD_TYPE
#define __SUSECONDS_T_TYPE	__SQUAD_TYPE
#define __SNATIVE_LONG_TYPE	__SQUAD_TYPE
#define __UNATIVE_LONG_TYPE	__UQUAD_TYPE
#else
#define __INO_T_TYPE		__ULONGWORD_TYPE
#define __NLINK_T_TYPE		__UWORD_TYPE
#define __OFF_T_TYPE		__SLONGWORD_TYPE
#define __RLIM_T_TYPE		__ULONGWORD_TYPE
#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
#define __TIME_T_TYPE		__SLONGWORD_TYPE
#define __BLKSIZE_T_TYPE	__SLONGWORD_TYPE
#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
#define __SNATIVE_LONG_TYPE	__SLONGWORD_TYPE
#define __UNATIVE_LONG_TYPE	__ULONGWORD_TYPE
#endif

There is one problem with:

int sysinfo(struct sysinfo *info);

struct sysinfo comes from <linux/kernel.h>:

struct sysinfo {
	long uptime;			/* Seconds since boot */
	unsigned long loads[3];		/* 1, 5, and 15 minute load averages */
	unsigned long totalram;		/* Total usable main memory size */
	unsigned long freeram;		/* Available memory size */
	unsigned long sharedram;	/* Amount of shared memory */
	unsigned long bufferram;	/* Memory used by buffers */
	unsigned long totalswap;	/* Total swap space size */
	unsigned long freeswap;		/* swap space still available */
	unsigned short procs;		/* Number of current processes */
	unsigned short pad;		/* explicit padding for m68k */
	unsigned long totalhigh;	/* Total high memory size */
	unsigned long freehigh;		/* Available high memory size */
	unsigned int mem_unit;		/* Memory unit size in bytes */
	char _f[20-2*sizeof(long)-sizeof(int)];	/* Padding: libc5 uses this.. */
};

I couldn't find a clean way to use long long for x32.  I wind up calling
compat_sys_sysinfo.  Also linux/aio_abi.h has

typedef unsigned long	aio_context_t;

I had to use compat_sys_io_setup for

int io_setup(unsigned nr_events, aio_context_t *ctxp);

Is there a way to support something similar to  __SNATIVE_LONG_TYPE
and  __UNATIVE_LONG_TYPE for kernel header files.


-- 
H.J.
--
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