Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1291444

[PATCH v2 3/6] x86/vdso: Track each mm's loaded vdso image as well as its base

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v2 3/6] x86/vdso: Track each mm's loaded vdso image as well as its base
Date 2015-12-14 19:40 +0100
Message-ID <qFGcr-1pc-59@gated-at.bofh.it> (permalink)
References <qFGcp-1pc-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


As we start to do more intelligent things with the vdso at runtime
(as opposed to just at mm initialization time), we'll need to know
which vdso is in use.

In principle, we could guess based on the mm type, but that's
over-complicated and error-prone.  Instead, just track it in the mmu
context.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/entry/vdso/vma.c  | 1 +
 arch/x86/include/asm/mmu.h | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index b8f69e264ac4..80b021067bd6 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -121,6 +121,7 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
 
 	text_start = addr - image->sym_vvar_start;
 	current->mm->context.vdso = (void __user *)text_start;
+	current->mm->context.vdso_image = image;
 
 	/*
 	 * MAYWRITE to allow gdb to COW and set breakpoints
diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h
index 55234d5e7160..1ea0baef1175 100644
--- a/arch/x86/include/asm/mmu.h
+++ b/arch/x86/include/asm/mmu.h
@@ -19,7 +19,8 @@ typedef struct {
 #endif
 
 	struct mutex lock;
-	void __user *vdso;
+	void __user *vdso;			/* vdso base address */
+	const struct vdso_image *vdso_image;	/* vdso image in use */
 
 	atomic_t perf_rdpmc_allowed;	/* nonzero if rdpmc is allowed */
 } mm_context_t;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] mm, x86/vdso: Special IO mapping improvements Andy Lutomirski <luto@kernel.org> - 2015-12-14 19:40 +0100
  [PATCH v2 2/6] mm: Add vm_insert_pfn_prot Andy Lutomirski <luto@kernel.org> - 2015-12-14 19:40 +0100
  [PATCH v2 4/6] x86,vdso: Use .fault for the vdso text mapping Andy Lutomirski <luto@kernel.org> - 2015-12-14 19:40 +0100
  [PATCH v2 3/6] x86/vdso: Track each mm's loaded vdso image as well as its base Andy Lutomirski <luto@kernel.org> - 2015-12-14 19:40 +0100
  Re: [PATCH v2 0/6] mm, x86/vdso: Special IO mapping improvements Andy Lutomirski <luto@amacapital.net> - 2015-12-24 01:00 +0100
    Re: [PATCH v2 0/6] mm, x86/vdso: Special IO mapping improvements Andy Lutomirski <luto@amacapital.net> - 2015-12-29 14:20 +0100

csiph-web