[PATCH] boot: Warn users about fdt_high=~0 usage

Marek Vasut marek.vasut at mailbox.org
Wed Nov 19 18:27:42 CET 2025


On 11/17/25 3:32 PM, Tom Rini wrote:

Hello Tom,

>>> Maybe? I was thinking it should be around this in boot/image-fdt.c:
>>>           /* If fdt_high is set use it to select the relocation address */
>>>           fdt_high = env_get("fdt_high");
>>>           if (fdt_high) {
>>>                   ulong high_addr = hextoul(fdt_high, NULL);
>>>
>>>                   if (high_addr == ~0UL) {
>>>                           /* All ones means use fdt in place */
>>
>> This is exactly the code that this patch modifies . Where in the above do
>> you think this change should be ?
> 
> You're right and I did post the last line of context that's the first
> line of your patch. I really meant that we shouldn't even be checking if
> the current location is misaligned. We should tell people to stop
> disabling relocation.

I see, and in that case, I don't particularly care either way, whether 
we warn always, or only in case of actual problem.

>>> I think really. I am loath to break ABI like this but I'm not entirely
>>> sure we have a choice.
>>
>> We do, we simply warn users and remove the usage and fdt_high=~0 assignments
>> from the tree. The functionality itself does not have to be removed.
> 
> The problem is the functionality has always been for a hack workaround
> and bootm_low/bootm_size/etc were the right answer.
> 
> But maybe step one is just remove the in-tree usage and a big loud
> warning when it's set telling people to not do that.

This is fine by me.

>>> Maybe we detect disabled relocation and
>>> misaligned device tree and fall back to prompt? Or if it's too late,
>>> panic with an explanation? Or maybe we just move it 4 bytes higher. The
>>> device is in a going to fail state anyhow, so trying to recover it might
>>> be OK, and since the device tree needs to be modified by us it has to be
>>> in writable memory.
>> Keep in mind, on arm32 it may not necessarily fail to boot with 4-byte
>> aligned DT.
> 
> I'm pretty sure it is. It's not a problem about doing misaligned reads
> it's that the data structure and it's accessors require 8 byte
> alignment.

I think my knowledge of this corner case was from around this time, so 
old kernel versions might work, new ones will likely break. That is fine 
too.


More information about the U-Boot mailing list