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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 1C87BC433E0 for ; Fri, 15 Jan 2021 19:19:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5439235F8 for ; Fri, 15 Jan 2021 19:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729699AbhAOTTU (ORCPT ); Fri, 15 Jan 2021 14:19:20 -0500 Received: from mail.skyhub.de ([5.9.137.197]:50354 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbhAOTTU (ORCPT ); Fri, 15 Jan 2021 14:19:20 -0500 Received: from zn.tnic (p200300ec2f0acf007cb1195bb528937a.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:cf00:7cb1:195b:b528:937a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id CE2441EC041D; Fri, 15 Jan 2021 20:18:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1610738318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=vRaLSxM+z9kh51zGEHjPKubHQKF9CpJm494sShQUxrA=; b=a4/U7CvDSqbu111l2vSbwdyJn6bNIhbDvBudnYVeDkOiawxRfoZE+O4onBapZXNhghMypT RoXgibSW7KMHWZdAHMUGOgKcIc7CHreUzLpM/4Mhi9wScv64BbiNkY7wHijyTYTchyc5FS dV3uDP1JAkoR66sJvRC4Dz0YeaPjNE8= Date: Fri, 15 Jan 2021 20:18:33 +0100 From: Borislav Petkov To: Arvind Sankar Cc: Nathan Chancellor , Arnd Bergmann , Ard Biesheuvel , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Nick Desaulniers , Arnd Bergmann , Darren Hart , Andy Shevchenko , "H. Peter Anvin" , linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] x86: efi: avoid BUILD_BUG_ON() for non-constant p4d_index Message-ID: <20210115191833.GF9138@zn.tnic> References: <20210107223424.4135538-1-arnd@kernel.org> <20210115182300.GD9138@zn.tnic> <20210115183203.GA1991122@ubuntu-m3-large-x86> <20210115190729.GE9138@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Fri, Jan 15, 2021 at 02:11:25PM -0500, Arvind Sankar wrote: > That's how build-time assertions work: they are _supposed_ to be > optimized away completely when the assertion is true. If they're > _not_ optimized away, the build will fail. Yah, that I know, thanks. If gcc really inlines p4d_index() and does a lot more aggressive optimization to determine that the condition is false and thus optimize everything away (and clang doesn't), then that would explain the observation. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette