qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Riku Voipio <riku.voipio@iki.fi>,
	Laurent Vivier <laurent@vivier.eu>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2] linux-user: Simplify timerid checks on g_posix_timers range
Date: Fri, 22 Aug 2014 15:41:29 +0200	[thread overview]
Message-ID: <53F74889.1060909@suse.de> (raw)
In-Reply-To: <CAFEAcA-BPTRYjxN8u8LbBDg3y4JnxB0XEr4TjTjeZkb81Mwm-w@mail.gmail.com>

Am 22.08.2014 15:34, schrieb Peter Maydell:
> On 22 August 2014 14:27, Andreas Färber <afaerber@suse.de> wrote:
>> Am 22.08.2014 14:09, schrieb Laurent Vivier:
>>> as in the kernel timer_t is an "int" (as said PMM), you should cast to
>>> "int" to remove garbage on 64bit hosts and check sign ...
>>
>> So maybe that's the bug Alex was trying to fix downstream with the use
>> of unsigned types?
> 
> I imagine the reason the SuSE tree switches to abi_ulong
> for the arg* is that it fixes a bunch of bugs we have where we're
> incorrectly casting a (probably 32 bit) abi_long to a 64 bit signed
> host type and getting a sign-extension, when the semantics of
> those particular syscalls require unsigned values. But conversely
> the change probably means that places which wanted the
> sign-extension are no longer getting it.
> 
> If we were writing this code from scratch then there's probably
> a good argument for making the arg* be the unsigned type
> rather than signed. Unfortunately at this point it's basically
> impossible to change over, because we'd have to audit every
> use of them in a 10,000 line file to determine whether we needed
> to put a cast back in to get sign extension or not. I'd rather we
> just fixed the places that don't want sign-extension, because
> presumably we at least have examples of failing guest programs
> we can use to tell us what the problematic syscalls are...

You snipped the part of my message where I was clearly *not* advocating
to apply Alex' type change but suggested to annotate arg uses with the
actual type, so that intermediate casts can be inserted. If we were to
agree on some system, that could be done incrementally.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2014-08-22 13:41 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
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 [this message]
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=53F74889.1060909@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --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).