From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965543AbcALMEs (ORCPT ); Tue, 12 Jan 2016 07:04:48 -0500 Received: from terminus.zytor.com ([198.137.202.10]:58079 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933957AbcALMEq (ORCPT ); Tue, 12 Jan 2016 07:04:46 -0500 Date: Tue, 12 Jan 2016 04:03:22 -0800 From: tip-bot for Andy Lutomirski Message-ID: Cc: fenghua.yu@intel.com, luto@amacapital.net, quentin.casasnovas@oracle.com, bp@alien8.de, linux-kernel@vger.kernel.org, luto@kernel.org, oleg@redhat.com, torvalds@linux-foundation.org, dave.hansen@linux.intel.com, keescook@chromium.org, mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com Reply-To: hpa@zytor.com, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, keescook@chromium.org, dave.hansen@linux.intel.com, oleg@redhat.com, torvalds@linux-foundation.org, luto@kernel.org, bp@alien8.de, linux-kernel@vger.kernel.org, luto@amacapital.net, quentin.casasnovas@oracle.com, fenghua.yu@intel.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/vdso: Track each mm' s loaded vDSO image as well as its base Git-Commit-ID: 352b78c62f27b356b182008acd3117f3ee03ffd2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 352b78c62f27b356b182008acd3117f3ee03ffd2 Gitweb: http://git.kernel.org/tip/352b78c62f27b356b182008acd3117f3ee03ffd2 Author: Andy Lutomirski AuthorDate: Tue, 29 Dec 2015 20:12:21 -0800 Committer: Ingo Molnar CommitDate: Tue, 12 Jan 2016 11:59:34 +0100 x86/vdso: Track each mm's loaded vDSO image as well as its base 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 Reviewed-by: Kees Cook Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Quentin Casasnovas Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/c99ac48681bad709ca7ad5ee899d9042a3af6b00.1451446564.git.luto@kernel.org Signed-off-by: Ingo Molnar --- 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 b8f69e2..80b0210 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 55234d5..1ea0bae 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;