summaryrefslogtreecommitdiffstats
path: root/arch/x86/vdso/vdso2c.h
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-05-05 21:19:35 +0200
committerH. Peter Anvin <hpa@linux.intel.com>2014-05-05 22:18:56 +0200
commit18d0a6fd227177fd243993179c90e454d0638b06 (patch)
tree2060813e42652ac16fe6e3e2eb84f60dc60c4dfe /arch/x86/vdso/vdso2c.h
parentx86, vdso: Reimplement vdso.so preparation in build-time C (diff)
downloadlinux-18d0a6fd227177fd243993179c90e454d0638b06.tar.xz
linux-18d0a6fd227177fd243993179c90e454d0638b06.zip
x86, vdso: Move the 32-bit vdso special pages after the text
This unifies the vdso mapping code and teaches it how to map special pages at addresses corresponding to symbols in the vdso image. The new code is used for all vdso variants, but so far only the 32-bit variants use the new vvar page position. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Link: http://lkml.kernel.org/r/b6d7858ad7b5ac3fd3c29cab6d6d769bc45d195e.1399317206.git.luto@amacapital.net Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/vdso/vdso2c.h')
-rw-r--r--arch/x86/vdso/vdso2c.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/vdso/vdso2c.h b/arch/x86/vdso/vdso2c.h
index 9276e5207620..ed2e894e89ab 100644
--- a/arch/x86/vdso/vdso2c.h
+++ b/arch/x86/vdso/vdso2c.h
@@ -87,6 +87,23 @@ static int GOFUNC(void *addr, size_t len, FILE *outfile, const char *name)
}
}
+ /* Validate mapping addresses. */
+ for (i = 0; i < sizeof(special_pages) / sizeof(special_pages[0]); i++) {
+ if (!syms[i])
+ continue; /* The mapping isn't used; ignore it. */
+
+ if (syms[i] % 4096)
+ fail("%s must be a multiple of 4096\n",
+ required_syms[i]);
+ if (syms[i] < data_size)
+ fail("%s must be after the text mapping\n",
+ required_syms[i]);
+ if (syms[sym_end_mapping] < syms[i] + 4096)
+ fail("%s overruns end_mapping\n", required_syms[i]);
+ }
+ if (syms[sym_end_mapping] % 4096)
+ fail("end_mapping must be a multiple of 4096\n");
+
/* Remove sections. */
hdr->e_shoff = 0;
hdr->e_shentsize = 0;