On 23/04/2018 18:25, Philippe Mathieu-Daudé wrote:
> The libfdt does not guarantee than fdt_getprop() returns a pointer
> aligned to the property size.
>
> Assuming the base of the fdt is aligned, a 32-bit property returns
> a 32-bit aligned pointer. This is however not guaranteed for 64-bit
> pro
On 04/23/2018 02:34 PM, Richard Henderson wrote:
> On 04/23/2018 06:25 AM, Philippe Mathieu-Daudé wrote:
>> Assuming the base of the fdt is aligned, a 32-bit property returns
>> a 32-bit aligned pointer...
> ...
>> case 4:
>> -*addr = fdt32_to_cpu(*(fdt32_t *)prop);
>> +*addr =
On 04/23/2018 06:25 AM, Philippe Mathieu-Daudé wrote:
> Assuming the base of the fdt is aligned, a 32-bit property returns
> a 32-bit aligned pointer...
...
> case 4:
> -*addr = fdt32_to_cpu(*(fdt32_t *)prop);
> +*addr = fdt32_to_cpu(ldl_he_p(prop));
> return 0;
So wh
The libfdt does not guarantee than fdt_getprop() returns a pointer
aligned to the property size.
Assuming the base of the fdt is aligned, a 32-bit property returns
a 32-bit aligned pointer. This is however not guaranteed for 64-bit
properties, where 64-bit loads might trigger unaligned access.
Fi