From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757213AbbEVVAL (ORCPT ); Fri, 22 May 2015 17:00:11 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37119 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756645AbbEVVAJ (ORCPT ); Fri, 22 May 2015 17:00:09 -0400 Message-ID: <555F98B4.3030308@zytor.com> Date: Fri, 22 May 2015 13:59:32 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andy Lutomirski , Ingo Molnar CC: Andy Lutomirski , X86 ML , "H.J. Lu" , Borislav Petkov , Jan Beulich , Binutils , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] x86: Stop relying on magic jmp behavior for early_idt_handlers References: <9b741597a52258e829bae247216da656d452395a.1432257964.git.luto@kernel.org> <20150522062224.GA4736@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 immediate constant. >> >> 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