From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50630 invoked by alias); 20 May 2015 20:54:12 -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 50619 invoked by uid 89); 20 May 2015 20:54:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f51.google.com Received: from mail-la0-f51.google.com (HELO mail-la0-f51.google.com) (209.85.215.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 20 May 2015 20:54:10 +0000 Received: by lagr1 with SMTP id r1so88154947lag.0 for ; Wed, 20 May 2015 13:54:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=JoVDHzT2dDsbQGjRCt22TnKM6fDJDpF7SIbis7uTEw8=; b=ekj7PjPdcry7BJfmZ1ekfk0HSZPmm8doBd3Ny1ToMXt0l4/TvUGFoUhCRy/GMe4d9u AHq3fx780WYfsKde/11+nrp5PcfNgkjR2k3bI94bsKwpwXyUvkxMTh1P+eYmLcpTzMDT 10XEY50o4BVupJYDOPQJMSfKAg0ysxw8XCM8bhnqiUm5wAG9jRoHIrm2+NYAjHJ9MDNT Wk+C0QxDWf2w/nXvhbJgSagrOB5+AGGvT/sm/usp6Ur6dqY7Sdcv718dmfsUw8BK2NmM Vghc5xfjgMXuH4wR6VQxFCgzBahEAEfdthz2TZFDabglZvagZLJb2brKf+gyuh3bOuYq v/KQ== X-Gm-Message-State: ALoCoQnla+GLEbuEb5Iv8RNEe/ihP6TKPXLGMQ7itMSTCE5edcOLuP1z3lOxfQnHTKeFI5dz2Af+ X-Received: by 10.152.18.194 with SMTP id y2mr24303430lad.74.1432155246710; Wed, 20 May 2015 13:54:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.170.233 with HTTP; Wed, 20 May 2015 13:53:45 -0700 (PDT) In-Reply-To: <555A4CCC.2010102@zytor.com> References: <554B6E0102000078000778D0@mail.emea.novell.com> <555A4628.4060802@zytor.com> <555A4B67.4080201@zytor.com> <555A4CCC.2010102@zytor.com> From: Andy Lutomirski Date: Wed, 20 May 2015 20:54:00 -0000 Message-ID: Subject: Re: Avoiding unnecessary jump relocations in gas? To: "H. Peter Anvin" Cc: "H.J. Lu" , Borislav Petkov , Jan Beulich , Binutils , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-05/txt/msg00199.txt.bz2 On Mon, May 18, 2015 at 1:34 PM, H. Peter Anvin wrote: > On 05/18/2015 01:28 PM, H. Peter Anvin wrote: >> >> OK, that is probably too recent. The simplest answer I think is just to >> .balign 16 each vector. This is init space... some extra padding really >> doesn't matter. >> >> Patch attached (still in compile test). >> > > Corrected. Egads. Now I understand what that code is. I don't like the balign, since this has nothing to do with alignment -- we're creating an array of functions. Can't we make it explicit? #define EARLY_IDT_HANDLER_STRIDE 9 ... .rept NUM_EXCEPTION_VECTORS . = early_idt_handlers + i * EARLY_IDT_HANDLER_STRIDE .if (EXCEPTION_ERRCODE_MASK >> i) & 1 ASM_NOP2 .else pushl $0 # Dummy error code, to make stack frame uniform .endif pushl $i # 20(%esp) Vector number jmp early_idt_handler i = i + 1 .endr gas will error out if we try to move . backwards, so this should be safe. --Andy