From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753886AbcB2LBV (ORCPT ); Mon, 29 Feb 2016 06:01:21 -0500 Received: from torg.zytor.com ([198.137.202.12]:52968 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752611AbcB2LBS (ORCPT ); Mon, 29 Feb 2016 06:01:18 -0500 Date: Mon, 29 Feb 2016 02:59:56 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: bp@alien8.de, luto@kernel.org, linux-kernel@vger.kernel.org, palves@redhat.com, tglx@linutronix.de, torvalds@linux-foundation.org, jslaby@suse.cz, bernd@petrovitsch.priv.at, peterz@infradead.org, mingo@kernel.org, chris.j.arges@canonical.com, hpa@zytor.com, namhyung@gmail.com, mmarek@suse.cz, jpoimboe@redhat.com, akpm@linux-foundation.org, acme@kernel.org Reply-To: bernd@petrovitsch.priv.at, jslaby@suse.cz, torvalds@linux-foundation.org, mingo@kernel.org, chris.j.arges@canonical.com, peterz@infradead.org, hpa@zytor.com, acme@kernel.org, jpoimboe@redhat.com, akpm@linux-foundation.org, mmarek@suse.cz, namhyung@gmail.com, luto@kernel.org, bp@alien8.de, palves@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <91190e324ebd7fcd01748d508d0dfd4693e84d91.1456719558.git.jpoimboe@redhat.com> References: <91190e324ebd7fcd01748d508d0dfd4693e84d91.1456719558.git.jpoimboe@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/objtool] sched: Mark __schedule() stack frame as non-standard Git-Commit-ID: 8e05e96ac949c80704d0a38420bf60dcf18c938f 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 Commit-ID: 8e05e96ac949c80704d0a38420bf60dcf18c938f Gitweb: http://git.kernel.org/tip/8e05e96ac949c80704d0a38420bf60dcf18c938f Author: Josh Poimboeuf AuthorDate: Sun, 28 Feb 2016 22:22:38 -0600 Committer: Ingo Molnar CommitDate: Mon, 29 Feb 2016 08:35:11 +0100 sched: Mark __schedule() stack frame as non-standard objtool reports the following warnings for __schedule(): kernel/sched/core.o: warning: objtool:__schedule()+0x3c0: duplicate frame pointer save kernel/sched/core.o: warning: objtool:__schedule()+0x3fd: sibling call from callable instruction with changed frame pointer kernel/sched/core.o: warning: objtool:__schedule()+0x40a: call without frame pointer save/setup kernel/sched/core.o: warning: objtool:__schedule()+0x7fd: frame pointer state mismatch kernel/sched/core.o: warning: objtool:__schedule()+0x421: frame pointer state mismatch Basically it's confused by two unusual attributes of the switch_to() macro: 1. It saves prev's frame pointer to the old stack and restores next's frame pointer from the new stack. 2. For new tasks it jumps directly to ret_from_fork. Eventually it would probably be a good idea to clean up the ret_from_fork hack so that new tasks are created with a valid initial stack, as suggested by Andy: https://lkml.kernel.org/r/CALCETrWsqCw4L1qKO9j9L5F+4ED4viuLQTFc=n1pKBZfFPQUFg@mail.gmail.com Then __schedule() could return normally into the new code and objtool hopefully wouldn't have a problem anymore. In the meantime, mark its stack frame as non-standard so we can have a baseline with no objtool warnings. The marker also serves as a reminder that this code could be improved a bit. Signed-off-by: Josh Poimboeuf Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Chris J Arges Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/91190e324ebd7fcd01748d508d0dfd4693e84d91.1456719558.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- kernel/sched/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9503d59..641043d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -74,6 +74,7 @@ #include #include #include +#include #include #include @@ -3288,6 +3289,7 @@ static void __sched notrace __schedule(bool preempt) balance_callback(rq); } +STACK_FRAME_NON_STANDARD(__schedule); /* switch_to() */ static inline void sched_submit_work(struct task_struct *tsk) {