On 24 June 2018 at 16:53, Lukas Wunner <lukas@xxxxxxxxx> wrote: > On Sun, Jun 24, 2018 at 03:42:19PM +0200, Ard Biesheuvel wrote: >> Considering we had other weird issues involving uint64_t types with >> the TPM code just this week, Actually, that issue involved pointers to uint64_t types, so they seem unrelated after all, but that still means the mixed mode code is fragile in the presence of protocols taking uint64_t type arguments by value. >> I wonder if this isn't a fundamental >> problem with the mixed mode thunking, and so I need some help from the >> x86 gurus (Ingo?) > > Looks like that's exactly what it does: > > /* > * Convert x86-64 ABI params to i386 ABI > */ > subq $32, %rsp > movl %esi, 0x0(%rsp) > movl %edx, 0x4(%rsp) > movl %ecx, 0x8(%rsp) > movq %r8, %rsi > movl %esi, 0xc(%rsp) > movq %r9, %rsi > movl %esi, 0x10(%rsp) > > I don't think there's a way to find out in thunk_64.S if the register > was populated with a 64-bit or 32-bit value, but it *might* be possible > to do it with a macro that accepts a __VA_ARGS__ argument, iterates > over the parameters, checks whether a parameter is 64-bit and we're > in mixed mode, and if so, passes in the high and low dword separately. > That would be nice, but I don't see how the preprocessor can infer the size of a type. -- 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