From: Laurent Vivier <laurent@vivier.eu>
To: Peter Maydell <peter.maydell@linaro.org>,
"Wirth, Allan" <awirth@akamai.com>
Cc: "qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
Riku Voipio <riku.voipio@iki.fi>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Timothy Pearson <tpearson@raptorengineering.com>
Subject: Re: [Qemu-devel] [PATCH] linux-user: fix signal() syscall on x86_64
Date: Sat, 2 Jul 2016 10:20:46 +0200 [thread overview]
Message-ID: <164e58f5-7dcc-bc9f-286f-98b5de56c1cb@vivier.eu> (raw)
In-Reply-To: <CAFEAcA9VxFBB7BYBWY1gtHeScPkPehoh6SMVY-68UGz6RSFS=g@mail.gmail.com>
Le 01/07/2016 à 15:35, Peter Maydell a écrit :
> On 1 July 2016 at 12:59, Wirth, Allan <awirth@akamai.com> wrote:
>> Linux on X86_64 does not use sel_arg_struct for select(), the args are
>> passed directly. This patch switches a define so X86_64 uses the correct
>> calling convention.
>>
>> Signed-off-by: Allan Wirth <awirth@akamai.com>
>> ---
>> linux-user/syscall.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>> index 8bf6205..209b2a7 100644
>> --- a/linux-user/syscall.c
>> +++ b/linux-user/syscall.c
>> @@ -8002,7 +8002,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>> break;
>> #if defined(TARGET_NR_select)
>> case TARGET_NR_select:
>> -#if defined(TARGET_S390X) || defined(TARGET_ALPHA)
>> +#if defined(TARGET_S390X) || defined(TARGET_ALPHA) || defined(TARGET_X86_64)
>> ret = do_select(arg1, arg2, arg3, arg4, arg5);
>> #else
>> {
>
> There is a cleaner approach which we should use to fix this:
> see my comments in reply to this recent patch trying to do
> a similar thing:
> https://patchwork.kernel.org/patch/9185927/
syscall_nr.h are copies of unistd.h from kernel, so kernel uses also
__NR_select and __NR__newselect.
I think the fix can be as simple as:
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8372,7 +8372,7 @@ abi_long do_syscall(void *cpu_env, int num,
abi_long arg1,
break;
#if defined(TARGET_NR_select)
case TARGET_NR_select:
-#if defined(TARGET_S390X) || defined(TARGET_ALPHA)
+#if !defined(TARGET_NR__new_select)
ret = do_select(arg1, arg2, arg3, arg4, arg5);
#else
{
Laurent
next prev parent reply other threads:[~2016-07-02 8:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-01 11:59 [Qemu-devel] [PATCH] linux-user: fix signal() syscall on x86_64 Wirth, Allan
2016-07-01 13:35 ` Peter Maydell
2016-07-01 15:34 ` Wirth, Allan
2016-07-01 16:06 ` Peter Maydell
2016-07-02 8:20 ` Laurent Vivier [this message]
2016-07-02 9:56 ` Peter Maydell
2016-07-02 16:41 ` Laurent Vivier
2016-07-02 20:12 ` Peter Maydell
2016-07-02 21:17 ` Laurent Vivier
2016-07-02 21:20 ` Peter Maydell
2016-07-02 21:28 ` Laurent Vivier
2016-07-07 18:49 ` Riku Voipio
2016-07-07 19:02 ` Laurent Vivier
2016-07-07 19:04 ` Wirth, Allan
2016-07-07 19:09 ` Laurent Vivier
2016-07-07 19:13 ` Wirth, Allan
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=164e58f5-7dcc-bc9f-286f-98b5de56c1cb@vivier.eu \
--to=laurent@vivier.eu \
--cc=awirth@akamai.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=tpearson@raptorengineering.com \
/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).