linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Krinkin <krinkin.m.u@gmail.com>
To: aryabinin@virtuozzo.com
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: CONFIG_UBSAN_ALIGNMENT breaks x86-64 kernel with lockdep enabled
Date: Sat, 30 Jan 2016 03:36:45 +0300	[thread overview]
Message-ID: <20160130003645.GA30158@kmu-tp-x230> (raw)

Hi,

option CONFIG_UBSAN_ALIGNMENT breaks x86-64 kernel with lockdep enabled,
i. e kernel with CONFIG_UBSAN_ALIGNMENT fails to load without even any
error message.

The problem is that ubsan callbacks use spinlocks and might be called
before lockdep is initialized. Particularly this line in the
reserve_ebda_region function causes problem:

lowmem = *(unsigned short *)__va(BIOS_LOWMEM_KILOBYTES);

If i put lockdep_init() before reserve_ebda_region call in
x86_64_start_reservations kernel loads well. Since CONFIG_UBSAN_ALIGNMENT
isn't useful for x86 anyway it might be better to disable this option for
x86 arch?

             reply	other threads:[~2016-01-30  0:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-30  0:36 Mike Krinkin [this message]
2016-02-01 15:10 ` CONFIG_UBSAN_ALIGNMENT breaks x86-64 kernel with lockdep enabled Andrey Ryabinin
2016-02-01 22:21   ` Andrew Morton
2016-02-02 16:18     ` Andrey Ryabinin
2016-02-02 21:18       ` Andrew Morton

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=20160130003645.GA30158@kmu-tp-x230 \
    --to=krinkin.m.u@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).