xenomai.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Philippe Gerum <philippe.gerum@gmail.com>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: xenomai@lists.linux.dev, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH dovetail 6.7-6.1 2/2] dovetail: x86: Fix fetching of the first syscall argument from compat tasks
Date: Mon, 26 Feb 2024 18:11:39 +0100	[thread overview]
Message-ID: <CACz9r+mGkGmDNQUeKOMcRx5geUKFfgUHhYj79E8Q6KOP=D7CTw@mail.gmail.com> (raw)
In-Reply-To: <20240226-v6-7-dovetail-rebase-v1-2-2962213b5e9c@siemens.com>

> On x86 there is a small difference in the ABI (= register) where the
> first syscall argument is supplied between the x86_64 (native) and
> compat (i386) case.
>
> On x86_64 the DI register is being used, while i386 used the BX
> register.
>
> The same problem exists for further arguments - handled by
> syscall_get_arguments() - as well. syscall_get_arg0() is dovetail
> specific and is now in sync with syscall_get_arguments().
>
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---

 [snip]

>
>  {
> -       return regs->di;
> +#ifdef CONFIG_IA32_EMULATION
> +       if (task->thread_info.status & TS_COMPAT)
> +               return regs->bx;
> +       else
> +#endif
> +               return regs->di;
>  }
>

Ack. Let's write this without conditional block though, dropping the
useless else branch as well:

 if (IS_ENABLED(CONFIG_IA32_EMULATION) &&
       task->thread_info.status & TS_COMPAT)
           return regs->bx;

return regs->di;

      reply	other threads:[~2024-02-26 17:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 16:29 [PATCH dovetail 6.7-6.1 0/2] dovetail: x86: Fix handling of prctl based compat syscalls Florian Bezdeka
2024-02-26 16:29 ` [PATCH dovetail 6.7-6.1 1/2] dovetail: x86: Fix detection " Florian Bezdeka
2024-02-26 16:29 ` [PATCH dovetail 6.7-6.1 2/2] dovetail: x86: Fix fetching of the first syscall argument from compat tasks Florian Bezdeka
2024-02-26 17:11   ` Philippe Gerum [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='CACz9r+mGkGmDNQUeKOMcRx5geUKFfgUHhYj79E8Q6KOP=D7CTw@mail.gmail.com' \
    --to=philippe.gerum@gmail.com \
    --cc=florian.bezdeka@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@lists.linux.dev \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).