Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp704954pxa; Wed, 19 Aug 2020 12:30:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgIK7PmewYFUBbqivy2YSWz2z1B81FcAzLHo35gv4IG4BTnXGwizFH3ZNvdQxpy2ZpdIF8 X-Received: by 2002:a17:906:15c2:: with SMTP id l2mr26420426ejd.112.1597865458287; Wed, 19 Aug 2020 12:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597865458; cv=none; d=google.com; s=arc-20160816; b=uQeWo1Uq/kCPgNOus2oaFxXrXCyXF20NEFCFIhP9tqJJPI4KA9OCUf1+JqJ310J73X 1346S4A+teJzwwl84rnuYsJwgREcKayrjJZac1GLrmEXDOD0Ng3lB4embGYEoVigTYjj 8UnGz5xOvTwxH5yuYoRv9+lNA9xy/Kj+kImmbIPJ3mGwRRSm+101PS5MF/wwT2TxI31m 7sQvRlaesGT3VAOWoOQaJTfxAuOt/KKKfkorluM69y7u1nVvwsgJvyYyzZXkHw6kn6W2 AaGa7rEqhjIxI0yUpWiSaP2p7I6f4dBfw6e/EGJDE9JcZAgDel2oAxLWBdhG01W3DyHh YuYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=Vw4+xoevL6HCqwb25tJE3ItRuXy/EdPOYs2kBLSbjws=; b=DXah1docN0fUBtpWUHZx41zJQVUJn1xtMXYQxdhr3RWb58E7lxDnLfBP05DMMbYUqu JS5SzhLgxiA199JSwcFVVFIi17pscuZTQTD/jBJvvJGFJ0dI+W/MsssZdOoPh9clDJRt ZksMfGGsuPD5vyq3C2KoIZw7gNWt0xhl8HWCElmICGt8IWW3DXvyIYPCiDgTa2HGsenJ QhfPZubljm0mOW3uai2EMMEwoOWuuzAUzhhBUQBYGdk+NyP/jmk642BQwxgLmH2U9rT9 IcGCn6uPXb/DRJFaTT5wn6GXeKlNcAuEpFPBoYHHrK7NVUziLFa8h6lByeH7izqKBTgT nUdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TxMAtY5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x16si16292145ejy.527.2020.08.19.12.30.34; Wed, 19 Aug 2020 12:30:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TxMAtY5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726689AbgHST3i (ORCPT + 99 others); Wed, 19 Aug 2020 15:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgHST3h (ORCPT ); Wed, 19 Aug 2020 15:29:37 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB9A2C061757; Wed, 19 Aug 2020 12:29:36 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id x6so11855391qvr.8; Wed, 19 Aug 2020 12:29:36 -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=Vw4+xoevL6HCqwb25tJE3ItRuXy/EdPOYs2kBLSbjws=; b=TxMAtY5Lk67k/57yY8ZQaT7UTKGeCtgnJAejc7o/H6pCqyR64aJJmHf6xRznjPMchp JdyWYSTwnE8vLtLX9MJsi3sf7wns4KdlU2kcoBpSEcSe27acmnFwgT6s7c4P28DPChq4 8Nrsk19y+hvEXg8DWyDS+AusgkUVd6YnnE15coaloaCsQ9ap82jDYwylHBhWm60GY2os AXB1dZfn9Su0j9HOvz2c+HyWPmjHKycbRT2FlsZam3p78VZdcaDeB1i6d0tm9U0bF/Ms 0uTmN92Ntx3b11FJWIIM+RnnQkSmRnag2lfxIHlmvyOMS4c1QTwAfdHNxy1XDneviA1j Rknw== 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=Vw4+xoevL6HCqwb25tJE3ItRuXy/EdPOYs2kBLSbjws=; b=ccwHrJWYvjs7f3vy9Y0eMU7xB7zbArngvHMTjbPrxgKzkKVeOf5LxtXKsVf+lLsnDA 9pBZYF/HQufl/LKAIjgBb9TuHGVPtcQHxpq6KcBIsIxGLiiiCwKU7DE2G5GFg0v1oLK1 wq7AZQDdY6z5OCbwR/m58JVhM565oWMGhmvR7YZQQKzXMxEMDodQuLp9g6IJG44mdYAo NjFr/QOvoRjx7dx7W8HzcQ0E6V8aqtaZXMZ0SNkYpBRaqCTGlPHQdyO5y19DQiDV9Dqk D4VcyGBG6wBfge55C2hW5TkVLELk4ASxC/dh1kzxplgJ5duDYJMihxHwbEpWOBgyjwwL rI2Q== X-Gm-Message-State: AOAM5312mYevlUwXCpSjlcXcldkuJpgkCYOKq6kchd90VbfqBpqB9c9Q jis+2WEk82tOBjgZeUSd3Yk= X-Received: by 2002:ad4:4a29:: with SMTP id n9mr25182148qvz.50.1597865376078; Wed, 19 Aug 2020 12:29:36 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id o48sm29816825qtf.14.2020.08.19.12.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 12:29:35 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Wed, 19 Aug 2020 15:29:32 -0400 To: Nick Desaulniers Cc: Masahiro Yamada , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Tony Luck , Dmitry Vyukov , Michael Ellerman , Joe Perches , Joel Fernandes , Daniel Axtens , Arvind Sankar , Andy Shevchenko , Alexandru Ardelean , Yury Norov , x86@kernel.org, "H . Peter Anvin" , Ard Biesheuvel , "Paul E . McKenney" , Daniel Kiper , Bruce Ashfield , Marco Elver , Vamshi K Sthambamkadi , Andi Kleen , Linus Torvalds , =?utf-8?B?RMOhdmlkIEJvbHZhbnNrw70=?= , Eli Friedman Subject: Re: [PATCH v2 4/5] x86/boot: use -fno-builtin-bcmp Message-ID: <20200819192932.GA58968@rani.riverdale.lan> References: <20200819191654.1130563-1-ndesaulniers@google.com> <20200819191654.1130563-5-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200819191654.1130563-5-ndesaulniers@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 19, 2020 at 12:16:53PM -0700, Nick Desaulniers wrote: > We're reverting > commit 5f074f3e192f ("lib/string.c: implement a basic bcmp") > in favor of -fno-builtin-bcmp. Remove the additional definition here, > too. > > arch/x86/purgatory/Makefile uses -ffreestanding, so there's no risk of > this libcall optimization occurring for arch/x86/boot/purgatory.ro. > > arch/x86/boot/Makefile resets KBUILD_CFLAGS, so make sure to reset this > flag that was set for the top level Makefile. > > Fixes: 4ce97317f41d ("x86/purgatory: Do not use __builtin_memcpy and __builtin_memset") > Reviewed-by: Kees Cook > Signed-off-by: Nick Desaulniers > --- > arch/x86/boot/Makefile | 1 + > arch/x86/boot/string.c | 8 -------- > 2 files changed, 1 insertion(+), 8 deletions(-) > > diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile > index fe605205b4ce..ef7f15bfceab 100644 > --- a/arch/x86/boot/Makefile > +++ b/arch/x86/boot/Makefile > @@ -70,6 +70,7 @@ KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP > KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ > KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) > KBUILD_CFLAGS += -fno-asynchronous-unwind-tables > +KBUILD_CFLAGS += -fno-builtin-bcmp > GCOV_PROFILE := n > UBSAN_SANITIZE := n > This should be unnecessary: KBUILD_CFLAGS in arch/x86/boot/Makefile is set to REALMODE_CFLAGS (defined in arch/x86/Makefile), which includes -ffreestanding.