All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Ingo Molnar <mingo@redhat.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Josh Poimboeuf <jpoimboe@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/debug: define BUG() againfor !CONFIG_BUG
Date: Thu, 30 Mar 2017 09:17:07 +0200	[thread overview]
Message-ID: <20170330071707.GA12758@gmail.com> (raw)
In-Reply-To: <20170330071019.nrjbg6wsmm7c3qas@hirez.programming.kicks-ass.net>


* Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, Mar 29, 2017 at 11:16:31PM +0200, Arnd Bergmann wrote:
> > The latest change to the BUG() macro inadvertently reverted the earlier
> > commit b06dd879f5db ("x86: always define BUG() and HAVE_ARCH_BUG, even
> > with !CONFIG_BUG") that sanitized the behavior with CONFIG_BUG=n.
> > 
> > I noticed this as some warnings have appeared again that were previously
> > fixed as a side effect of that patch:
> > 
> > kernel/seccomp.c: In function '__seccomp_filter':
> > kernel/seccomp.c:670:1: error: no return statement in function returning non-void [-Werror=return-type]
> > 
> > drivers/gpu/drm/i915/intel_sprite.c: In function 'intel_check_sprite_plane':
> > drivers/gpu/drm/i915/intel_sprite.c:936:20: error: 'src_h' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> >    src->y2 = (src_y + src_h) << 16;
> >              ~~~~~~~^~~~~~~~
> > drivers/gpu/drm/i915/intel_sprite.c:934:20: error: 'src_w' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> >    src->x2 = (src_x + src_w) << 16;
> >              ~~~~~~~^~~~~~~~
> > drivers/gpu/drm/i915/intel_sprite.c:936:20: error: 'src_y' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> >    src->y2 = (src_y + src_h) << 16;
> >              ~~~~~~~^~~~~~~~
> > drivers/gpu/drm/i915/intel_sprite.c:934:20: error: 'src_x' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> >    src->x2 = (src_x + src_w) << 16;
> >              ~~~~~~~^~~~~~~~
> > 
> > This combines the two patches and uses the ud2 macro to define BUG()
> > in case of CONFIG_BUG=n.
> 
> OK, fair enough I suppose. However, I cribbed this from arm64. What does
> that do for BUG=n ?

I think we'll get a U2D crash in this case, without any bug information.

I.e. only marginally debuggable, but it's a deterministic outcome - instead of the 
crazy GCC code generation variant of the day when the warning triggers, or the 
similarly crazy infinite loop hang.

I'm not entirely sure though, I don't think many people actually _use_ 
CONFIG_BUG=n, it's essentially a crazy thing to do even on constrainted hardware. 
Debugging and maintenance costs almost always trump marginal hardware costs of a 
bit more debugging code.

Thanks,

	Ingo

  reply	other threads:[~2017-03-30  7:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29 21:16 [PATCH] x86/debug: define BUG() againfor !CONFIG_BUG Arnd Bergmann
2017-03-30  7:10 ` Peter Zijlstra
2017-03-30  7:17   ` Ingo Molnar [this message]
2017-03-30  7:26     ` Ingo Molnar
2017-03-30  7:35     ` Peter Zijlstra
2017-03-30  7:47       ` Ingo Molnar
2017-03-30  8:03         ` Arnd Bergmann
2017-03-30  7:25   ` Arnd Bergmann
2017-03-30  7:29 ` [tip:x86/asm] x86/debug: Define BUG() again for !CONFIG_BUG tip-bot for Arnd Bergmann

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=20170330071707.GA12758@gmail.com \
    --to=mingo@kernel.org \
    --cc=arnd@arndb.de \
    --cc=hpa@zytor.com \
    --cc=josh@joshtriplett.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.