Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp225206pxb; Fri, 15 Jan 2021 11:20:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN1HDzdyEzX3/ducWEFPiU5F28hUD2O7Nnhj11ZO7QQRpSv+YqkvBV7yYFH/jqlAJmlwbW X-Received: by 2002:aa7:cf85:: with SMTP id z5mr10856941edx.274.1610738450769; Fri, 15 Jan 2021 11:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610738450; cv=none; d=google.com; s=arc-20160816; b=Nv0VF2y8tsOIoCWvuAb9XsJgwdhX93v33sUlCRItNqSZtPErfC175lUiiBFtIGQrWo 2pW3CU0zetFK8wKBvzTWf9XnYaWngvdy2OYo2GIl8gRj1gHNbCuue73FV3KLYgHjjXIj 7JHJ7NOU0DCRjgd9xwP26mWjH2BzTAv6xhHC3TdFL0f3t1ooGntIsbK4370ZGSFPtGsL mg3a+pUTk0wR6+EAHmUXKb7zkJwqkr37fzn3M+FgCN74wEx2matXbHUn6C1t/kx7rDMk /mrU0gshSMYL3L7UOkb15DgaLMT6Jt2WcBPXX22foo2P7fEqAhyHPgkJwXa2FVVVbaDw h05Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vRaLSxM+z9kh51zGEHjPKubHQKF9CpJm494sShQUxrA=; b=jKGKI3ydK0e3aMFNu0DlQYlp4ePL18PI4tn31c76dLff9jxLyfMOJet0pbZKwgkebs pXMwQelG2PfQDPSUP7aHSvQocItrFO4LgQj3NSues9gLucvzXLVMVkpqlLA7oMMCIGmS mAAl9OADMoztBWFV19krUMTMgsu9nUG9M7WfkB/d5CSREiwBNXZqw7EkBjwez1K6b8Qo cH1AFYx0U9mc13ImOFjEkGpUecLcFB1EzOsydHyqqpteynhqOKhJD6vMyeZrCxqe9/Y9 KhRpxtsPYnKHz4IX7i2txsPZHMpoYJejX41ayGd0AKX253MPVB6NxfH4vS8b3nDRtvbZ N5Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="a4/U7CvD"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si745433edh.13.2021.01.15.11.20.26; Fri, 15 Jan 2021 11:20:50 -0800 (PST) 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=pass header.i=@alien8.de header.s=dkim header.b="a4/U7CvD"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733215AbhAOTTU (ORCPT + 99 others); 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-kernel@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