public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kyle McMartin <kmcmarti@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, linux-aio@kvack.org,
	Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH] x32: use compat shims for io_{setup,submit}
Date: Mon, 5 May 2014 11:33:49 -0400	[thread overview]
Message-ID: <20140505153348.GA674@redacted.bos.redhat.com> (raw)
In-Reply-To: <1399250595-5005-1-git-send-email-vapier@gentoo.org>

On Sun, May 04, 2014 at 08:43:15PM -0400, Mike Frysinger wrote:
> The io_setup takes a pointer to a context id of type aio_context_t.
> This in turn is typed to a __kernel_ulong_t.  We could tweak the
> exported headers to define this as a 64bit quantity for specific
> ABIs, but since we already have a 32bit compat shim for the x86 ABI,
> let's just re-use that logic.  The libaio package is also written to
> expect this as a pointer type, so a compat shim would simplify that.
> 
> The io_submit func operates on an array of pointers to iocb structs.
> Padding out the array to be 64bit aligned is a huge pain, so convert
> it over to the existing compat shim too.
> 
> We don't convert io_getevents to the compat func as its only purpose
> is to handle the timespec struct, and the x32 ABI uses 64bit times.
> 
> With this change, the libaio package can now pass its testsuite when
> built for the x32 ABI.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

yeah, this looks like it should fix the issue in a much simpler way.
nice work Mike.

regards, Kyle

> ---
>  arch/x86/syscalls/syscall_64.tbl | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
> index 04376ac..ec255a1 100644
> --- a/arch/x86/syscalls/syscall_64.tbl
> +++ b/arch/x86/syscalls/syscall_64.tbl
> @@ -212,10 +212,10 @@
>  203	common	sched_setaffinity	sys_sched_setaffinity
>  204	common	sched_getaffinity	sys_sched_getaffinity
>  205	64	set_thread_area
> -206	common	io_setup		sys_io_setup
> +206	64	io_setup		sys_io_setup
>  207	common	io_destroy		sys_io_destroy
>  208	common	io_getevents		sys_io_getevents
> -209	common	io_submit		sys_io_submit
> +209	64	io_submit		sys_io_submit
>  210	common	io_cancel		sys_io_cancel
>  211	64	get_thread_area
>  212	common	lookup_dcookie		sys_lookup_dcookie
> @@ -359,3 +359,5 @@
>  540	x32	process_vm_writev	compat_sys_process_vm_writev
>  541	x32	setsockopt		compat_sys_setsockopt
>  542	x32	getsockopt		compat_sys_getsockopt
> +543	x32	io_setup		compat_sys_io_setup
> +544	x32	io_submit		compat_sys_io_submit
> -- 
> 1.9.2
> 

      parent reply	other threads:[~2014-05-05 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05  0:43 [PATCH] x32: use compat shims for io_{setup,submit} Mike Frysinger
2014-05-05  0:51 ` [tip:x86/x32] x86, x32: Use " tip-bot for Mike Frysinger
2014-05-05 15:33 ` Kyle McMartin [this message]

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=20140505153348.GA674@redacted.bos.redhat.com \
    --to=kmcmarti@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vapier@gentoo.org \
    --cc=x86@kernel.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