This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH v2] x86: Stop relying on magic jmp behavior for early_idt_handlers
- From: "H. Peter Anvin" <hpa at zytor dot com>
- To: Andy Lutomirski <luto at amacapital dot net>, Ingo Molnar <mingo at kernel dot org>
- Cc: Andy Lutomirski <luto at kernel dot org>, X86 ML <x86 at kernel dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>, Borislav Petkov <bp at alien8 dot de>, Jan Beulich <JBeulich at suse dot com>, Binutils <binutils at sourceware dot org>, "linux-kernel at vger dot kernel dot org" <linux-kernel at vger dot kernel dot org>
- Date: Fri, 22 May 2015 13:59:32 -0700
- Subject: Re: [PATCH v2] x86: Stop relying on magic jmp behavior for early_idt_handlers
- Authentication-results: sourceware.org; auth=none
- References: <9b741597a52258e829bae247216da656d452395a dot 1432257964 dot git dot luto at kernel dot org> <20150522062224 dot GA4736 at gmail dot com> <CALCETrXja3FHMT9WSZQ86ozyi8KsFKmFeR_JDDrt6GtRSLa8OA at mail dot gmail dot com>
On 05/21/2015 11:51 PM, Andy Lutomirski wrote:
>>> #ifdef __KERNEL__
>>> + * early_idt_handlers is an array of entry points. For simplicity, it's
>>> + * a real array. We allocate nine bytes for each entry: two one-byte
>>> + * push instructions and a five-byte jump in the worst case.
>>> + */
>>> +#define EARLY_IDT_HANDLER_STRIDE 9
>> So how come that two plus five equals nine? ;-)
> A "one-byte push" would be pretty impressive :)
Well, non-REX register pushes are just one byte. However, these take an
>> Ditto for the 64-bit side.
> Sounds good. I'll do all this tomorrow and resend.
Thank you! Since I trust you, I'll send you this in advance:
Acked-by: H. Peter Anvin <email@example.com>