From: Ulrich Hecht <uli@suse.de>
To: malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] TCG S/390 backend
Date: Tue, 12 May 2009 13:38:45 +0200 [thread overview]
Message-ID: <200905121338.45589.uli@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0905052221430.2625@linmac.oyster.ru>
On Tuesday 05 May 2009, malc wrote:
> On Tue, 5 May 2009, Ulrich Hecht wrote:
> > Now i386, AMD64, ARM, SH4, and m68k system emulators work. MIPS
> > works at least as well as on an AMD64 host, i.e. the test image from
> > qemu.org just
>
> Should work with '-M mips'.
It complains about a missing "mips_bios.bin" then, which isn't in
pc-bios.
> > sits there without doing anything. The SPARC test image fails with a
> > memory access exception in the target system, but works on an AMD64
> > host, so there probably still is a bug somewhere in the backend.
>
> Tried to compare `-d in_asm' outputs of S390/AMD64 when using
> deterministic execution (`-icount N')?
I found the problem: TCG does not zero- or sign-extend arguments to
function calls. Unlike, for instance, AMD64, 32-bit arithmetic ops on
S/390 leave the upper 32 bits of the destination register untouched, so
there could be any kind of garbage there. If a helper taking a 64-bit
argument is called with the result of such an operation, stuff breaks.
IMO, TCG should do the extension in tcg_reg_alloc_call(), but that seems
to be impossible because it has no information on the types of the input
arguments the callee expects. Working around this in the backend is
hardly possible as it does not have the information either.
I have the suspicion that even on other 64-bit hosts, this only works by
accident (if it does at all): Even if the 32-bit arithmetic op does sign
extension, what if the function argument is a pointer? Depending on the
address, the function may get a value with a lot of F's in front...
Any ideas?
CU
Uli
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
next prev parent reply other threads:[~2009-05-12 11:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-05 12:24 [Qemu-devel] [PATCH] TCG S/390 backend Ulrich Hecht
2009-05-05 18:28 ` malc
2009-05-12 11:38 ` Ulrich Hecht [this message]
2009-05-12 12:29 ` Paul Brook
2009-05-12 12:29 ` malc
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=200905121338.45589.uli@suse.de \
--to=uli@suse.de \
--cc=av1474@comtv.ru \
--cc=qemu-devel@nongnu.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 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).