[PATCH] efi/libstub/arm*: Set default address and size cells values for an empty dtb

Timur Tabi timur at codeaurora.org
Tue Feb 7 11:24:53 PST 2017


On Tue, Feb 7, 2017 at 12:15 PM, Mark Rutland <mark.rutland at arm.com> wrote:
>
>> In cases where a device tree is not provided (ie ACPI based system), an
>> empty fdt is generated by efistub.  Sets the address and size cell values
>> in a generated fdt to support 64 bit addressing.
>>
>> This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those
>> utilities will read the address/size values from the fdt, and such values
>> may exceed the range provided by the 32 bit default.
>
> The description here doesn't state why this is a problem for ACPI.

The patch description could use some work.  It's a problem for ACPI
because EFI-based systems call typically fdt_create_empty_tree(),
which is where the problem lies.

The bug is that fdt_create_empty_tree() literally creates an empty
tree.  By default if a node is missing #address-cells and #size-cells
properties, then it's assume that both values are equal to 1, i.e.
32-bit addresses.

When update_fdt() in drivers/firmware/efi/libstub/fdt.c creates an
empty tree, it then proceeds to inject 64-bit addresses into that
tree.  When kdump tries to process the address properties, it reads
the wrong values because it thinks they are all 32-bit addresses.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.



More information about the linux-arm-kernel mailing list