Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbbDLR06 (ORCPT ); Sun, 12 Apr 2015 13:26:58 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39171 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751769AbbDLR0x (ORCPT ); Sun, 12 Apr 2015 13:26:53 -0400 Date: Sun, 12 Apr 2015 10:26:37 -0700 From: tip-bot for Denys Vlasenko Message-ID: Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, jolsa@redhat.com, dvlasenk@redhat.com, paulus@samba.org, a.p.zijlstra@chello.nl, acme@kernel.org, tglx@linutronix.de Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, jolsa@redhat.com, dvlasenk@redhat.com, paulus@samba.org, acme@kernel.org, tglx@linutronix.de, a.p.zijlstra@chello.nl In-Reply-To: <1428671219-29341-3-git-send-email-dvlasenk@redhat.com> References: <1428671219-29341-3-git-send-email-dvlasenk@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] perf/x86/64: Simplify regs_user-> abi setting code in get_regs_user() Git-Commit-ID: 32caa06091cc59651222cdc971dc21eaab36b097 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2471 Lines: 61 Commit-ID: 32caa06091cc59651222cdc971dc21eaab36b097 Gitweb: http://git.kernel.org/tip/32caa06091cc59651222cdc971dc21eaab36b097 Author: Denys Vlasenko AuthorDate: Fri, 10 Apr 2015 15:06:58 +0200 Committer: Ingo Molnar CommitDate: Sat, 11 Apr 2015 13:08:53 +0200 perf/x86/64: Simplify regs_user->abi setting code in get_regs_user() user_64bit_mode(regs) basically checks regs->cs to point to a 64-bit segment. This check used to be unreliable here because regs->cs was not always correct in syscalls. Now regs->cs is always correct: in syscalls, in interrupts, in exceptions. No need to emply heuristics here. Signed-off-by: Denys Vlasenko Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1428671219-29341-3-git-send-email-dvlasenk@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/perf_regs.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/perf_regs.c b/arch/x86/kernel/perf_regs.c index a8d4e48..8157d39 100644 --- a/arch/x86/kernel/perf_regs.c +++ b/arch/x86/kernel/perf_regs.c @@ -166,22 +166,8 @@ void perf_get_regs_user(struct perf_regs *regs_user, * be careful not to look at any other percpu variables that might * change during context switches. */ - if (IS_ENABLED(CONFIG_IA32_EMULATION) && - task_thread_info(current)->status & TS_COMPAT) { - /* Easy case: we're in a compat syscall. */ - regs_user->abi = PERF_SAMPLE_REGS_ABI_32; - } else if (user_regs->orig_ax != -1) { - /* - * We're probably in a 64-bit syscall. - * Warning: this code is severely racy. At least it's better - * than just blindly copying user_regs. - */ - regs_user->abi = PERF_SAMPLE_REGS_ABI_64; - } else { - /* We're probably in an interrupt or exception. */ - regs_user->abi = user_64bit_mode(user_regs) ? - PERF_SAMPLE_REGS_ABI_64 : PERF_SAMPLE_REGS_ABI_32; - } + regs_user->abi = user_64bit_mode(user_regs) ? + PERF_SAMPLE_REGS_ABI_64 : PERF_SAMPLE_REGS_ABI_32; regs_user->regs = regs_user_copy; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/