[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190611145627.23229-1-sudeep.holla@arm.com>
Date: Tue, 11 Jun 2019 15:56:27 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: x86@...nel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>
Cc: Sudeep Holla <sudeep.holla@....com>,
Will Deacon <will.deacon@....com>,
Oleg Nesterov <oleg@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Richard Weinberger <richard@....at>, jdike@...toit.com,
Steve Capper <Steve.Capper@....com>,
Haibo Xu <haibo.xu@....com>, Andy Lutomirski <luto@...nel.org>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>
Subject: [PATCH v5 2/4] x86/entry: Simplify _TIF_SYSCALL_EMU handling
The usage of emulated and _TIF_SYSCALL_EMU flags in syscall_trace_enter
is more complicated than required.
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Acked-by: Oleg Nesterov <oleg@...hat.com>
Reviewed-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Sudeep Holla <sudeep.holla@....com>
---
arch/x86/entry/common.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
Hi Catalin,
I assume you can now pick up this patch.
Regards,
Sudeep
v4->v5: Updated changelog as suggested by tglx and added his Reviewed-by
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index a986b3c8294c..0a61705d62ec 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -72,23 +72,18 @@ static long syscall_trace_enter(struct pt_regs *regs)
struct thread_info *ti = current_thread_info();
unsigned long ret = 0;
- bool emulated = false;
u32 work;
if (IS_ENABLED(CONFIG_DEBUG_ENTRY))
BUG_ON(regs != task_pt_regs(current));
- work = READ_ONCE(ti->flags) & _TIF_WORK_SYSCALL_ENTRY;
+ work = READ_ONCE(ti->flags);
- if (unlikely(work & _TIF_SYSCALL_EMU))
- emulated = true;
-
- if ((emulated || (work & _TIF_SYSCALL_TRACE)) &&
- tracehook_report_syscall_entry(regs))
- return -1L;
-
- if (emulated)
- return -1L;
+ if (work & (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU)) {
+ ret = tracehook_report_syscall_entry(regs);
+ if (ret || (work & _TIF_SYSCALL_EMU))
+ return -1L;
+ }
#ifdef CONFIG_SECCOMP
/*
--
2.17.1
Powered by blists - more mailing lists