qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC] Unable to use qemu-ppc to run 32-bit powerpc executables gener


From: Thomas Huth
Subject: Re: [RFC] Unable to use qemu-ppc to run 32-bit powerpc executables generated on gcc110 machine
Date: Mon, 15 Aug 2022 09:47:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

On 12/08/2022 09.03, Pierre Muller wrote:

Le 12/08/2022 à 06:16, Thomas Huth a écrit :
On 11/08/2022 23.38, Pierre Muller wrote:

    I am using qemu to check code generated by Free Pascal compiler
for various CPUs.

    Recently, this allowed me to find out that Free Pascal was generating
wrong instructions, leading to SIGBUS errors using qemu-mips.
    The same binaries worked without troubles on mips test machines,
probably because SIGBUS is handled directly inside the kernel.

    Here I would like to report the problem I get when trying to run
powerpc executables using shared libs generated on gcc110 machine.

    I copied over the needed libraries into a sys-root directory.

    The problem is that the code crashes with a Illegal Instruction
after only a very few instructions:

muller@gcc186:~/pas/check$ ~/sys-root/bin/qemu-ppc -cpu g2 -d in_asm -L
~/sys-root/powerpc-linux ./twide1
[...]
0x3ffc1d60:  f00004d7  xxlxor   v0, v0, v0

qemu: uncaught target signal 4 (Illegal instruction) - core dumped

The problem is the the 'xxlxor' instruction is a VSX extension instruction.

   There is apparently no cpu in the powerpc cpu list that enabled this
extension.
The output of cat /proc/cpuinfo on gcc110 gives that:
.....
processor       : 63
cpu             : POWER7 (architected), altivec supported
clock           : 3550.000000MHz
revision        : 2.1 (pvr 003f 0201)

timebase        : 512000000
platform        : pSeries
model           : IBM,8231-E2B
machine         : CHRP IBM,8231-E2B

    Is there a way to enable cpu features separately for ppc like is done for
x86_64?
Or would it be possible to define a new cpu inside qemu source that would match
the description above?

So you are building on a POWER7 host and try to run the binaries on an
emulated G2? That sounds weird. Why don't you use

   The g2 was just an example, I used a script to iterate
over all possible cpus (as listed by --cpu help),
but I always get a Illegal instruction on xllxor,
because none of the cpu in the least seems to enable VSX
extension.

Ok, I see, so the question is wether it is somehow possible to enable the vector extensions on a 32-bit CPU by default somehow...
CC:-ing Laurent, maybe he knows...

 Thomas




reply via email to

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