qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP
@ 2016-08-16 13:40 Michael Walle
  2016-08-16 14:50 ` no-reply
  2016-09-20  2:23 ` David Gibson
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Walle @ 2016-08-16 13:40 UTC (permalink / raw)
  To: Riku Voipio
  Cc: Alexander Graf, qemu-ppc, qemu-devel, Tom Musta, Michael Walle

Only the POWER[789] CPUs should have the ARCH_206 bit set. This is what the
linux kernel does. I guess this was also the intention of commit 0e019746.
We have to make sure all *206 bits are set.

Signed-off-by: Michael Walle <michael@walle.cc>
---
checkpatch.pl flags one warning, but I think this is a false positive.

 linux-user/elfload.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index f807baf..4945d48 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -742,7 +742,8 @@ static uint32_t get_elf_hwcap(void)
 #define GET_FEATURE(flag, feature)                                      \
     do { if (cpu->env.insns_flags & flag) { features |= feature; } } while (0)
 #define GET_FEATURE2(flag, feature)                                      \
-    do { if (cpu->env.insns_flags2 & flag) { features |= feature; } } while (0)
+    do { if ((cpu->env.insns_flags2 & flag) == flag) \
+         { features |= feature; } } while (0)
     GET_FEATURE(PPC_64B, QEMU_PPC_FEATURE_64);
     GET_FEATURE(PPC_FLOAT, QEMU_PPC_FEATURE_HAS_FPU);
     GET_FEATURE(PPC_ALTIVEC, QEMU_PPC_FEATURE_HAS_ALTIVEC);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-20 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 13:40 [Qemu-devel] [PATCH] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP Michael Walle
2016-08-16 14:50 ` no-reply
2016-09-20  2:23 ` David Gibson
2016-09-20  6:55   ` Michael Walle
2016-09-20 13:12     ` David Gibson

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).