Message ID | 20191023152551.10535-1-jiaxun.yang@flygoat.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
Series | MIPS: elf_hwcap: Export microMIPS and vz | expand |
Hi Jiaxun, On Wed, Oct 23, 2019 at 11:25:51PM +0800, Jiaxun Yang wrote: > 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) What's the motivation for exposing VZ? Userland can't actually use it without something like KVM, which already exposes a means of detecting whether VZ is supported (try the creating a VM of type KVM_VM_MIPS_VZ & see if it works). I'm not sure what userland would be able to do with this information in AT_HWCAP. Thanks, Paul > #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 >
于 2019年10月24日 GMT+08:00 下午12:06:24, Paul Burton <paulburton@kernel.org> 写到: >Hi Jiaxun, > >On Wed, Oct 23, 2019 at 11:25:51PM +0800, Jiaxun Yang wrote: >> 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) > >What's the motivation for exposing VZ? Userland can't actually use it >without something like KVM, which already exposes a means of detecting >whether VZ is supported (try the creating a VM of type KVM_VM_MIPS_VZ & >see if it works). I'm not sure what userland would be able to do with >this information in AT_HWCAP Hi Paul, Well, that was preposed by a kvm developer from Loongson. They want to use it to implement CPU_AUTOPROBE and load required modules automatically. As they said they will submit KVM support to mainline later, I'm just occupied a place for them. Out of tree commit: http://cgit.loongnix.org/cgit/linux-3.10/commit/?id=4db9301cca3b49358d46fd0da67c01ab2ae4a3e3
Hello! On 23.10.2019 18:25, Jiaxun Yang wrote: > After further discussion with userland library develpoer, Developer. :-) > we addressed another two ASEs that can be used runtimely in programs. I'm afraid there's no such word "runtimely". It's "at run time" probably... > 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+ [...] MBR, Sergei
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);
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(-)