Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257302
b: refs/heads/master
c: aafade2
h: refs/heads/master
v: v3
  • Loading branch information
Andy Lutomirski authored and H. Peter Anvin committed Jul 21, 2011
1 parent 9f9bdce commit 994d7ac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae7bd11b471931752e5609094ca0a49386590524
refs/heads/master: aafade242ff24fac3aabf61c7861dfa44a3c2445
15 changes: 13 additions & 2 deletions trunk/arch/x86/vdso/vdso.S
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
#include <asm/page_types.h>
#include <linux/linkage.h>
#include <linux/init.h>

__INITDATA
__PAGE_ALIGNED_DATA

.globl vdso_start, vdso_end
.align PAGE_SIZE
vdso_start:
.incbin "arch/x86/vdso/vdso.so"
vdso_end:

__FINIT
.previous

.globl vdso_pages
.bss
.align 8
.type vdso_pages, @object
vdso_pages:
.zero (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE * 8
.size vdso_pages, .-vdso_pages
25 changes: 6 additions & 19 deletions trunk/arch/x86/vdso/vma.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
#include <asm/vgtod.h>
#include <asm/proto.h>
#include <asm/vdso.h>
#include <asm/page.h>

unsigned int __read_mostly vdso_enabled = 1;

extern char vdso_start[], vdso_end[];
extern unsigned short vdso_sync_cpuid;

static struct page **vdso_pages;
extern struct page *vdso_pages[];
static unsigned vdso_size;

static void __init patch_vdso(void *vdso, size_t len)
Expand Down Expand Up @@ -54,34 +55,20 @@ static void __init patch_vdso(void *vdso, size_t len)
apply_alternatives(alt_data, alt_data + alt_sec->sh_size);
}

static int __init init_vdso_vars(void)
static int __init init_vdso(void)
{
int npages = (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE;
int i;

patch_vdso(vdso_start, vdso_end - vdso_start);

vdso_size = npages << PAGE_SHIFT;
vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
if (!vdso_pages)
goto oom;
for (i = 0; i < npages; i++) {
struct page *p;
p = alloc_page(GFP_KERNEL);
if (!p)
goto oom;
vdso_pages[i] = p;
copy_page(page_address(p), vdso_start + i*PAGE_SIZE);
}
for (i = 0; i < npages; i++)
vdso_pages[i] = virt_to_page(vdso_start + i*PAGE_SIZE);

return 0;

oom:
printk("Cannot allocate vdso\n");
vdso_enabled = 0;
return -ENOMEM;
}
subsys_initcall(init_vdso_vars);
subsys_initcall(init_vdso);

struct linux_binprm;

Expand Down

0 comments on commit 994d7ac

Please sign in to comment.