[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL SUBSYSTEM s390x 33/33] linux-user: elf: ELF_HWCAP for
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PULL SUBSYSTEM s390x 33/33] linux-user: elf: ELF_HWCAP for s390x |
Date: |
Wed, 5 Jun 2019 22:34:03 +0200 |
Let's add all HWCAPs that we can support under TCG right now, when the
respective CPU facilities are enabled.
Cc: Riku Voipio <address@hidden>
Cc: Laurent Vivier <address@hidden>
Cc: Cornelia Huck <address@hidden>
Cc: Laurent Vivier <address@hidden>
Cc: Richard Henderson <address@hidden>
Acked-by: Laurent Vivier <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
---
include/elf.h | 1 +
linux-user/elfload.c | 28 ++++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/include/elf.h b/include/elf.h
index ea7708a4ea..3501e0c8d0 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -598,6 +598,7 @@ typedef struct {
#define HWCAP_S390_ETF3EH 256
#define HWCAP_S390_HIGH_GPRS 512
#define HWCAP_S390_TE 1024
+#define HWCAP_S390_VXRS 2048
/* M68K specific definitions. */
/* We use the top 24 bits to encode information about the
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index a57b7049dd..5451d262ec 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1308,6 +1308,34 @@ static inline void init_thread(struct target_pt_regs
*regs,
#define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_S390
+#include "elf.h"
+
+#define ELF_HWCAP get_elf_hwcap()
+
+#define GET_FEATURE(_feat, _hwcap) \
+ do { if (s390_has_feat(_feat)) { hwcap |= _hwcap; } } while (0)
+
+static uint32_t get_elf_hwcap(void)
+{
+ /*
+ * Let's assume we always have esan3 and zarch.
+ * 31-bit processes can use 64-bit registers (high gprs).
+ */
+ uint32_t hwcap = HWCAP_S390_ESAN3 | HWCAP_S390_ZARCH |
HWCAP_S390_HIGH_GPRS;
+
+ GET_FEATURE(S390_FEAT_STFLE, HWCAP_S390_STFLE);
+ GET_FEATURE(S390_FEAT_MSA, HWCAP_S390_MSA);
+ GET_FEATURE(S390_FEAT_LONG_DISPLACEMENT, HWCAP_S390_LDISP);
+ GET_FEATURE(S390_FEAT_EXTENDED_IMMEDIATE, HWCAP_S390_EIMM);
+ if (s390_has_feat(S390_FEAT_EXTENDED_TRANSLATION_3) &&
+ s390_has_feat(S390_FEAT_ETF3_ENH)) {
+ hwcap |= HWCAP_S390_ETF3EH;
+ }
+ GET_FEATURE(S390_FEAT_VECTOR, HWCAP_S390_VXRS);
+
+ return hwcap;
+}
+
static inline void init_thread(struct target_pt_regs *regs, struct image_info
*infop)
{
regs->psw.addr = infop->entry;
--
2.21.0
- [qemu-s390x] [PULL SUBSYSTEM s390x 26/33] s390x/tcg: Implement VECTOR FP SQUARE ROOT, (continued)
- [qemu-s390x] [PULL SUBSYSTEM s390x 26/33] s390x/tcg: Implement VECTOR FP SQUARE ROOT, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 29/33] s390x/tcg: Allow linux-user to use vector instructions, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 10/33] s390x/tcg: Introduce tcg_s390_vector_exception(), David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 31/33] s390x: Bump the "qemu" CPU model up to a stripped-down z13, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 03/33] s390x/tcg: Implement VECTOR FIND ELEMENT NOT EQUAL, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 30/33] s390x/tcg: We support the Vector Facility, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 25/33] s390x/tcg: Implement VECTOR FP PERFORM SIGN OPERATION, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 13/33] s390x/tcg: Implement VECTOR FP COMPARE (AND SIGNAL) SCALAR, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 06/33] s390x: Align vector registers to 16 bytes, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 20/33] s390x/tcg: Implement VECTOR LOAD FP INTEGER, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 33/33] linux-user: elf: ELF_HWCAP for s390x,
David Hildenbrand <=
- [qemu-s390x] [PULL SUBSYSTEM s390x 18/33] s390x/tcg: Implement VECTOR FP CONVERT TO LOGICAL 64-BIT, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 21/33] s390x/tcg: Implement VECTOR LOAD LENGTHENED, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 22/33] s390x/tcg: Implement VECTOR LOAD ROUNDED, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 14/33] s390x/tcg: Implement VECTOR FP COMPARE (EQUAL|HIGH|HIGH OR EQUAL), David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 28/33] s390x/tcg: Implement VECTOR FP TEST DATA CLASS IMMEDIATE, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 11/33] s390x/tcg: Export float_comp_to_cc() and float(32|64|128)_dcmask(), David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 32/33] s390x/tcg: Use tcg_gen_gvec_bitsel for VECTOR SELECT, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 16/33] s390x/tcg: Implement VECTOR FP CONVERT FROM LOGICAL 64-BIT, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 19/33] s390x/tcg: Implement VECTOR FP DIVIDE, David Hildenbrand, 2019/06/05
- [qemu-s390x] [PULL SUBSYSTEM s390x 24/33] s390x/tcg: Implement VECTOR FP MULTIPLY AND (ADD|SUBTRACT), David Hildenbrand, 2019/06/05