From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111070 invoked by alias); 22 May 2015 21:00:05 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 111041 invoked by uid 89); 22 May 2015 21:00:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail.zytor.com Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 22 May 2015 21:00:03 +0000 Received: from hanvin-mobl6.amr.corp.intel.com (fmdmzpr02-ext.fm.intel.com [192.55.55.37]) (authenticated bits=0) by mail.zytor.com (8.14.8/8.14.5) with ESMTP id t4MKxcrb023814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 22 May 2015 13:59:39 -0700 Message-ID: <555F98B4.4090201@zytor.com> Date: Fri, 22 May 2015 21:00:00 -0000 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 X-SW-Source: 2015-05/txt/msg00239.txt.bz2 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