From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: Multicall result missing sign extension in Xen or Linux
Date: Fri, 03 Aug 2012 12:00:21 -0700 [thread overview]
Message-ID: <501C1FC5.40405@goop.org> (raw)
In-Reply-To: <501C1F14.9000505@tycho.nsa.gov>
On 08/03/2012 11:57 AM, Daniel De Graaf wrote:
> While trying to figure out why a failing component of a multicall did not
> properly return its result, I discovered that multicall results are not
> sign-extended when placed in the unsigned long result field. For hypercalls
> such as do_mmu_update which return a (signed) int, this results in Linux
> incorrectly thinking the hypercall succeeded when it has actually failed
> since arch/x86/xen/multicalls.c uses a signed long for "result" and checks
> (b->entries[i].result < 0).
>
> Is this a bug in Xen (using the wrong return type for do_mmu_op and other
> hypercalls) or in Linux (assuming all returns are signed longs)? One or the
> other needs to be changed, because the current setup is silently hiding
> failed memory mapping operations.
>
Ah, that explains a long-standing mystery for me that I never got around
to investigating.
If Xen is populating a 64-bit result with non-signed-extended 32-bit
result, then it sounds like a Xen bug, but one that's effectively baked
into the ABI now. Is there any risk of the unextended 32bit error being
ambiguously confused with a legitimate result?
J
next prev parent reply other threads:[~2012-08-03 19:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 18:57 Multicall result missing sign extension in Xen or Linux Daniel De Graaf
2012-08-03 19:00 ` Jeremy Fitzhardinge [this message]
2012-08-03 19:26 ` Daniel De Graaf
2012-08-03 21:26 ` Keir Fraser
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=501C1FC5.40405@goop.org \
--to=jeremy@goop.org \
--cc=dgdegra@tycho.nsa.gov \
--cc=konrad.wilk@oracle.com \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.