Commit aa090ed5 authored by Jan Kiszka's avatar Jan Kiszka

x86/ipipe: Add support for userspace return notifier

This adds the x86-specific bits to implement the userspace return
notifier.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent d98094aa
......@@ -294,11 +294,23 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
lockdep_sys_exit();
again:
cached_flags = READ_ONCE(ti->flags);
if (unlikely(cached_flags & EXIT_TO_USERMODE_LOOP_FLAGS))
exit_to_usermode_loop(regs, cached_flags);
if (ipipe_user_intret_notifier_enabled(ti)) {
int ret;
enable_local_irqs();
ret = __ipipe_notify_user_intreturn();
disable_local_irqs();
if (ret == 0)
goto again;
}
#ifdef CONFIG_COMPAT
/*
* Compat syscalls set TS_COMPAT. Make sure we clear it before
......
......@@ -163,10 +163,12 @@ struct thread_info {
#define TIP_MAYDAY 0 /* MAYDAY call is pending */
#define TIP_NOTIFY 1 /* Notify head domain about kernel events */
#define TIP_HEAD 2 /* Runs in head domain */
#define TIP_USERINTRET 3 /* Notify on IRQ/trap return to root userspace */
#define _TIP_MAYDAY (1 << TIP_MAYDAY)
#define _TIP_NOTIFY (1 << TIP_NOTIFY)
#define _TIP_HEAD (1 << TIP_HEAD)
#define _TIP_USERINTRET (1 << TIP_USERINTRET)
#define STACK_WARN (THREAD_SIZE/8)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment