提交 6d73a72e 编写于 作者: Y Yury Norov 提交者: Yang Yingliang

arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32

hulk inclusion
category: feature
bugzilla: NA
CVE: NA
---------------------------

ILP32 patch series introduces new type of binaries which is also compat.
So rename existung aarch32 compat_elf_hwcap's helps to avoid confusing.
Signed-off-by: NYury Norov <ynorov@caviumnetworks.com>
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NHanjun Guo &lt;guohanjun@huawei.com <mailto:guohanjun@huawei.com&gt;>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 b62efc34
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#define ELF_HWCAP (elf_hwcap) #define ELF_HWCAP (elf_hwcap)
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_AARCH32_EL0
extern unsigned int compat_elf_hwcap, compat_elf_hwcap2; extern unsigned int a32_elf_hwcap, a32_elf_hwcap2;
#endif #endif
enum { enum {
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
}) })
#define COMPAT_ARCH_DLINFO #define COMPAT_ARCH_DLINFO
#define COMPAT_ELF_HWCAP (compat_elf_hwcap) #define COMPAT_ELF_HWCAP (a32_elf_hwcap)
#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2) #define COMPAT_ELF_HWCAP2 (a32_elf_hwcap2)
#define compat_arch_setup_additional_pages \ #define compat_arch_setup_additional_pages \
aarch32_setup_vectors_page aarch32_setup_vectors_page
......
...@@ -39,13 +39,13 @@ unsigned long elf_hwcap __read_mostly; ...@@ -39,13 +39,13 @@ unsigned long elf_hwcap __read_mostly;
EXPORT_SYMBOL_GPL(elf_hwcap); EXPORT_SYMBOL_GPL(elf_hwcap);
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_AARCH32_EL0
#define COMPAT_ELF_HWCAP_DEFAULT \ #define AARCH32_EL0_ELF_HWCAP_DEFAULT \
(COMPAT_HWCAP_HALF|COMPAT_HWCAP_THUMB|\ (COMPAT_HWCAP_HALF|COMPAT_HWCAP_THUMB|\
COMPAT_HWCAP_FAST_MULT|COMPAT_HWCAP_EDSP|\ COMPAT_HWCAP_FAST_MULT|COMPAT_HWCAP_EDSP|\
COMPAT_HWCAP_TLS|COMPAT_HWCAP_IDIV|\ COMPAT_HWCAP_TLS|COMPAT_HWCAP_IDIV|\
COMPAT_HWCAP_LPAE) COMPAT_HWCAP_LPAE)
unsigned int compat_elf_hwcap __read_mostly = COMPAT_ELF_HWCAP_DEFAULT; unsigned int a32_elf_hwcap __read_mostly = AARCH32_EL0_ELF_HWCAP_DEFAULT;
unsigned int compat_elf_hwcap2 __read_mostly; unsigned int a32_elf_hwcap2 __read_mostly;
#endif #endif
DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS); DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS);
...@@ -1621,10 +1621,10 @@ static void __init cap_set_elf_hwcap(const struct arm64_cpu_capabilities *cap) ...@@ -1621,10 +1621,10 @@ static void __init cap_set_elf_hwcap(const struct arm64_cpu_capabilities *cap)
break; break;
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_AARCH32_EL0
case CAP_COMPAT_HWCAP: case CAP_COMPAT_HWCAP:
compat_elf_hwcap |= (u32)cap->hwcap; a32_elf_hwcap |= (u32)cap->hwcap;
break; break;
case CAP_COMPAT_HWCAP2: case CAP_COMPAT_HWCAP2:
compat_elf_hwcap2 |= (u32)cap->hwcap; a32_elf_hwcap2 |= (u32)cap->hwcap;
break; break;
#endif #endif
default: default:
...@@ -1644,10 +1644,10 @@ static bool cpus_have_elf_hwcap(const struct arm64_cpu_capabilities *cap) ...@@ -1644,10 +1644,10 @@ static bool cpus_have_elf_hwcap(const struct arm64_cpu_capabilities *cap)
break; break;
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_AARCH32_EL0
case CAP_COMPAT_HWCAP: case CAP_COMPAT_HWCAP:
rc = (compat_elf_hwcap & (u32)cap->hwcap) != 0; rc = (a32_elf_hwcap & (u32)cap->hwcap) != 0;
break; break;
case CAP_COMPAT_HWCAP2: case CAP_COMPAT_HWCAP2:
rc = (compat_elf_hwcap2 & (u32)cap->hwcap) != 0; rc = (a32_elf_hwcap2 & (u32)cap->hwcap) != 0;
break; break;
#endif #endif
default: default:
......
...@@ -126,7 +126,7 @@ static const char *const compat_hwcap2_str[] = { ...@@ -126,7 +126,7 @@ static const char *const compat_hwcap2_str[] = {
static int c_show(struct seq_file *m, void *v) static int c_show(struct seq_file *m, void *v)
{ {
int i, j; int i, j;
bool compat = personality(current->personality) == PER_LINUX32; bool aarch32 = personality(current->personality) == PER_LINUX32;
for_each_online_cpu(i) { for_each_online_cpu(i) {
struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i); struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
...@@ -138,7 +138,7 @@ static int c_show(struct seq_file *m, void *v) ...@@ -138,7 +138,7 @@ static int c_show(struct seq_file *m, void *v)
* "processor". Give glibc what it expects. * "processor". Give glibc what it expects.
*/ */
seq_printf(m, "processor\t: %d\n", i); seq_printf(m, "processor\t: %d\n", i);
if (compat) if (aarch32)
seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n", seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
MIDR_REVISION(midr), COMPAT_ELF_PLATFORM); MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
...@@ -153,14 +153,14 @@ static int c_show(struct seq_file *m, void *v) ...@@ -153,14 +153,14 @@ static int c_show(struct seq_file *m, void *v)
* software which does already (at least for 32-bit). * software which does already (at least for 32-bit).
*/ */
seq_puts(m, "Features\t:"); seq_puts(m, "Features\t:");
if (compat) { if (aarch32) {
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_AARCH32_EL0
for (j = 0; compat_hwcap_str[j]; j++) for (j = 0; compat_hwcap_str[j]; j++)
if (compat_elf_hwcap & (1 << j)) if (a32_elf_hwcap & (1 << j))
seq_printf(m, " %s", compat_hwcap_str[j]); seq_printf(m, " %s", compat_hwcap_str[j]);
for (j = 0; compat_hwcap2_str[j]; j++) for (j = 0; compat_hwcap2_str[j]; j++)
if (compat_elf_hwcap2 & (1 << j)) if (a32_elf_hwcap2 & (1 << j))
seq_printf(m, " %s", compat_hwcap2_str[j]); seq_printf(m, " %s", compat_hwcap2_str[j]);
#endif /* CONFIG_AARCH32_EL0 */ #endif /* CONFIG_AARCH32_EL0 */
} else { } else {
......
...@@ -822,7 +822,7 @@ static void arch_timer_evtstrm_enable(int divider) ...@@ -822,7 +822,7 @@ static void arch_timer_evtstrm_enable(int divider)
arch_timer_set_cntkctl(cntkctl); arch_timer_set_cntkctl(cntkctl);
elf_hwcap |= HWCAP_EVTSTRM; elf_hwcap |= HWCAP_EVTSTRM;
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_AARCH32_EL0
compat_elf_hwcap |= COMPAT_HWCAP_EVTSTRM; a32_elf_hwcap |= COMPAT_HWCAP_EVTSTRM;
#endif #endif
cpumask_set_cpu(smp_processor_id(), &evtstrm_available); cpumask_set_cpu(smp_processor_id(), &evtstrm_available);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册