mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Peter Oberparleiter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, oberpar@linux.vnet.ibm.com,
	hpa@zytor.com, mingo@kernel.org, stable@vger.kernel.org,
	akpm@linux-foundation.org, mroos@linux.ee, tglx@linutronix.de
Subject: [tip:x86/urgent] x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
Date: Thu, 6 Feb 2014 07:18:26 -0800	[thread overview]
Message-ID: <tip-6583327c4dd55acbbf2a6f25e775b28b3abf9a42@git.kernel.org> (raw)
In-Reply-To: <52F3A30C.7050205@linux.vnet.ibm.com>

Commit-ID:  6583327c4dd55acbbf2a6f25e775b28b3abf9a42
Gitweb:     http://git.kernel.org/tip/6583327c4dd55acbbf2a6f25e775b28b3abf9a42
Author:     Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
AuthorDate: Thu, 6 Feb 2014 15:58:20 +0100
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Thu, 6 Feb 2014 07:15:20 -0800

x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y

Commit d61931d89b, "x86: Add optimized popcnt variants" introduced
compile flag -fcall-saved-rdi for lib/hweight.c. When combined with
options -fprofile-arcs and -O2, this flag causes gcc to generate
broken constructor code. As a result, a 64 bit x86 kernel compiled
with CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create
file" and runs into sproadic BUGs during boot.

The gcc people indicate that these kinds of problems are endemic when
using ad hoc calling conventions.  It is therefore best to treat any
file compiled with ad hoc calling conventions as an isolated
environment and avoid things like profiling or coverage analysis,
since those subsystems assume a "normal" calling conventions.

This patch avoids the bug by excluding lib/hweight.o from coverage
profiling.

Reported-by: Meelis Roos <mroos@linux.ee>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/52F3A30C.7050205@linux.vnet.ibm.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: <stable@vger.kernel.org>
---
 lib/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/Makefile b/lib/Makefile
index a459c31..04944e9 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
 obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
 obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 
+GCOV_PROFILE_hweight.o := n
 CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS))
 obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
 

  reply	other threads:[~2014-02-06 15:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 10:34 3.13: BUG: unable to handle kernel paging request at 00000000b4343e88 Meelis Roos
2014-01-21 22:10 ` Andrew Morton
2014-01-22 15:33   ` Meelis Roos
2014-01-24 13:47     ` Peter Oberparleiter
2014-01-24 20:54       ` Meelis Roos
2014-01-27 15:53         ` Peter Oberparleiter
2014-01-28  6:33           ` Meelis Roos
2014-01-29 15:05             ` Peter Oberparleiter
     [not found]               ` <alpine.SOC.1.00.1401292242390.12718@math.ut.ee>
2014-01-31 15:50                 ` Peter Oberparleiter
2014-02-05 17:00                   ` Peter Oberparleiter
2014-02-05 17:36                     ` H. Peter Anvin
2014-02-06 14:58                       ` Peter Oberparleiter
2014-02-06 15:18                         ` tip-bot for Peter Oberparleiter [this message]
2014-02-06  6:19                     ` Meelis Roos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-6583327c4dd55acbbf2a6f25e775b28b3abf9a42@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mroos@linux.ee \
    --cc=oberpar@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome