From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750862AbeAOSet (ORCPT + 1 other); Mon, 15 Jan 2018 13:34:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58704 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbeAOSes (ORCPT ); Mon, 15 Jan 2018 13:34:48 -0500 Date: Mon, 15 Jan 2018 12:34:17 -0600 From: Josh Poimboeuf To: Peter Zijlstra Cc: David Woodhouse , linux-kernel@vger.kernel.org, Dave Hansen , Ashok Raj , Thomas Gleixner , Tim Chen , Andy Lutomirski , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , Dan Williams , Paolo Bonzini , Jun Nakajima , Asit Mallick , Borislav Petkov Subject: Re: [PATCH 2/4] objtool: Implement jump_assert for _static_cpu_has() Message-ID: <20180115183417.myyorkvsbte3tnrw@treble> References: <20180115164428.498966552@infradead.org> <20180115164909.836510626@infradead.org> <20180115180405.cdzdgw6tocbsmbrf@treble> <20180115181230.GD2228@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180115181230.GD2228@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 15 Jan 2018 18:34:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 15, 2018 at 07:12:30PM +0100, Peter Zijlstra wrote: > > b) Add another special annotation to tell objtool where > > _static_cpu_has() locations are? > > Almost did that, but I figured I'd give this a try first. But yes I > agree it is somewhat ugly. I'm thinking this is the way to go. Create an ANNOTATE_STATIC_JUMP macro, which is used in both _static_cpu_has() and arch_static_branch[_jump](). Then it's very generalized and all the special-casing for both alternatives and jump tables will go away. -- Josh