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=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6E707C433DF for ; Mon, 3 Aug 2020 18:04:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 95B1222B45 for ; Mon, 3 Aug 2020 18:04:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mQ/M8FnG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95B1222B45 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C99C68D0111; Mon, 3 Aug 2020 14:04:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C49828D0081; Mon, 3 Aug 2020 14:04:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3A4F8D0111; Mon, 3 Aug 2020 14:04:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 9E7BA8D0081 for ; Mon, 3 Aug 2020 14:04:09 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1FC52180AD81A for ; Mon, 3 Aug 2020 18:04:09 +0000 (UTC) X-FDA: 77110031418.14.fear23_3a10fad26f9f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 1250F18227CEB for ; Mon, 3 Aug 2020 18:04:05 +0000 (UTC) X-HE-Tag: fear23_3a10fad26f9f X-Filterd-Recvd-Size: 5211 Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Mon, 3 Aug 2020 18:04:04 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id x12so20397421qtp.1 for ; Mon, 03 Aug 2020 11:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rQffdkDpJsvCogJyVsUeEYROYwZ62G9925/dWTW2BzU=; b=mQ/M8FnGQ+MvFZsxI5wDFtmrrN3hVpHunSd8TNxEjUD7SZ/poA1F2pMYagFR2h5uSG gKg7Di7AMOBSup6o0iSpW4Qx7anJINjwjofg8161nNSbwrkgExvz3Yo37dHOpB3MijN2 aHiWqNXEa0qSiKBWST+4iY3mVmq/fa3aNT8lpbJwYfKva1BYngkx5PQtnlTjWRrOOkYX PNG6k+MTkfHO7IVWfUf3Uzye9Ou4zj3abFdtTZYvFFmbKZhno2gIFoNrfEAVbWUu13P4 SWzq3qj+Fq2YSohPQcUdeSImGjbvViT3VcYwQMsvzP4m7nElya22yV5syHrQPINaNvKV TLbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=rQffdkDpJsvCogJyVsUeEYROYwZ62G9925/dWTW2BzU=; b=Yuo6gsMuRGPupDcIlwOOPd/Y35JIofDarder8uGpVDkGc+FG7fnWv7eRSTOXu6abXa l72JSh1iDUS0OmX1eHapAE+9qnWUpygCf4L0OKG3yMpwVaz3sPCY7f4Mfi61375tZ3Bz mfHR46ksjO1G0sTch6JzIs/dfgK4aQ5KosU1PlNcA3gUrts2wxuRUMM8FvjcRL7F2KQQ 2PelGCwgmfKVdAgpAphKboZ4pg5AReKNOGTXUqNUMMwnNf0RB45WPZEv9Gl6wfdF5r1Q 8Xxt81cFVmqkxVMCF8HXjez9vW7KRE7zWrJ02IkBOyjBkIFZ6gk8WF5CrkMG97Na/HX0 8u1w== X-Gm-Message-State: AOAM531VWQvfoTlZEl+Phnfh3bbLfKH8O+yeAtEP0rRfORhJoXdOQBMZ 6KdHNDhtrQK7DWrVOHrRo8k= X-Google-Smtp-Source: ABdhPJyZKnwtE21BcNyw6qANenzDCUzeQrxt6AYlqaPG4DYmmkJwUSTqVdLMm+vxrDRw28WASv4SDw== X-Received: by 2002:ac8:777a:: with SMTP id h26mr17410449qtu.141.1596477843719; Mon, 03 Aug 2020 11:04:03 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id h13sm21625090qtu.7.2020.08.03.11.04.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 11:04:02 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Mon, 3 Aug 2020 14:03:58 -0400 To: Andrey Konovalov Cc: Ard Biesheuvel , linux-efi@vger.kernel.org, Dmitry Vyukov , Alexander Potapenko , kasan-dev , Andrey Ryabinin , kbuild-all@lists.01.org, Johannes Weiner , Andrew Morton , Linux Memory Management List , kernel test robot Subject: Re: [hnaz-linux-mm:master 168/421] init/main.c:1012: undefined reference to `efi_enter_virtual_mode' Message-ID: <20200803180358.GA1299225@rani.riverdale.lan> References: <202008020649.TJ8Zu7ei%lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 1250F18227CEB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 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?