Re: [PATCH 3/4] x86/asm/entry/64: use smaller insns

Ingo Molnar
2015-03-26T09:31:00Z

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, Mar 25, 2015 at 10:18 AM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> > The $AUDIT_ARCH_X86_64 parameter to syscall_trace_enter_phase1/2
> > is a 32-bit constant, loading it with 32-bit MOV produces 5-byte insn
> > instead of 10-byte one.
>
> Side note: has anybody talked to the assembler people? This would
> seem to be very much something that the assembler could have noticed
> and done on its own. [...]

Maybe GCC already picks a 32-bit opcode in these small-constant cases,
so there was little incentive to optimize on the GAS side, other than
making it correct.

> [...] It's a bit sad that we need to overspecify these things..

Yeah, that's sad.

Yesterday when I have read Denys's patch I double checked that there's
no other similar (easily identifiable ...) movq opcode left in the
64-bit entry code, so we seem to have squashed most of them.

Thanks,

Ingo