[GIT PULL] arm64: UEFI updates for 3.19

Ard Biesheuvel ard.biesheuvel at linaro.org
Fri Nov 7 03:06:02 PST 2014

On 7 November 2014 11:48, Matt Fleming <matt.fleming at intel.com> wrote:
> On Fri, 2014-11-07 at 11:29 +0100, Ard Biesheuvel wrote:
>> I have confirmation from Matt and another Intel engineer that adding a
>> (arguably redundant) 'u32' cast solves the issue.
> I think we need to get a better handle on this.
> It is completely surprising to me that type promotion from u32 to u64
> goes through sign extension.
> And by "surprising" I mean, it sounds wrong.
> Ard, if you could throw me a unified diff of objdump -dr vmlinux, with
> and without the u32 cast, I'll take a look at figuring out what's
> happening.

With my compiler

gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)

the objdump of drivers/firmware/dmi_scan.o is identical with and
without the 'u32' cast.

If I look at the original code:

dmi_base = (buf[11] << 24) | (buf[10] << 16) | (buf[9] << 8) | buf[8];

I see a 'cltq' instruction in the dump that disappears once I add the
'u32' cast (which is what we addressed by introducing the
get_unaligned_le32() in the 1st place)

So, I'd happily share more objdumps, but perhaps we should find out
first which compiler Yuanhan has been using?


More information about the linux-arm-kernel mailing list