[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150326102551.GC27751@pd.tnic>
Date: Thu, 26 Mar 2015 11:25:51 +0100
From: Borislav Petkov <bp@...en8.de>
To: Denys Vlasenko <vda.linux@...glemail.com>
Cc: Ingo Molnar <mingo@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Denys Vlasenko <dvlasenk@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Andy Lutomirski <luto@...capital.net>,
Oleg Nesterov <oleg@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Alexei Starovoitov <ast@...mgrid.com>,
Will Drewry <wad@...omium.org>,
Kees Cook <keescook@...omium.org>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/4] x86/asm/entry/64: use smaller insns
On Thu, Mar 26, 2015 at 11:07:42AM +0100, Denys Vlasenko wrote:
> In my experiment, GAS uses 10-byte insn only for constants which
> won't work with 7-byte encoding; or if I explicitly ask for "movabs":
>
> _start: .globl _start
> mov $0x12345678,%edi # 5 bytes
> mov $0x12345678,%rdi # 7 bytes
> movq $0x12345678,%rdi # 7 bytes
> mov $0x80000000,%rdi # 10 bytes
Right, and since they're signed immediates, the AUDIT_ARCH_X86_64 thing
is 0xc000003e and does not fit in an s32, thus the 64-bit immediate with
bf opcode:
mov $0x80000000-1,%rdi
mov $0x80000000,%rdi
mov $0xc000003e,%rdi
mov $0xc000003e,%edi
...
21: 48 c7 c7 ff ff ff 7f mov $0x7fffffff,%rdi
28: 48 bf 00 00 00 80 00 movabs $0x80000000,%rdi
2f: 00 00 00
32: 48 bf 3e 00 00 c0 00 movabs $0xc000003e,%rdi
39: 00 00 00
3c: bf 3e 00 00 c0 mov $0xc000003e,%edi
Makes sense to me.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists