[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159562150141.4006.14534452272792255017.tip-bot2@tip-bot2>
Date: Fri, 24 Jul 2020 20:11:41 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Kees Cook <keescook@...omium.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: x86/entry] x86/ptrace: Provide pt_regs helper for entry/exit
The following commit has been merged into the x86/entry branch of tip:
Commit-ID: 0bf019ea59e330770883ede4499d7f711d8c3adf
Gitweb: https://git.kernel.org/tip/0bf019ea59e330770883ede4499d7f711d8c3adf
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Thu, 23 Jul 2020 00:00:03 +02:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Fri, 24 Jul 2020 15:04:58 +02:00
x86/ptrace: Provide pt_regs helper for entry/exit
As a preparatory step for moving the syscall and interrupt entry/exit
handling into generic code, provide a pt_regs helper which retrieves the
interrupt state from pt_regs. This is required to check whether interrupts
are reenabled by return from interrupt/exception.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Kees Cook <keescook@...omium.org>
Link: https://lkml.kernel.org/r/20200722220520.258511584@linutronix.de
---
arch/x86/include/asm/ptrace.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 255b2dd..40aa69d 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -209,6 +209,11 @@ static inline void user_stack_pointer_set(struct pt_regs *regs,
regs->sp = val;
}
+static __always_inline bool regs_irqs_disabled(struct pt_regs *regs)
+{
+ return !(regs->flags & X86_EFLAGS_IF);
+}
+
/* Query offset/name of register from its name/offset */
extern int regs_query_register_offset(const char *name);
extern const char *regs_query_register_name(unsigned int offset);
Powered by blists - more mailing lists