Commit 0cbc2659 authored by Will Deacon's avatar Will Deacon

arm64: vdso32: Remove a bunch of #ifdef CONFIG_COMPAT_VDSO guards

Most of the compat vDSO code can be built and guarded using IS_ENABLED,
so drop the unnecessary #ifdefs.
Reviewed-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent f75aef39
...@@ -30,15 +30,11 @@ ...@@ -30,15 +30,11 @@
#include <asm/vdso.h> #include <asm/vdso.h>
extern char vdso_start[], vdso_end[]; extern char vdso_start[], vdso_end[];
#ifdef CONFIG_COMPAT_VDSO
extern char vdso32_start[], vdso32_end[]; extern char vdso32_start[], vdso32_end[];
#endif /* CONFIG_COMPAT_VDSO */
enum vdso_abi { enum vdso_abi {
VDSO_ABI_AA64, VDSO_ABI_AA64,
#ifdef CONFIG_COMPAT_VDSO
VDSO_ABI_AA32, VDSO_ABI_AA32,
#endif /* CONFIG_COMPAT_VDSO */
}; };
enum vvar_pages { enum vvar_pages {
...@@ -284,21 +280,17 @@ static int __setup_additional_pages(enum vdso_abi abi, ...@@ -284,21 +280,17 @@ static int __setup_additional_pages(enum vdso_abi abi,
/* /*
* Create and map the vectors page for AArch32 tasks. * Create and map the vectors page for AArch32 tasks.
*/ */
#ifdef CONFIG_COMPAT_VDSO
static int aarch32_vdso_mremap(const struct vm_special_mapping *sm, static int aarch32_vdso_mremap(const struct vm_special_mapping *sm,
struct vm_area_struct *new_vma) struct vm_area_struct *new_vma)
{ {
return __vdso_remap(VDSO_ABI_AA32, sm, new_vma); return __vdso_remap(VDSO_ABI_AA32, sm, new_vma);
} }
#endif /* CONFIG_COMPAT_VDSO */
enum aarch32_map { enum aarch32_map {
AA32_MAP_VECTORS, /* kuser helpers */ AA32_MAP_VECTORS, /* kuser helpers */
#ifdef CONFIG_COMPAT_VDSO AA32_MAP_SIGPAGE,
AA32_MAP_VVAR, AA32_MAP_VVAR,
AA32_MAP_VDSO, AA32_MAP_VDSO,
#endif
AA32_MAP_SIGPAGE
}; };
static struct page *aarch32_vectors_page __ro_after_init; static struct page *aarch32_vectors_page __ro_after_init;
...@@ -309,7 +301,10 @@ static struct vm_special_mapping aarch32_vdso_maps[] = { ...@@ -309,7 +301,10 @@ static struct vm_special_mapping aarch32_vdso_maps[] = {
.name = "[vectors]", /* ABI */ .name = "[vectors]", /* ABI */
.pages = &aarch32_vectors_page, .pages = &aarch32_vectors_page,
}, },
#ifdef CONFIG_COMPAT_VDSO [AA32_MAP_SIGPAGE] = {
.name = "[sigpage]", /* ABI */
.pages = &aarch32_sig_page,
},
[AA32_MAP_VVAR] = { [AA32_MAP_VVAR] = {
.name = "[vvar]", .name = "[vvar]",
.fault = vvar_fault, .fault = vvar_fault,
...@@ -319,11 +314,6 @@ static struct vm_special_mapping aarch32_vdso_maps[] = { ...@@ -319,11 +314,6 @@ static struct vm_special_mapping aarch32_vdso_maps[] = {
.name = "[vdso]", .name = "[vdso]",
.mremap = aarch32_vdso_mremap, .mremap = aarch32_vdso_mremap,
}, },
#endif /* CONFIG_COMPAT_VDSO */
[AA32_MAP_SIGPAGE] = {
.name = "[sigpage]", /* ABI */
.pages = &aarch32_sig_page,
},
}; };
static int aarch32_alloc_kuser_vdso_page(void) static int aarch32_alloc_kuser_vdso_page(void)
...@@ -362,25 +352,25 @@ static int aarch32_alloc_sigpage(void) ...@@ -362,25 +352,25 @@ static int aarch32_alloc_sigpage(void)
return 0; return 0;
} }
#ifdef CONFIG_COMPAT_VDSO
static int __aarch32_alloc_vdso_pages(void) static int __aarch32_alloc_vdso_pages(void)
{ {
if (!IS_ENABLED(CONFIG_COMPAT_VDSO))
return 0;
vdso_info[VDSO_ABI_AA32].dm = &aarch32_vdso_maps[AA32_MAP_VVAR]; vdso_info[VDSO_ABI_AA32].dm = &aarch32_vdso_maps[AA32_MAP_VVAR];
vdso_info[VDSO_ABI_AA32].cm = &aarch32_vdso_maps[AA32_MAP_VDSO]; vdso_info[VDSO_ABI_AA32].cm = &aarch32_vdso_maps[AA32_MAP_VDSO];
return __vdso_init(VDSO_ABI_AA32); return __vdso_init(VDSO_ABI_AA32);
} }
#endif /* CONFIG_COMPAT_VDSO */
static int __init aarch32_alloc_vdso_pages(void) static int __init aarch32_alloc_vdso_pages(void)
{ {
int ret; int ret;
#ifdef CONFIG_COMPAT_VDSO
ret = __aarch32_alloc_vdso_pages(); ret = __aarch32_alloc_vdso_pages();
if (ret) if (ret)
return ret; return ret;
#endif
ret = aarch32_alloc_sigpage(); ret = aarch32_alloc_sigpage();
if (ret) if (ret)
...@@ -449,14 +439,14 @@ int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) ...@@ -449,14 +439,14 @@ int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
if (ret) if (ret)
goto out; goto out;
#ifdef CONFIG_COMPAT_VDSO if (IS_ENABLED(CONFIG_COMPAT_VDSO)) {
ret = __setup_additional_pages(VDSO_ABI_AA32, ret = __setup_additional_pages(VDSO_ABI_AA32,
mm, mm,
bprm, bprm,
uses_interp); uses_interp);
if (ret) if (ret)
goto out; goto out;
#endif /* CONFIG_COMPAT_VDSO */ }
ret = aarch32_sigreturn_setup(mm); ret = aarch32_sigreturn_setup(mm);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment