linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: Arvind Sankar <nivedita@alum.mit.edu>,
	linux-efi <linux-efi@vger.kernel.org>,
	 Dmitry Vyukov <dvyukov@google.com>,
	Alexander Potapenko <glider@google.com>,
	 kasan-dev <kasan-dev@googlegroups.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	 kbuild-all@lists.01.org, Johannes Weiner <hannes@cmpxchg.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Linux Memory Management List <linux-mm@kvack.org>,
	kernel test robot <lkp@intel.com>
Subject: Re: [hnaz-linux-mm:master 168/421] init/main.c:1012: undefined reference to `efi_enter_virtual_mode'
Date: Tue, 4 Aug 2020 14:40:57 +0200	[thread overview]
Message-ID: <CAMj1kXEp0pc8UN-BnJPT36KAKNLOL1EUBHgLABJwF2qwLrz6KA@mail.gmail.com> (raw)
In-Reply-To: <CAAeHK+wobK72fWK=v7JosQL3UEe2HG4n2wwVpf1PN30Xkra6rA@mail.gmail.com>

On Tue, 4 Aug 2020 at 14:27, Andrey Konovalov <andreyknvl@google.com> wrote:
>
> On Mon, Aug 3, 2020 at 8:04 PM Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >
> > On Mon, Aug 03, 2020 at 05:37:32PM +0200, Andrey Konovalov wrote:
> > > On Sun, Aug 2, 2020 at 12:25 AM kernel test robot <lkp@intel.com> wrote:
> > > >
> > > > tree:   https://github.com/hnaz/linux-mm master
> > > > head:   2932a9e66c580f3c8d95ec27716d437198fb4c94
> > > > commit: 7c0265f304de3c3acd02d0015b56a076357bcce3 [168/421] kasan, arm64: don't instrument functions that enable kasan
> > > > config: x86_64-randconfig-r036-20200802 (attached as .config)
> > > > compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
> > > > reproduce (this is a W=1 build):
> > > >         git checkout 7c0265f304de3c3acd02d0015b56a076357bcce3
> > > >         # save the attached .config to linux build tree
> > > >         make W=1 ARCH=x86_64
> > > >
> > > > If you fix the issue, kindly add following tag as appropriate
> > > > Reported-by: kernel test robot <lkp@intel.com>
> > > >
> > > > All errors (new ones prefixed by >>):
> > > >
> > > >    ld: init/main.o: in function `start_kernel':
> > > > >> init/main.c:1012: undefined reference to `efi_enter_virtual_mode'
> > >
> > > Hm, I can reproduce the issue, but I don't understand why it happens.
> > >
> > > +EFI and KASAN people, maybe someone has an idea.
> > >
> > > This is the guilty patch:
> > >
> > > https://github.com/hnaz/linux-mm/commit/7c0265f304de3c3acd02d0015b56a076357bcce3
> > >
> > > The issue is only with efi_enter_virtual_mode() AFAIU, not with any of
> > > the other functions.
> > >
> > > Thanks!
> > >
> >
> > After adding __no_sanitize_address, gcc doesn't inline efi_enabled() on
> > a KASAN build, even when CONFIG_EFI is disabled, and the function is
> > just
> >         return false;
> > and so it isn't optimizing out the call to efi_enter_virtual_mode().
> >
> > Making efi_enabled() __always_inline fixes this, but not sure if that is
> > the correct fix?
>
> Ah, makes sense.
>
> We could also do #if defined(CONFIG_X86) && defined(CONFIG_EFI) in
> start_kernel().
>
> Or provide an empty efi_enter_virtual_mode() implementation when
> CONFIG_EFI isn't enabled.
>
> Ard, WDYT?
>

The latter seems more appropriate (as a static inline in efi.h), since
we could then remove the ifdef altogether afaict.


  reply	other threads:[~2020-08-04 12:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01 22:25 [hnaz-linux-mm:master 168/421] init/main.c:1012: undefined reference to `efi_enter_virtual_mode' kernel test robot
2020-08-03 15:37 ` Andrey Konovalov
2020-08-03 18:03   ` Arvind Sankar
2020-08-04 12:27     ` Andrey Konovalov
2020-08-04 12:40       ` Ard Biesheuvel [this message]
2020-08-04 12:44         ` Andrey Konovalov

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=CAMj1kXEp0pc8UN-BnJPT36KAKNLOL1EUBHgLABJwF2qwLrz6KA@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=kasan-dev@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=nivedita@alum.mit.edu \
    /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).