From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013AbdKDWgE (ORCPT ); Sat, 4 Nov 2017 18:36:04 -0400 Received: from terminus.zytor.com ([65.50.211.136]:37571 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751463AbdKDWgC (ORCPT ); Sat, 4 Nov 2017 18:36:02 -0400 Date: Sat, 4 Nov 2017 15:31:28 -0700 From: tip-bot for Josh Poimboeuf Message-ID: Cc: peterz@infradead.org, hpa@zytor.com, jpoimboe@redhat.com, fengguang.wu@intel.com, mingo@kernel.org, tglx@linutronix.de, bp@suse.de, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, luto@kernel.org Reply-To: linux-kernel@vger.kernel.org, luto@kernel.org, tglx@linutronix.de, bp@suse.de, torvalds@linux-foundation.org, peterz@infradead.org, hpa@zytor.com, fengguang.wu@intel.com, jpoimboe@redhat.com, mingo@kernel.org In-Reply-To: <20171103221941.cajpwszir7ujxyc4@treble> References: <20171103221941.cajpwszir7ujxyc4@treble> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] objtool: Prevent GCC from merging annotate_unreachable(), take 2 Git-Commit-ID: ec1e1b6109171d1890a437481c35b2b56d2327b8 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: ec1e1b6109171d1890a437481c35b2b56d2327b8 Gitweb: https://git.kernel.org/tip/ec1e1b6109171d1890a437481c35b2b56d2327b8 Author: Josh Poimboeuf AuthorDate: Fri, 3 Nov 2017 17:19:41 -0500 Committer: Ingo Molnar CommitDate: Sat, 4 Nov 2017 15:03:39 +0100 objtool: Prevent GCC from merging annotate_unreachable(), take 2 This fixes the following warning with GCC 4.6: mm/migrate.o: warning: objtool: migrate_misplaced_transhuge_page()+0x71: unreachable instruction The problem is that the compiler merged identical annotate_unreachable() inline asm blocks, resulting in a missing 'unreachable' annotation. This problem happened before, and was partially fixed with: 3d1e236022cc ("objtool: Prevent GCC from merging annotate_unreachable()") That commit tried to ensure that each instance of the annotate_unreachable() inline asm statement has a unique label. It used the __LINE__ macro to generate the label number. However, even the line number isn't necessarily unique when used in an inline function with multiple callers (in this case, __alloc_pages_node()'s use of VM_BUG_ON). Reported-by: kbuild test robot Signed-off-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kbuild-all@01.org Cc: tipbuild@zytor.com Fixes: 3d1e236022cc ("objtool: Prevent GCC from merging annotate_unreachable()") Link: http://lkml.kernel.org/r/20171103221941.cajpwszir7ujxyc4@treble Signed-off-by: Ingo Molnar --- include/linux/compiler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index fd8697a..2027104 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -191,13 +191,13 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, asm("%c0:\n\t" \ ".pushsection .discard.reachable\n\t" \ ".long %c0b - .\n\t" \ - ".popsection\n\t" : : "i" (__LINE__)); \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define annotate_unreachable() ({ \ asm("%c0:\n\t" \ ".pushsection .discard.unreachable\n\t" \ ".long %c0b - .\n\t" \ - ".popsection\n\t" : : "i" (__LINE__)); \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define ASM_UNREACHABLE \ "999:\n\t" \