From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754979AbbBPHsq (ORCPT ); Mon, 16 Feb 2015 02:48:46 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:39014 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754511AbbBPHso (ORCPT ); Mon, 16 Feb 2015 02:48:44 -0500 Date: Mon, 16 Feb 2015 08:48:40 +0100 From: Ingo Molnar To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Arnaldo Carvalho de Melo , Andrew Morton Subject: [GIT PULL] perf x86 updates for v3.20 Message-ID: <20150216074840.GA25445@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus, Please pull the latest perf-core-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-core-for-linus # HEAD: a66734297f78707ce39d756b656bfae861d53f62 perf/x86: Add /sys/devices/cpu/rdpmc=2 to allow rdpmc for all tasks ( I'm sending these changes from Andy Lutomirski separately because they were based on other bits that went upstream in this cycle. ) This series tightens up RDPMC permissions: currently even highly sandboxed x86 execution environments (such as seccomp) have permission to execute RDPMC, which may leak various perf events / PMU state such as timing information and other CPU execution details. This 'all is allowed' RDPMC mode is still preserved as the (non-default) /sys/devices/cpu/rdpmc=2 setting. The new default is that RDPMC access is only allowed if a perf event is mmap-ed (which is needed to correctly interpret RDPMC counter values in any case). As a side effect of these changes CR4 handling is cleaned up in the x86 code and a shadow copy of the CR4 value is added. The extra CR4 manipulation adds ~ <50ns to the context switch cost between rdpmc-capable and rdpmc-non-capable mms. ( Note: shortlog and diffstat created manually due to the somewhat unusual merge base - hopefully the result is still fine. ) Thanks, Ingo ------------------> Andy Lutomirski (7): x86: Clean up cr4 manipulation x86: Store a per-cpu shadow copy of CR4 x86: Add a comment clarifying LDT context switching perf: Add pmu callbacks to track event mapping and unmapping perf: Pass the event to arch_perf_update_userpage() perf/x86: Only allow rdpmc if a perf_event is mapped perf/x86: Add /sys/devices/cpu/rdpmc=2 to allow rdpmc for all tasks Ingo Molnar (1): Merge branch 'x86/asm' into perf/x86, to avoid conflicts with upcoming patches arch/x86/include/asm/mmu.h | 2 ++ arch/x86/include/asm/mmu_context.h | 33 +++++++++++++++++++++----- arch/x86/include/asm/paravirt.h | 6 ++--- arch/x86/include/asm/processor.h | 33 -------------------------- arch/x86/include/asm/special_insns.h | 6 ++--- arch/x86/include/asm/tlbflush.h | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ arch/x86/include/asm/virtext.h | 5 ++-- arch/x86/kernel/acpi/sleep.c | 2 +- arch/x86/kernel/cpu/common.c | 17 ++++++++++---- arch/x86/kernel/cpu/mcheck/mce.c | 3 ++- arch/x86/kernel/cpu/mcheck/p5.c | 3 ++- arch/x86/kernel/cpu/mcheck/winchip.c | 3 ++- arch/x86/kernel/cpu/mtrr/cyrix.c | 6 ++--- arch/x86/kernel/cpu/mtrr/generic.c | 6 ++--- arch/x86/kernel/cpu/perf_event.c | 76 +++++++++++++++++++++++++++++++++++++++++++++-------------- arch/x86/kernel/cpu/perf_event.h | 2 ++ arch/x86/kernel/head32.c | 1 + arch/x86/kernel/head64.c | 2 ++ arch/x86/kernel/i387.c | 3 ++- arch/x86/kernel/process.c | 5 ++-- arch/x86/kernel/process_32.c | 2 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/xsave.c | 3 ++- arch/x86/kvm/svm.c | 2 +- arch/x86/kvm/vmx.c | 10 ++++---- arch/x86/mm/fault.c | 2 +- arch/x86/mm/init.c | 13 ++++++++-- arch/x86/mm/tlb.c | 3 --- arch/x86/power/cpu.c | 11 ++++----- arch/x86/realmode/init.c | 2 +- arch/x86/xen/enlighten.c | 4 ++-- drivers/lguest/x86/core.c | 5 ++-- include/linux/perf_event.h | 7 ++++++ kernel/events/core.c | 14 +++++++++-- 35 files changed, 253 insertions(+), 120 deletions(-)