diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2014-06-10 16:46:21 +1000 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-07-17 13:43:19 +0200 |
commit | 58da9b2550867775c2a15def4f3b177305afde33 (patch) | |
tree | 05d5a98afd054d66f1cceae56385d5712b04dcaa /arch | |
parent | 10645ebc2ce2add8add218e8e360fd699ce60264 (diff) |
powerpc/perf: Ensure all EBB register state is cleared on fork()
commit 3df48c981d5a9610e02e9270b1bc4274fb536710 upstream.
In commit 330a1eb "Core EBB support for 64-bit book3s" I messed up
clear_task_ebb(). It clears some but not all of the task's Event Based
Branch (EBB) registers when we duplicate a task struct.
That allows a child task to observe the EBBHR & EBBRR of its parent,
which it should not be able to do.
Fix it by clearing EBBHR & EBBRR.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/switch_to.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/switch_to.h b/arch/powerpc/include/asm/switch_to.h index 2be5618cdec6..06d63a3c1a88 100644 --- a/arch/powerpc/include/asm/switch_to.h +++ b/arch/powerpc/include/asm/switch_to.h @@ -85,6 +85,8 @@ static inline void clear_task_ebb(struct task_struct *t) { #ifdef CONFIG_PPC_BOOK3S_64 /* EBB perf events are not inherited, so clear all EBB state. */ + t->thread.ebbrr = 0; + t->thread.ebbhr = 0; t->thread.bescr = 0; t->thread.mmcr2 = 0; t->thread.mmcr0 = 0; |