From: Arnd Bergmann <arnd@arndb.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
mingo@kernel.org, tglx@linutronix.de, akpm@linux-foundation.org,
hjl.tools@gmail.com
Subject: Re: [PATCH 02/30] x86-64: Use explicit sizes in sigcontext.h, prepare for x32
Date: Wed, 22 Feb 2012 21:23:38 +0000 [thread overview]
Message-ID: <201202222123.38816.arnd@arndb.de> (raw)
In-Reply-To: <4F453086.8030602@zytor.com>
On Wednesday 22 February 2012, H. Peter Anvin wrote:
> On 02/22/2012 04:22 AM, Arnd Bergmann wrote:
> > On Monday 20 February 2012, H. Peter Anvin wrote:
> >> We are using __u64 as x86-32 compatible since we are sharing most of the
> >> really complex path (like ioctl) with i386 much more so than x86-64. So
> >> it is defined in userspace as:
> >>
> >> typedef unsigned long long __u64 __attribute__((aligned(4)));
> >>
> >> __aligned_u64 obviously is naturally aligned, which matches uint64_t is
> >> userspace.
> >
> > Has someone audited the interfaces to check if there are data structures that
> > use a plain signed or unsigned "long long" instead of __s64/__u64 in places
> > where i386 differs from the other compat implementations?
> >
> > I found DRM_IOCTL_UPDATE_DRAW, but there could be more like this one.
> >
>
> Has someone audited every single ioctl in the kernel? Definitely not,
> which is why x32 is marked EXPERIMENTAL. I think it is still time for
> this work to switch to happening in the upstream, however.
Depends on how you want to do it. In some cases, the easiest answer
would be to change the data structure to use __u64 and be compatible
with i386. Once there are distros built using data structure with
padding around a long long, you have to use a run-time conditional
in the compat handler.
I'd say we should fix at least the ones that are easy to spot because
they already use compat_u64 or have an #ifdef CONFIG_X86_64 in compat
code. I've looked at everything I could find that fits into that category
and found only two locations. My expectation is that all other data
structures that would fall into this category are already broken
for 32 bit emulation on x86.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 49d94ed..73b7c33 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -438,7 +438,7 @@ struct drm_update_draw {
drm_drawable_t handle;
unsigned int type;
unsigned int num;
- unsigned long long data;
+ __u64 data;
};
/**
diff --git a/include/sound/asound.h b/include/sound/asound.h
index a2e4ff5..a17e96c 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -824,8 +824,8 @@ struct snd_ctl_elem_value {
long *value_ptr; /* obsoleted */
} integer;
union {
- long long value[64];
- long long *value_ptr; /* obsoleted */
+ __s64 value[64];
+ __s64 *value_ptr; /* obsoleted */
} integer64;
union {
unsigned int item[128];
Arnd
next prev parent reply other threads:[~2012-02-22 21:24 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 0:07 [PATCH 00/30] RFC: x32 support H. Peter Anvin
2012-02-20 0:07 ` [PATCH 01/30] x86: Factor out TIF_IA32 from 32-bit address space H. Peter Anvin
2012-02-20 0:07 ` [PATCH 02/30] x86-64: Use explicit sizes in sigcontext.h, prepare for x32 H. Peter Anvin
2012-02-20 0:51 ` Linus Torvalds
2012-02-20 0:56 ` H. Peter Anvin
2012-02-22 12:22 ` Arnd Bergmann
2012-02-22 12:22 ` Arnd Bergmann
2012-02-22 18:14 ` H. Peter Anvin
2012-02-22 21:23 ` Arnd Bergmann [this message]
2012-02-22 21:55 ` H. Peter Anvin
2012-02-22 21:55 ` H. Peter Anvin
2012-02-24 2:33 ` H. Peter Anvin
2012-03-06 5:25 ` H. Peter Anvin
2012-02-20 0:07 ` [PATCH 03/30] sysinfo: Move struct sysinfo to a separate header file H. Peter Anvin
2012-02-20 0:07 ` H. Peter Anvin
2012-02-20 0:07 ` [PATCH 04/30] posix_types: Introduce __kernel_[u]long_t H. Peter Anvin
2012-02-20 0:07 ` [PATCH 05/30] x32: Create posix_types_x32.h H. Peter Anvin
2012-02-20 0:07 ` [PATCH 06/30] sysinfo: Use explicit types in <linux/sysinfo.h> H. Peter Anvin
2012-02-20 12:12 ` Geert Uytterhoeven
2012-02-20 17:29 ` H. Peter Anvin
2012-02-20 20:01 ` Geert Uytterhoeven
2012-02-20 20:44 ` H. Peter Anvin
2012-02-20 0:07 ` [PATCH 07/30] compat: Introduce COMPAT_USE_64BIT_TIME H. Peter Anvin
2012-02-20 0:07 ` H. Peter Anvin
2012-02-20 0:07 ` [PATCH 08/30] compat: Use COMPAT_USE_64BIT_TIME in the lp driver H. Peter Anvin
2012-02-20 0:56 ` Linus Torvalds
2012-02-20 0:59 ` H. Peter Anvin
2012-02-20 2:22 ` [PATCH 0/7] COMPAT_USE_64BIT_TIME v2 H. Peter Anvin
2012-02-20 2:22 ` [PATCH 1/7] compat: Introduce COMPAT_USE_64BIT_TIME H. Peter Anvin
2012-02-20 2:22 ` H. Peter Anvin
2012-02-20 2:22 ` [PATCH 2/7] compat: Add helper functions to read/write struct timeval, timespec H. Peter Anvin
2012-02-20 2:22 ` [PATCH 3/7] compat: Handle COMPAT_USE_64BIT_TIME in the lp driver H. Peter Anvin
2012-02-20 2:22 ` [PATCH 4/7] compat: Use COMPAT_USE_64BIT_TIME in the input subsystem H. Peter Anvin
2012-02-20 2:22 ` [PATCH 5/7] compat: Use COMPAT_USE_64BIT_TIME in the Bluetooth subsystem H. Peter Anvin
2012-02-20 2:22 ` [PATCH 6/7] compat: Use COMPAT_USE_64BIT_TIME in net/compat.c H. Peter Anvin
2012-02-20 2:22 ` [PATCH 7/7] compat: Handle COMPAT_USE_64BIT_TIME in net/socket.c H. Peter Anvin
2012-02-20 2:42 ` [PATCH 0/7] COMPAT_USE_64BIT_TIME v2 H. Peter Anvin
2012-02-20 6:22 ` H. Peter Anvin
2012-02-20 0:07 ` [PATCH 09/30] compat: Use COMPAT_USE_64BIT_TIME in the input subsystem H. Peter Anvin
2012-02-20 0:07 ` [PATCH 10/30] compat: Use COMPAT_USE_64BIT_TIME in the Bluetooth subsystem H. Peter Anvin
2012-02-21 19:05 ` Gustavo Padovan
2012-02-21 19:15 ` H. Peter Anvin
2012-02-21 19:15 ` H. Peter Anvin
2012-02-22 13:47 ` Jiri Kosina
2012-02-22 13:47 ` Jiri Kosina
2012-02-22 14:45 ` Gustavo Padovan
2012-02-20 0:07 ` [PATCH 11/30] aio: Use __kernel_ulong_t to define aio_context_t H. Peter Anvin
2012-02-20 0:07 ` [PATCH 12/30] compat: Create compat_sys_p{read,write}v64 H. Peter Anvin
2012-02-20 0:07 ` [PATCH 13/30] elf: Allow core dump-related fields to be overridden H. Peter Anvin
2012-02-20 0:07 ` [PATCH 14/30] x86-64: Add prototype for old_rsp to a header file H. Peter Anvin
2012-02-20 0:07 ` [PATCH 15/30] x32: Add a thread flag for x32 processes H. Peter Anvin
2012-02-20 0:07 ` [PATCH 16/30] x86-64, ia32: Drop sys32_rt_sigprocmask H. Peter Anvin
2012-02-20 0:07 ` [PATCH 17/30] x32: Add x32 system calls to syscall/syscall_64.tbl H. Peter Anvin
2012-02-20 0:07 ` [PATCH 18/30] x32: Generate <asm/unistd_x32.h> H. Peter Anvin
2012-02-20 0:07 ` [PATCH 19/30] x32: Generate <asm/unistd_64_x32.h> H. Peter Anvin
2012-02-20 0:07 ` [PATCH 20/30] x86: Move some signal-handling definitions to a common header H. Peter Anvin
2012-02-20 0:07 ` [PATCH 21/30] x32: Export setup/restore_sigcontext from signal.c H. Peter Anvin
2012-02-20 0:08 ` [PATCH 22/30] x32: Add struct ucontext_x32 H. Peter Anvin
2012-02-20 0:08 ` [PATCH 23/30] x32: Add rt_sigframe_x32 H. Peter Anvin
2012-02-20 0:08 ` [PATCH 24/30] x32: Handle the x32 system call flag H. Peter Anvin
2012-02-20 0:08 ` [PATCH 25/30] x86: Add #ifdef CONFIG_COMPAT to <asm/sys_ia32.h> H. Peter Anvin
2012-02-20 0:08 ` [PATCH 26/30] x32: Signal-related system calls H. Peter Anvin
2012-02-20 0:08 ` [PATCH 27/30] x32: Handle process creation H. Peter Anvin
2012-02-20 0:08 ` [PATCH 28/30] x32: If configured, add x32 system calls to system call tables H. Peter Anvin
2012-02-20 0:08 ` [PATCH 29/30] x32: Allow x32 to be configured H. Peter Anvin
2012-02-20 0:08 ` [PATCH 30/30] x32: Add x32 VDSO support H. Peter Anvin
2012-02-21 0:12 ` Andy Lutomirski
2012-02-21 0:12 ` Andy Lutomirski
2012-02-21 3:58 ` H. Peter Anvin
2012-02-21 16:52 ` Andrew Lutomirski
2012-02-21 17:51 ` H. Peter Anvin
2012-02-21 18:54 ` Andrew Lutomirski
2012-02-21 19:03 ` H. Peter Anvin
2012-02-21 19:29 ` Andrew Lutomirski
2012-02-21 19:37 ` H. Peter Anvin
2012-02-21 19:40 ` Andrew Lutomirski
2012-02-21 19:40 ` Andrew Lutomirski
2012-02-21 19:49 ` H. Peter Anvin
2012-02-21 19:51 ` Andrew Lutomirski
2012-02-21 19:51 ` Andrew Lutomirski
2012-02-21 19:56 ` H. Peter Anvin
2012-02-21 19:56 ` H. Peter Anvin
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=201202222123.38816.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=hjl.tools@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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).