diff options
author | Avi Kivity <avi@redhat.com> | 2009-09-19 02:40:22 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-10-01 15:12:18 -0400 |
commit | 7c68af6e32c73992bad24107311f3433c89016e2 (patch) | |
tree | 9046ac5339f944e8ddccd34be226790b953dda61 /arch/x86/kernel/process.c | |
parent | 817b33d38f81c8736d39283c35c886ae4668f1af (diff) |
core, x86: Add user return notifiers
Add a general per-cpu notifier that is called whenever the kernel is
about to return to userspace. The notifier uses a thread_info flag
and existing checks, so there is no impact on user return or context
switch fast paths.
This will be used initially to speed up KVM task switching by lazily
updating MSRs.
Signed-off-by: Avi Kivity <avi@redhat.com>
LKML-Reference: <1253342422-13811-1-git-send-email-avi@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 5284cd2b5776..e51b056fc88f 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/pm.h> | 9 | #include <linux/pm.h> |
10 | #include <linux/clockchips.h> | 10 | #include <linux/clockchips.h> |
11 | #include <linux/random.h> | 11 | #include <linux/random.h> |
12 | #include <linux/user-return-notifier.h> | ||
12 | #include <trace/events/power.h> | 13 | #include <trace/events/power.h> |
13 | #include <asm/system.h> | 14 | #include <asm/system.h> |
14 | #include <asm/apic.h> | 15 | #include <asm/apic.h> |
@@ -224,6 +225,7 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, | |||
224 | */ | 225 | */ |
225 | memset(tss->io_bitmap, 0xff, prev->io_bitmap_max); | 226 | memset(tss->io_bitmap, 0xff, prev->io_bitmap_max); |
226 | } | 227 | } |
228 | propagate_user_return_notify(prev_p, next_p); | ||
227 | } | 229 | } |
228 | 230 | ||
229 | int sys_fork(struct pt_regs *regs) | 231 | int sys_fork(struct pt_regs *regs) |