From nobody Tue Nov 28 17:56:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sfqs62zfwz52JpT; Tue, 28 Nov 2023 17:56:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sfqs62M3wz4JYC; Tue, 28 Nov 2023 17:56:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701194202; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fs/sEljDSkm2yBz/FBhm9q3KYxFnM9opK3NidhXQfCA=; b=S8roNCrYr0s8B72ARQUgGtBqtRO5wpSwv9pe6qiazmbM6NVoKgHgr/9mvBgZiV3Bpcrbk5 DMfeB8L3JN57Trbj8haxSGaKRbXcgZLyveNI07EZpRAUCZkp7Z/+yvVyPbVs+/UqVzYbKt eGoK63q77+X0KknKyptDz+x+foNxF+Hfl5TI5gQzb1sAesn38id4l7fOrLooP6s6PVNblc JYCZFIxWQFPwzN+8E93VnQwWo4tzzhQ5VkpwV5NV9AIve5bZEFVcuyV/bkmzGZP4u426sd 40m8zfFFfQC3kyvO9V1b8BswmdeeHRh7wNzTicxTxzH/mZgOsYpBN+RMF8JJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701194202; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fs/sEljDSkm2yBz/FBhm9q3KYxFnM9opK3NidhXQfCA=; b=tetZRECf/nfy6e93D08DNyaqwhyTjFu7F6SJ1DNHGw5N4PpUfFZLoYT9vWPkozkwvQwb7L 7dEYN0pV6SFnxGsGBreFGpxUW8YSGFZ5nA1iLnlyOu/FMY/Gsi89JuUUelJj1rP26vDCD/ SAkDbN0XFJ9rzJ7cqSjY1OXzLPxfRD0Gq/ig02GVWkjyr3X8QXNnTSUuJmOPQu2sH6XRiN 99c/kHL49ffTcrXJm4UOmNWaLLzSSc0AtHRqiUomP4VnUyqvo9Az7DPEMxmovd59/Df8zI qSMWtlIi28rPf0kRRq/8a0H6uMCOxWJCiqGt/Z5+IrxSEK38uWz3IOCRHG8hyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701194202; a=rsa-sha256; cv=none; b=KO/SJTRLV1NWWtg5GDDsTCodzBO4LYAaealtmqeSWhPmvcTUZ3wsrf7kjIDynr1UxxZvoM /5DlxDtTaa3YMCUlQnEMXrAO9C82vEsATwEbTf0InvatQ6fF7VYOOR2Ar/PzMIXH4etLJd iDY83yfdi02p39xb6z/+Pe49R2Sl1eqeGC8tj/a0Pt+m2nU+T/PExht7YFzrALvxZPIH9+ 0AtpKKXz6OFrWY8Zkzv2wQlJRbK/fvr3RzKU9WV/xjEQJV4bfzUxEK7c758m9Ea3jfnLwc C3uc0SUdayeB1jhfUNOsa6x7WHzEPOY5BAPkqTAD0crOVJLniWTeYp82mVSPTg== Received: from [IPV6:2601:648:8384:fd00:b9d4:6be:a338:f57a] (unknown [IPv6:2601:648:8384:fd00:b9d4:6be:a338:f57a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Sfqs54rgBz1Mwy; Tue, 28 Nov 2023 17:56:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 28 Nov 2023 09:56:40 -0800 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: c596126a5d3d - main - pmbr: Only load the first 545k rather than error out Content-Language: en-US To: Warner Losh Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202311272246.3ARMkNS1037267@gitrepo.freebsd.org> <8fa6ed4d-c26b-4dd6-86f2-c3751f86d426@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/28/23 9:07 AM, Warner Losh wrote: > On Tue, Nov 28, 2023 at 9:06 AM John Baldwin wrote: >> But also, can't you just leave a gap in the partitions to leave room >> for a future ESP? It might not always be safe to load a full 545k >> depending on if the firmware has reserved some of memory just below >> 640k. 545k is an upper bound on how much can be loaded in terms of >> 640k - the load address, but the practical limit might be lower. It is >> probably safer as a general rule to keep the boot partition closer to >> the size of the boot loader and leave a gap in place instead. >> > > Today we load 512k always. Well, we load the partition size always. The default size of the partition has grown over time. Arguably we should have been using padding instead of growing the partition, but that is harder to write in installer tools, etc. When I wrote pmbr I on purpose used the partition size as the size to load rather than trying to assume information about the payload and parse a length from the payload due to the limited room in the MBR. I think we started out creating freebsd-boot partitions that were 64k and later grew them with a desire they could be replaced with an ESP partition, but ESPs need a minimum size of 512k? -- John Baldwin