From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: linux-mips@vger.kernel.org
Cc: paul.burton@mips.com, Jiaxun Yang <jiaxun.yang@flygoat.com>,
stable@vger.kernel.org
Subject: [PATCH] MIPS: elf_hwcap: Export microMIPS and vz
Date: Wed, 23 Oct 2019 23:25:51 +0800 [thread overview]
Message-ID: <20191023152551.10535-1-jiaxun.yang@flygoat.com> (raw)
After further discussion with userland library develpoer,
we addressed another two ASEs that can be used runtimely in programs.
Export them in hwcap as well to benefit userspace programs.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: <stable@vger.kernel.org> # 4.4+
---
arch/mips/include/uapi/asm/hwcap.h | 2 ++
arch/mips/kernel/cpu-probe.c | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/mips/include/uapi/asm/hwcap.h b/arch/mips/include/uapi/asm/hwcap.h
index 1ade1daa4921..e1a9bac62149 100644
--- a/arch/mips/include/uapi/asm/hwcap.h
+++ b/arch/mips/include/uapi/asm/hwcap.h
@@ -17,5 +17,7 @@
#define HWCAP_LOONGSON_MMI (1 << 11)
#define HWCAP_LOONGSON_EXT (1 << 12)
#define HWCAP_LOONGSON_EXT2 (1 << 13)
+#define HWCAP_MIPS_MICROMIPS (1 << 14)
+#define HWCAP_MIPS_VZ (1 << 15)
#endif /* _UAPI_ASM_HWCAP_H */
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index f521cbf934e7..11e853d88aae 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -2213,8 +2213,13 @@ void cpu_probe(void)
if (cpu_has_loongson_ext2)
elf_hwcap |= HWCAP_LOONGSON_EXT2;
- if (cpu_has_vz)
+ if (cpu_has_mmips)
+ elf_hwcap |= HWCAP_MIPS_MICROMIPS;
+
+ if (cpu_has_vz) {
+ elf_hwcap |= HWCAP_MIPS_VZ;
cpu_probe_vz(c);
+ }
cpu_probe_vmbits(c);
--
2.23.0
next reply other threads:[~2019-10-23 15:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 15:25 Jiaxun Yang [this message]
2019-10-24 4:06 ` [PATCH] MIPS: elf_hwcap: Export microMIPS and vz Paul Burton
2019-10-24 6:32 ` Jiaxun Yang
2019-10-24 8:13 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191023152551.10535-1-jiaxun.yang@flygoat.com \
--to=jiaxun.yang@flygoat.com \
--cc=linux-mips@vger.kernel.org \
--cc=paul.burton@mips.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).