From: Peter Maydell <peter.maydell@linaro.org>
To: Laurent Vivier <laurent@vivier.eu>
Cc: "Riku Voipio" <riku.voipio@iki.fi>,
"Alexander Graf" <agraf@suse.de>,
"Andreas Färber" <afaerber@suse.de>,
"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] linux-user: Simplify timerid checks on g_posix_timers range
Date: Fri, 22 Aug 2014 14:09:00 +0100 [thread overview]
Message-ID: <CAFEAcA91aLPFW+K+5HB8buTTVJMYRwBgPJ_jQAJgEYhgne6fEg@mail.gmail.com> (raw)
In-Reply-To: <693421969.69050.1408712426550.open-xchange@oxbaltgw21.schlund.de>
On 22 August 2014 14:00, Laurent Vivier <laurent@vivier.eu> wrote:
>> Le 22 août 2014 à 14:29, Alexander Graf <agraf@suse.de> a écrit :
>> On 22.08.14 14:25, Peter Maydell wrote:
>> > It's a number between 0 and 32. That doesn't imply that it has
>> > to be an unsigned variable, and we already have it in a
>> > signed variable arg1...
>>
>> Yes, so the end result will be the same. What's the point of this bike
>> shedding?
Not much, except that it's a smaller and simpler patch if you
just remove the bogus masking.
> On some archs, we can imagine libc/gcc filling only the 32 lower bits (=
> int) of the register during the syscall, and without modifying the 32 upper
> bits (= garbage). You must ignore the 32 upper bits (but you can ignore the
> sign too). I think you can let the mask but remove the sign checking -> your
> patch v1 was good ...
No, this is wrong I think. do_syscall() is passed a set of arguments
of type "abi_long". It's true that the calling convention might be
such that if abi_long is 32 bits and host registers are 64 bits then
the upper half of the host register might be garbage. But in that
case the compiler is obliged to implement casts and other operations
on the variable so they behave correctly. So you never need to worry
about it.
v1 was was definitely wrong. v2 is correct but gratuitously fiddly.
But I don't care enough to actually demand a v3.
thanks
-- PMM
next prev parent reply other threads:[~2014-08-22 13:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 11:56 [Qemu-devel] [PATCH v2] linux-user: Simplify timerid checks on g_posix_timers range Alexander Graf
2014-08-22 12:07 ` Peter Maydell
2014-08-22 12:12 ` Alexander Graf
2014-08-22 12:25 ` Peter Maydell
2014-08-22 12:29 ` Alexander Graf
2014-08-22 13:00 ` Laurent Vivier
2014-08-22 13:09 ` Peter Maydell [this message]
2014-08-22 12:09 ` Laurent Vivier
2014-08-22 13:27 ` Andreas Färber
2014-08-22 13:34 ` Peter Maydell
2014-08-22 13:41 ` Andreas Färber
2014-08-22 13:43 ` Peter Maydell
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=CAFEAcA91aLPFW+K+5HB8buTTVJMYRwBgPJ_jQAJgEYhgne6fEg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).