From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B62DEC433DF for ; Tue, 4 Aug 2020 12:45:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B4CD2067D for ; Tue, 4 Aug 2020 12:45:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hN+ZgtJj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726333AbgHDMpb (ORCPT ); Tue, 4 Aug 2020 08:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727982AbgHDMor (ORCPT ); Tue, 4 Aug 2020 08:44:47 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87A3EC06174A for ; Tue, 4 Aug 2020 05:44:46 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id r11so12221395pfl.11 for ; Tue, 04 Aug 2020 05:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ryvLjVG1MrLc1WL5a6i4V+mIwati9JdZFbrWPVnD1eA=; b=hN+ZgtJj6srfcrMTwrTTNDNvecM0QKaNfxXUGaQinHyJ/p1HA0Vi49iumQ6MOKffgo mQGnl8ezc2TzTY3UVLvA84T5LgQXtB2U3CrHD4r2qSoegVdSTl8hsiww2Fq8h5/26jaT xIMQWyQpyD/ETLg4WMxdyDodK3jSY1djOBITkn2+cFKZOROgQOc5gq3isai/TakLiHCq Di7Fu1+7l+7ZV4G5ucWCDH8ANQHDG+fcVZRdinw7HbHLYww9SZvrwZ45BEsOADkNsRv0 VWrV3t8Q0w71INGlbQOi7bTXJl47XcOQutk/bzOC8vF7nLAzypTDun+kaT7Md9/HTKQd EGdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ryvLjVG1MrLc1WL5a6i4V+mIwati9JdZFbrWPVnD1eA=; b=U4k5kPlgllB0/VNque1rcOFEsrNrBRHIqAYBKixPOM6+dsHhhpozYjOAQ2z5+s9IrJ vnibS/W89kzM+bKj/YGH3nlnXnyKVG66eW4Qfyb5rXNEecIixsnnQZsEoIZ0cptELijp nqmHTJZDj2i8Um5CCi2z32TkZ9HyvU6x+sEte9TqbjIh/HI/ASozi9sXwt0gS6+s5GGF FlxVcxJc6odorqiUPbR/v/0k9wA8vmw+QqnBrqaYvf2mGfpLbtzDkqyL36C1fSbFBjEl JOd7QA0zbGCl9Cy/aPiNcxDFG2AsnsGLybaZpkASsiMp4Tyt8Owt+5jRKtk79VGuzi/L FPeQ== X-Gm-Message-State: AOAM530WI7MFn9OS0eM0JBkeiqMGpDtmyeoMY3Urdc70WN+LN85pH0s7 lR+W8lewGABYvs8Z9EF7HF8J0aVM9buLuifbmhPDrw== X-Google-Smtp-Source: ABdhPJz92vXv2YZ8xAVjfvEvO1wlLqHYZ/iFLwwh+P/7VeDOiUsQ0ZpfvH51U83oCk3zQ9RZx6opluDS0JZtta7naw8= X-Received: by 2002:a62:a101:: with SMTP id b1mr845628pff.306.1596545085771; Tue, 04 Aug 2020 05:44:45 -0700 (PDT) MIME-Version: 1.0 References: <202008020649.TJ8Zu7ei%lkp@intel.com> <20200803180358.GA1299225@rani.riverdale.lan> In-Reply-To: From: Andrey Konovalov Date: Tue, 4 Aug 2020 14:44:34 +0200 Message-ID: Subject: Re: [hnaz-linux-mm:master 168/421] init/main.c:1012: undefined reference to `efi_enter_virtual_mode' To: Ard Biesheuvel Cc: Arvind Sankar , linux-efi , Dmitry Vyukov , Alexander Potapenko , kasan-dev , Andrey Ryabinin , kbuild-all@lists.01.org, Johannes Weiner , Andrew Morton , Linux Memory Management List , kernel test robot Content-Type: text/plain; charset="UTF-8" Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Tue, Aug 4, 2020 at 2:41 PM Ard Biesheuvel wrote: > > On Tue, 4 Aug 2020 at 14:27, Andrey Konovalov wrote: > > > > On Mon, Aug 3, 2020 at 8:04 PM Arvind Sankar 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 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 > > > > > > > > > > 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 Sent out a v2 of my patchset with this exact fix included at the same time I received this response :) > we could then remove the ifdef altogether afaict. I didn't do this part. I guess this can be done as a separate patch, and will probably require some more testing. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1133C433DF for ; Tue, 4 Aug 2020 12:44:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B7434208A9 for ; Tue, 4 Aug 2020 12:44:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hN+ZgtJj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7434208A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4645C8D015C; Tue, 4 Aug 2020 08:44:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 415DC8D0081; Tue, 4 Aug 2020 08:44:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DCAA8D015C; Tue, 4 Aug 2020 08:44:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0082.hostedemail.com [216.40.44.82]) by kanga.kvack.org (Postfix) with ESMTP id 13E468D0081 for ; Tue, 4 Aug 2020 08:44:48 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C5387824805A for ; Tue, 4 Aug 2020 12:44:47 +0000 (UTC) X-FDA: 77112855414.08.tray63_1717c2b26fa6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 96AE41819E785 for ; Tue, 4 Aug 2020 12:44:47 +0000 (UTC) X-HE-Tag: tray63_1717c2b26fa6 X-Filterd-Recvd-Size: 6076 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Tue, 4 Aug 2020 12:44:46 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id a79so4358192pfa.8 for ; Tue, 04 Aug 2020 05:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ryvLjVG1MrLc1WL5a6i4V+mIwati9JdZFbrWPVnD1eA=; b=hN+ZgtJj6srfcrMTwrTTNDNvecM0QKaNfxXUGaQinHyJ/p1HA0Vi49iumQ6MOKffgo mQGnl8ezc2TzTY3UVLvA84T5LgQXtB2U3CrHD4r2qSoegVdSTl8hsiww2Fq8h5/26jaT xIMQWyQpyD/ETLg4WMxdyDodK3jSY1djOBITkn2+cFKZOROgQOc5gq3isai/TakLiHCq Di7Fu1+7l+7ZV4G5ucWCDH8ANQHDG+fcVZRdinw7HbHLYww9SZvrwZ45BEsOADkNsRv0 VWrV3t8Q0w71INGlbQOi7bTXJl47XcOQutk/bzOC8vF7nLAzypTDun+kaT7Md9/HTKQd EGdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ryvLjVG1MrLc1WL5a6i4V+mIwati9JdZFbrWPVnD1eA=; b=OIQbIGjvW1xcJLF21zfITUwuVqSEc1nSf6Ty+mugYmjL2Ym03g8Kiv6Z6p1l0btxuv GCgqnZHar0NtG04NruzHI9DQXb/wSboFwrDzZ8fCpDnusY3303ALfVvXkV2jBAI+00U7 +fGbBocEU+MGgbCJ0jMgVTCcF6JGC5VvDrDTv0fmF++9arkoAjfWCJ0kOMvLSja6K/2P 62zYK1qhhu3qITsS5WjbwWN286KiwMBFlrBNa18pkWsUD/03YYb92eQ4mvMu76ypIPqS 6XiGAzOgUWKMAcoT47rUJ1YsZcGv5RnQGy42wHgXK4Plgag+vY6iSljLq2dnaSy42Wl0 CLBA== X-Gm-Message-State: AOAM533HEuQ/xpFxYRtJORGbBf5ltSrvMdBkGEF6WIVcYB4NSH4OktD1 CoqAEuHMj7a4zjZHy9P6NguDF+8ODtUetu35thaxOQ== X-Google-Smtp-Source: ABdhPJz92vXv2YZ8xAVjfvEvO1wlLqHYZ/iFLwwh+P/7VeDOiUsQ0ZpfvH51U83oCk3zQ9RZx6opluDS0JZtta7naw8= X-Received: by 2002:a62:a101:: with SMTP id b1mr845628pff.306.1596545085771; Tue, 04 Aug 2020 05:44:45 -0700 (PDT) MIME-Version: 1.0 References: <202008020649.TJ8Zu7ei%lkp@intel.com> <20200803180358.GA1299225@rani.riverdale.lan> In-Reply-To: From: Andrey Konovalov Date: Tue, 4 Aug 2020 14:44:34 +0200 Message-ID: Subject: Re: [hnaz-linux-mm:master 168/421] init/main.c:1012: undefined reference to `efi_enter_virtual_mode' To: Ard Biesheuvel Cc: Arvind Sankar , linux-efi , Dmitry Vyukov , Alexander Potapenko , kasan-dev , Andrey Ryabinin , kbuild-all@lists.01.org, Johannes Weiner , Andrew Morton , Linux Memory Management List , kernel test robot Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 96AE41819E785 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Aug 4, 2020 at 2:41 PM Ard Biesheuvel wrote: > > On Tue, 4 Aug 2020 at 14:27, Andrey Konovalov wrote: > > > > On Mon, Aug 3, 2020 at 8:04 PM Arvind Sankar 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 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 > > > > > > > > > > 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 Sent out a v2 of my patchset with this exact fix included at the same time I received this response :) > we could then remove the ifdef altogether afaict. I didn't do this part. I guess this can be done as a separate patch, and will probably require some more testing. From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2901060619677912145==" MIME-Version: 1.0 From: Andrey Konovalov To: kbuild-all@lists.01.org Subject: Re: [hnaz-linux-mm:master 168/421] init/main.c:1012: undefined reference to `efi_enter_virtual_mode' Date: Tue, 04 Aug 2020 14:44:34 +0200 Message-ID: In-Reply-To: List-Id: --===============2901060619677912145== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Aug 4, 2020 at 2:41 PM Ard Biesheuvel wrote: > > On Tue, 4 Aug 2020 at 14:27, Andrey Konovalov w= rote: > > > > On Mon, Aug 3, 2020 at 8:04 PM Arvind Sankar = 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 = 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=3D1 build): > > > > > git checkout 7c0265f304de3c3acd02d0015b56a076357bcce3 > > > > > # save the attached .config to linux build tree > > > > > make W=3D1 ARCH=3Dx86_64 > > > > > > > > > > If you fix the issue, kindly add following tag as appropriate > > > > > Reported-by: kernel test robot > > > > > > > > > > All errors (new ones prefixed by >>): > > > > > > > > > > ld: init/main.o: in function `start_kernel': > > > > > >> init/main.c:1012: undefined reference to `efi_enter_virtual_mo= de' > > > > > > > > Hm, I can reproduce the issue, but I don't understand why it happen= s. > > > > > > > > +EFI and KASAN people, maybe someone has an idea. > > > > > > > > This is the guilty patch: > > > > > > > > https://github.com/hnaz/linux-mm/commit/7c0265f304de3c3acd02d0015b5= 6a076357bcce3 > > > > > > > > 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 Sent out a v2 of my patchset with this exact fix included at the same time I received this response :) > we could then remove the ifdef altogether afaict. I didn't do this part. I guess this can be done as a separate patch, and will probably require some more testing. --===============2901060619677912145==--