Commit 369c9920 authored by Jan Beulich's avatar Jan Beulich Committed by H. Peter Anvin

x86: fix two modpost warnings

Even though it's only the difference of the two __initdata symbols
that's being calculated, modpost still doesn't like this. So rather
calculate the size once in an __init function and store it for later
use.
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 812b121d
...@@ -21,7 +21,8 @@ unsigned int __read_mostly vdso_enabled = 1; ...@@ -21,7 +21,8 @@ unsigned int __read_mostly vdso_enabled = 1;
extern char vdso_start[], vdso_end[]; extern char vdso_start[], vdso_end[];
extern unsigned short vdso_sync_cpuid; extern unsigned short vdso_sync_cpuid;
struct page **vdso_pages; static struct page **vdso_pages;
static unsigned vdso_size;
static inline void *var_ref(void *p, char *name) static inline void *var_ref(void *p, char *name)
{ {
...@@ -38,6 +39,7 @@ static int __init init_vdso_vars(void) ...@@ -38,6 +39,7 @@ static int __init init_vdso_vars(void)
int i; int i;
char *vbase; char *vbase;
vdso_size = npages << PAGE_SHIFT;
vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL); vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
if (!vdso_pages) if (!vdso_pages)
goto oom; goto oom;
...@@ -101,20 +103,19 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) ...@@ -101,20 +103,19 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
struct mm_struct *mm = current->mm; struct mm_struct *mm = current->mm;
unsigned long addr; unsigned long addr;
int ret; int ret;
unsigned len = round_up(vdso_end - vdso_start, PAGE_SIZE);
if (!vdso_enabled) if (!vdso_enabled)
return 0; return 0;
down_write(&mm->mmap_sem); down_write(&mm->mmap_sem);
addr = vdso_addr(mm->start_stack, len); addr = vdso_addr(mm->start_stack, vdso_size);
addr = get_unmapped_area(NULL, addr, len, 0, 0); addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
if (IS_ERR_VALUE(addr)) { if (IS_ERR_VALUE(addr)) {
ret = addr; ret = addr;
goto up_fail; goto up_fail;
} }
ret = install_special_mapping(mm, addr, len, ret = install_special_mapping(mm, addr, vdso_size,
VM_READ|VM_EXEC| VM_READ|VM_EXEC|
VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
VM_ALWAYSDUMP, VM_ALWAYSDUMP,
......
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