Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1920158rdb; Tue, 20 Feb 2024 10:50:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWaV8W4qphxpCI7hTegEkCk2yupzRlHec+P8Q1JHg7VkzSpNjoKjObXFDD4oYJtSp4wjBjBvj+GhlrXQo40TdB9CiO8i+gxVCeZFsAh9w== X-Google-Smtp-Source: AGHT+IEmqx6sJI40L34o6nwyrkYX2rmUoNhvlZvwuzEQGPioGlQ6jIj+3M7TGibShWCDspRDIlIH X-Received: by 2002:a17:90a:ee90:b0:299:564f:c7d4 with SMTP id i16-20020a17090aee9000b00299564fc7d4mr7175809pjz.20.1708455005145; Tue, 20 Feb 2024 10:50:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708455005; cv=pass; d=google.com; s=arc-20160816; b=cjlfstkOzT5aOdDyxBY/lWq2J0rAEJ9woQyD7IBmHfZlqM3n6O3Ud15aaB0cpmblAF AInZl37YMS2Up6bSrVjolyfOl5EDhX/m6xSafsovA6CqyDcszunCpL5j2D4ukiYDZ6Yx MONI/1bv+RkyOEQDzt3jffIbrumTS4LCjZ3bD2vUcogf+bUBL+YPu9q0IZnkILffkoYR 5NiJCalbcj4jdzatE/jT2kJLUhJfOpUMCl7AMGTge5vYNW23GE4TT0GsH1NLE9+Gxbuv nXKJdV8PgVYOg6nHVuHKayaeTW+iG9yRVH7hCgF5Cqq66fdxMqCSEPQcCn8D2KQ3OIVc iP5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=npMUci3aqTEHFqoIBlr8aoaJrNNT5ta4aFSu/bjYkpo=; fh=tgnOrAk2fjdU17zdI6q3bZcYfGicSMZSqgyB0BKyArI=; b=qZ9TYwZoiKJh/oYXY6S7ke4A17aLWPTxJkt8zNKSLgovaAiwLQt2d4GHKoRvjwNLX/ 4bmnDyNtMwRh2MSyUng8XmSVvpfHvbZSkGAfFaSoT42fzKPHigoPWFEzCPxcjIG6nBNf Z/SZV5dVnmSlvQimCR35t+0lEuQYfPBmd6qnOe6NDh92xkJ7R3vGBeEGoU8kViyOUvNH u/FadLyM5N39AbitphPaEwewGNzo83qkiRkbE8GLvQ2nYFaYR/kecc4MFysLof8Cxv5q GY8MA9qxRZCgxbtgLavLj0v5h6OyD+4FaWJiVpBP7J70IB/eCXEhGt+23qbi0qu4a3rc VXaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=Ev2f7jnX; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-73541-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u7-20020a17090ae00700b002993310acffsi6680102pjy.179.2024.02.20.10.50.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 10:50:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73541-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=Ev2f7jnX; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-73541-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9DE38B21980 for ; Tue, 20 Feb 2024 18:47:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3665414A4C8; Tue, 20 Feb 2024 18:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="Ev2f7jnX" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC529130AD9; Tue, 20 Feb 2024 18:45:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708454752; cv=none; b=IGfDcPvzvECtlz1Xb1dSYBTIyQiapvNKGaaHHDXxF1X1tgdDETjb/3zv9Wa/6ayHXc1DfpI5FACo01oMVYtaK7JTCt0/lX0fJr7cofnbLAcGyHcHNLSo0o+FILm6p7gM/y++c5GOiNOw2Wg1QGoWWrRZIJPr7pjF7Ix9D9He5oY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708454752; c=relaxed/simple; bh=WTrXf4SbMFDefrf4t0yXfJ+Qx9gR2qrGFB/qrjo+/UE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MEfUiRqkdpKlReHvyVYs5dtSfpEhKJlrZEQJKQfGugSxtxjKTDP/i1Gjj7epwCdzuB3Pi3ziuPEMN2E52f8huDv7CT+iXCqaqr1+f2TNO+rVKwWllw81JAc8UXxIMnU+i+Zos0ruWM7ZkYk6wa6D28k7HI1pkdvCgjw9SGCMOtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=fail (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=Ev2f7jnX reason="signature verification failed"; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id A89EF40E0192; Tue, 20 Feb 2024 18:45:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=fail (4096-bit key) reason="fail (body has been altered)" header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7SLPSg4QRKna; Tue, 20 Feb 2024 18:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1708454738; bh=M5JyPXMACvJDaoY+/xJBALRa25X6wvkga3r70XUpxdA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ev2f7jnXwAUt0ub/SLZVKPipxoDAEpL6j+bWEC9DDMKiixTTpnFZgXCRvxQ5lLu8I locy+RvHh/r5FQReiCaoe5R9/d4cOFG7YCQWxmmN2TCHbKl6E52UkoIK9N2eyU2U7L CF1DWmLKEN9G0sytRXX9DvzXclYaq6gHdw7MynBS3nzY5RAbBuL0vfkgRx3cHCIeeh wxqVVzkkJWsCK5WmtSvls8JqbhRVnpCIbosa32022myuucg7SOVu1tRvhX2VL6vPjs 1HBxCcdKDSFs6TRtxmvTaBCALulRF74c0B0M8fbzxwPSyDQ54EFmSMjLsd7akdIJzP +DEOLtQzXPUi1M4729nWia7bSm7QsO/Cc9iZ05IGGvE10KYJvrzcn7Mq2kYRlQQ1n0 5rPkjgscnRF67PkChNhBwZli2Jkz+Do0cFl/c04Omaiun4BsrhORUeFxOkQDCQ5eWd uC5DA7kxzfXQ1Bu7+Dk81WH92zi3eL0135xjSiiYGPD8p4AGcRoKgRE4zmSLO255B/ oSVHUCtx+wnS3fwKjuvjcNy5Z+sGdV/vlKt0t6RJyDHjlYNtMVLJNBm1TTFT6LowXw wjWkTEJeBDk9oNDB9P4aIGmnPLPtWq1kuW2yJp/dd5JTuDa8GWAoJw3Rhmi0uVFZJa FEC5IeloOusbjbL1Qx7YFQgw= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id AFABB40E01BB; Tue, 20 Feb 2024 18:45:19 +0000 (UTC) Date: Tue, 20 Feb 2024 19:45:13 +0100 From: Borislav Petkov To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Kevin Loughlin , Tom Lendacky , Dionna Glaze , Thomas Gleixner , Ingo Molnar , Dave Hansen , Andy Lutomirski , Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Justin Stitt , Kees Cook , Brian Gerst , linux-arch@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v4 04/11] x86/startup_64: Defer assignment of 5-level paging global variables Message-ID: <20240220184513.GAZdTzOQN33Nccwkno@fat_crate.local> References: <20240213124143.1484862-13-ardb+git@google.com> <20240213124143.1484862-17-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240213124143.1484862-17-ardb+git@google.com> Content-Transfer-Encoding: quoted-printable On Tue, Feb 13, 2024 at 01:41:48PM +0100, Ard Biesheuvel wrote: > From: Ard Biesheuvel >=20 > Assigning the 5-level paging related global variables from the earliest > C code using explicit references that use the 1:1 translation of memory > is unnecessary, as the startup code itself does not rely on them to > create the initial page tables, and this is all it should be doing. So > defer these assignments to the primary C entry code that executes via > the ordinary kernel virtual mapping. >=20 > Signed-off-by: Ard Biesheuvel > --- > arch/x86/kernel/head64.c | 44 +++++++------------- > 1 file changed, 14 insertions(+), 30 deletions(-) Whoops: arch/x86/kernel/head64.c: In function =E2=80=98x86_64_start_kernel=E2=80=99= : arch/x86/kernel/head64.c:442:17: error: =E2=80=98__pgtable_l5_enabled=E2=80= =99 undeclared (first use in this function); did you mean =E2=80=98pgtabl= e_l5_enabled=E2=80=99? 442 | __pgtable_l5_enabled =3D 1; | ^~~~~~~~~~~~~~~~~~~~ | pgtable_l5_enabled arch/x86/kernel/head64.c:442:17: note: each undeclared identifier is repo= rted only once for each function it appears in make[4]: *** [scripts/Makefile.build:243: arch/x86/kernel/head64.o] Error= 1 make[3]: *** [scripts/Makefile.build:481: arch/x86/kernel] Error 2 make[2]: *** [scripts/Makefile.build:481: arch/x86] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/mnt/kernel/kernel/2nd/linux/Makefile:1921: .] Error 2 make: *** [Makefile:240: __sub-make] Error 2 --=20 Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette