Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp288911lqb; Tue, 4 Jun 2024 11:18:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6KoKhKKb7FbcVDGQW7YqTsHf5ZLkC6veuemxN8g2vQ7WOzidNmA6pxJguP3+4ACtmznUHGO+RRMc1DgbNBN3Be+alLEp1URSpUY4hqw== X-Google-Smtp-Source: AGHT+IHlPf0pfJx/PCcsd3C5GQ4buvTqRk4R0yYpLXMp0+zpu3MjN58w0kcoIo71FjZqEjmpDUM5 X-Received: by 2002:ac8:7f8d:0:b0:43f:eecd:c817 with SMTP id d75a77b69052e-4402b578754mr1245801cf.18.1717525138626; Tue, 04 Jun 2024 11:18:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717525138; cv=pass; d=google.com; s=arc-20160816; b=xD2XXO/rZN0UxNmN+/Ufx96BVjn9LXN7HwEpQxo2UuSw/8S0PDUww5AHWz56JK1HbI kPJcACoHNmgx6rtkQHQ1o56KKYvaLAUD4sHxuuWHkX8fX+eAxcueH0xfcycX2SsFPRJ7 Ud/pH3/qKQY//OmM7B0sphPdeNiUAMxmEYRjhovRoRfE02Mg7CDV9Qsvnn5DdhWlX2QD YBDmNLObOtToZMx5gn+VrpHvDDl7UKCKCFsgN5iNzJsPLA02bhbpBeeo8DLE+f94RQC8 Ezg2ye6QY88mHY5A0Z6nUBWOB9/rR5+/MXVUtMZfIrEuEYwGZ75BghykTlvzF8nnE4zF rS9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=gX405NnDqd9cTTdpl7BziQ/rwCQy8XeT0hgJmOytkgg=; fh=x4JEXdITJ03f7fvdFTw1BV69Q5AynuprZNh65fG5IYU=; b=GvaybWLO33WDh0Qi0HEtNn/UqJERW5G44oRTZRatx0xTl1suZelis7AKfJjQvrcpZq xGjuv0pmNY+A0hST4IKVBnoe+PTTnlZCll2KXWoclalogWHGXEq1RN7ho3X5pCC2kFEQ BsvpMwjIhCOPjTCtAntjvqWIxZkugtQEirahJ5zsCBh0H5WdNqgu2KeiM4faBo6FyDpd ZrzH5D69yfusG9Hoy90CcDpuv5JAIZxHAg/jvV7nPZw+/69+rl35BvRgUXkNDwoPmsOy HEWdaAdcnhQYupr3+xK6iV+1AN8Kf1n4BkAI3lMn3bA1+TUMIQu4XXPwWM8cdP1fSM6P CE3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="n7dcQ/XJ"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-4401a6911d4si27490041cf.708.2024.06.04.11.18.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 11:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="n7dcQ/XJ"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 500401C217C0 for ; Tue, 4 Jun 2024 18:18:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 628CA14A4DA; Tue, 4 Jun 2024 18:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n7dcQ/XJ" X-Original-To: linux-crypto@vger.kernel.org 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 0FF41149009; Tue, 4 Jun 2024 18:18:52 +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=1717525133; cv=none; b=b2odLni8eBgnI8jky5y4X7oSLMf5B9wked7tFHyjKSs2WErMUrAMpouYnn5iUiIVpjFmS+Or5Vt/X4fltZGTaoGTNxJDNtoP5Buw2Smlok/jg9BZ/guJALIsGpgpscF3jv2znDP+w/8MUKvNNKs23wj7OCJ858bum3jz+f0fkUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717525133; c=relaxed/simple; bh=tLjjYFY5sCNOwFACQ2wDYtXISD6b1TLmfsdB964Sstc=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=YxR4axpYwLTD4mQe/iKd0r4tXuScUqccCI+/hT7xWQYWdzsQoBrix2s5VmiRMihsnnTi4ss6Ang4IUH4+mtKdLu6ILh/f0OQDPmYhFVicE5DT4vLpCDMuKMVJ7tJRmBVNDeYkVwcKRhdOee+VZdqlaOeVq0bgwOziVf9BcU8kTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n7dcQ/XJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1B45C2BBFC; Tue, 4 Jun 2024 18:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717525132; bh=tLjjYFY5sCNOwFACQ2wDYtXISD6b1TLmfsdB964Sstc=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=n7dcQ/XJbYOrNgCq5ESQZ59Xa+8dYD9+SB2DAU+OfLA8+DJ598KJLqQiqzrIkhh0g UKXoqmVVDSu94Mt+rn6Kt5IiGUIlnhjkHcBKGhkcGrtM0QGZQCWFjn9oN0jIncG0fp 0QlSaaAm4hwabRgHQVI9d18LWhK5wr2VVpmu2KdVihNlW73A86ZY77EafzsRt2QQ3r B5ZE8GI052OZDh6CpZHFKpgpvDaWVst//+JGORQKi6AkRNZ1/NhSToLX/ckeeFOkdO Q/yaIOC0UjL6j/KnhlbnzaO6guYALvwQyNR8Mk8553jwwkWCwCeyZlOfimTruQ5bse XlUy3IHVbRpvA== Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 04 Jun 2024 21:18:44 +0300 Message-Id: Cc: , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v9 01/19] x86/boot: Place kernel_info at a fixed offset From: "Jarkko Sakkinen" To: "Ross Philipson" , , , , , , , , X-Mailer: aerc 0.17.0 References: <20240531010331.134441-1-ross.philipson@oracle.com> <20240531010331.134441-2-ross.philipson@oracle.com> In-Reply-To: <20240531010331.134441-2-ross.philipson@oracle.com> On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: > From: Arvind Sankar > > There are use cases for storing the offset of a symbol in kernel_info. > For example, the trenchboot series [0] needs to store the offset of the > Measured Launch Environment header in kernel_info. So either there are other use cases that you should enumerate, or just be straight and state that this is done for Trenchboot. I believe latter is the case, and there is no reason to project further. If it does not interfere kernel otherwise, it should be fine just by that. Also I believe that it is written as Trenchboot, without "series" ;-) Think when writing commit message that it will some day be part of the commit log, not a series flying in the air. Sorry for the nitpicks but better to be punctual and that way also transparent as possible, right? > > Since commit (note: commit ID from tip/master) > > commit 527afc212231 ("x86/boot: Check that there are no run-time relocati= ons") > > run-time relocations are not allowed in the compressed kernel, so simply > using the symbol in kernel_info, as > > .long symbol > > will cause a linker error because this is not position-independent. > > With kernel_info being a separate object file and in a different section > from startup_32, there is no way to calculate the offset of a symbol > from the start of the image in a position-independent way. > > To enable such use cases, put kernel_info into its own section which is "To allow Trenchboot to access the fields of kernel_info..." Much more understandable. > placed at a predetermined offset (KERNEL_INFO_OFFSET) via the linker > script. This will allow calculating the symbol offset in a > position-independent way, by adding the offset from the start of > kernel_info to KERNEL_INFO_OFFSET. > > Ensure that kernel_info is aligned, and use the SYM_DATA.* macros > instead of bare labels. This stores the size of the kernel_info > structure in the ELF symbol table. Aligned to which boundary and short explanation why to that boundary, i.e. state the obvious if you bring it up anyway here. Just seems to be progressing pretty well so taking my eye glass and looking into nitty gritty details... BR, Jarkko