[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] linux-user: ppc64: AT_HWCAP bits and e5500 (e500mc, too?)
From: |
Michael Walle |
Subject: |
[Qemu-ppc] linux-user: ppc64: AT_HWCAP bits and e5500 (e500mc, too?) |
Date: |
Mon, 25 Jul 2016 17:14:42 +0200 |
User-agent: |
Roundcube Webmail/1.1.5 |
Hi,
ok this was a tough one. Programs which links to ceil() aborts with
invalid instruction. The instruction was "frip", which isn't supported
on e5500 or e500mc. Turns out the libc checks the AT_HWCAP field (dunno
if that has to do with multilib support) and uses the optimized power5
code if the ARCH_2_06 bit is set. linux-user sets the ARCH_2_06 bit in
case of a e5500 core, which is wrong IMHO. In fact the linux kernel sets
this bit only for POWER[789] CPUs.
The line which sets this bit in linux-user is:
#define GET_FEATURE2(flag, feature)
\
do { if (cpu->env.insns_flags2 & flag) { features |= feature; } }
while (0)
GET_FEATURE2((PPC2_PERM_ISA206 | PPC2_DIVE_ISA206 | PPC2_ATOMIC_ISA206 |
PPC2_FP_CVT_ISA206 | PPC2_FP_TST_ISA206),
QEMU_PPC_FEATURE_ARCH_2_06);
PPC2_PERM_ISA206 is set for the e5500/e500mc core. Is this really
intended to set the ARCH_2_06 bit if _any_ of the listed bits is set or
should it set the ARCH_2_06 bit only if _all_ bits are set. Eg.
#define GET_FEATURES(flag, feature)
do { if (cpu->env.insns_flags2 & flag == flag) { features |=
feature; } } while (0)
-michael
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-ppc] linux-user: ppc64: AT_HWCAP bits and e5500 (e500mc, too?),
Michael Walle <=