qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] s390 host support


From: Ulrich Hecht
Subject: Re: [Qemu-devel] s390 host support
Date: Mon, 12 Nov 2007 18:14:43 +0100
User-agent: KMail/1.9.6 (enterprise 20070904.708012)

On Saturday 10 November 2007, Bastian Blank wrote:
> Thimo Seufer asked me to check if the s390 host supports works at all.
> It did not even build, dyngen failed.

A 31-bit build of the CVS code works fine for me. (At least if I add the 
br %rANY fix that is also in your patch and the jcc patch that Thiemo 
has not committed yet.)

A 31-bit build using your patch works as well, but it also needs the jcc 
patch. The only reason it needs to be compiled with -march=z900 is the 
use of larl in the inline assembly code, which can be avoided by simply 
omitting it in the PARAMx macros (the bras already writes the address to 
the register) and reverting to the code currently in CVS for 
GOTO_LABEL_PARAM. (The GOTO_TB hack does not seem to be necessary any 
more.)

> I digged into the problem and 
> found the following:
> gcc for s390 generates a data table after each function if necessary
> instead of immediate loads.

It actually generates it inline, doing something like

op_something:
bras %r13, 8
.long <some data>
...

In other words, it branches over the data, storing the "return address" 
(which is actually a pointer to the data) in r13.

> (g5, the oldest supported processor only 
> suports one halfword immediate load.) dyngen is not prepared for that
> and fails.

> I found that gcc moves this data into the .rodata section 
> if generating code for z900 and above, which looked like a possible
> way to support this.

(My) GCC only does this when generating 64-bit code.

> - Support R_390_PC32DBL relocation, including relocations into
> sections.

Again, my GCC only generates this relocation when compiling 64-bit code. 
With your patch and some obvious fixes (ELFCLASS64, GETPC, 
$hostlongbits)) it builds as 64-bit, but it segfaults in the first 
translation block.

CU
Uli

-- 
Heute ist
- Dr. Sun Yat-sens Geburtstag (in Taiwan)
- Gedenktag (in Bermuda, Cayman-Inseln)
- Tag der Veteranen (in den USA (26 Staaten))
- Unabhängigkeit von Cartagena (in Kolumbien)

SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]