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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 2, 2017 at 9:23 AM, Goel, Sameer <sgoel@xxxxxxxxxxxxxx> wrote:

> Any tool making the device tree update should be checking for the cell sizes before
> assuming a 32 bit or a 64 bit value.

To be clear, Akashi's patches already look at the cell sizes:

+static int __init early_init_dt_scan_usablemem(unsigned long node,
+               const char *uname, int depth, void *data)
+{
+       struct memblock_region *usablemem = data;
+       const __be32 *reg;
+       int len;
+
+       if (depth != 1 || strcmp(uname, "chosen") != 0)
+               return 0;
+
+       reg = of_get_flat_dt_prop(node, "linux,usable-memory-range", &len);
+       if (!reg || (len < (dt_root_addr_cells + dt_root_size_cells)))
+               return 1;
+
+       usablemem->base = dt_mem_next_cell(dt_root_addr_cells, &reg);
+       usablemem->size = dt_mem_next_cell(dt_root_size_cells, &reg);
+
+       return 1;
+}

This function uses dt_root_addr_cells and dt_root_size_cells.  With
Sameer's patch, those values should be 2 and 2, respectively, on ARM64
systems.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux