From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4DB891E570A for ; Mon, 31 Mar 2025 16:55:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743440150; cv=none; b=QF+w6/Dmpf7V0XhEb9lC0n3SVuu0lMbGDTeCzqMvyHu979bp/E0erI/QxIHFWqWbI4Wd54+Duzz0QuspYYFI0abUybPtaOt5bGjRQ1qXzJGu7CrJAw9WeuOR9OC/dptc1WtrCTRk4LZlcXBQ2V45xwM9lJhELPs4KXKk8peLDrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743440150; c=relaxed/simple; bh=KuniyAJaqXmnw4mfc/EVNPcSIkIBaIZECRgRtd2AdxQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KFBOcrs9h4Ji7yRpCskVUz5R9a1lbmRAwYVvDJeRggzRq2ts90TYFq5YRIrENp6ZVh217onrBQmJpndXlQX7NVG9NMz2FyrnfP4/5BaJTHOi890fj5DLubpdV/paqKi+MnDCDn5Kwrljimap4YRSP5Bch0WGq3VBMF2FA9TqJ7I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W6q/M26k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W6q/M26k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB56BC4CEE3; Mon, 31 Mar 2025 16:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743440149; bh=KuniyAJaqXmnw4mfc/EVNPcSIkIBaIZECRgRtd2AdxQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W6q/M26kwPoFBSDrKDQ2UrTUaCGWgnSNwaY7PZSgftPyEyo6C9iiMnQeMmJu4kqvr /IPyChxdOWXoNKKnbIsV69h+cZeh3/OOAFlMtmAiZ/G8g6sM4X3kT65pdv32lCHtsa 9XAhIjrhZoKCoAjEfrCZE4bWwa6wtir1DspbXSpuohOLti1MhhR63cSOckNtIF6ff4 H7Pv1zUZWVunw4lZxDrPkNh5i87NKyum7t4h7oHAKHImW+aaPsHVWRMZsGuYXpVDlU o34a+8nSqVfqHw62SMPCApdlOzmdMuREG9cKh+Ebw7zHmXChcBRRgv8iYOwC+NSplu YqqIjIDHTSOQQ== Date: Mon, 31 Mar 2025 18:55:45 +0200 From: Ingo Molnar To: Ard Biesheuvel Cc: Linus Torvalds , linux-efi@vger.kernel.org Subject: Re: [GIT PULL] EFI updates for v6.15 Message-ID: References: <20250328070525.2248563-2-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: * Ard Biesheuvel wrote: > So what I would like to propose for this arch/x86/boot/ > subdirectory is to move all these source files there, and build a > static library that can be pulled into the kernel proper as well as > the decompressor, using C flags etc that ensure that all code it > contains is safe for execution from the 1:1 mapping. This is how the > EFI stub static library is built, and also how the code in > arch/arm64/kernel/pi/ is constructed to ensure that it can safely run > from a virtual mapping that doesn't match the one the linker used at > build time. > > How does that sound? Sounds fantastic, related code should be together, like friends around a campfire. Proposed locations, if it's 99% boot/init code (SYSTEM_BOOTING code): arch/x86/boot/efi/ arch/x86/boot/efi/lib/ arch/x86/boot/efilib/ arch/x86/boot/lib/efi/ ... or if there's a substantial runtime code (SYSTEM_RUNNING code): arch/x86/platform/efi/ # <--- already exists arch/x86/kernel/efi/ I'm a bit against the arch/x86/lib/ location for the simple reason that the x86 library functions are usually simple self-contained regular-runtime facilities in C or asm with very little magic, which the EFI boot/stub code is as far away from as technologically possible. ;-) Look into arch/x86/lib/ and you'll see that EFI functionality doesn't really fit there. Thanks, Ingo