Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7362558imm; Thu, 28 Jun 2018 02:26:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ8xBOO0JJObMyzfATBbl+ggpp835yHmNdZElocehhiqP2YuZo+l38iWNo5JLlMYnAdpL6h X-Received: by 2002:a65:4a90:: with SMTP id b16-v6mr8067538pgu.136.1530177996601; Thu, 28 Jun 2018 02:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530177996; cv=none; d=google.com; s=arc-20160816; b=BP2ZcArWciNZsK4LVCqUU/kznP5uCQ0zBIi8W8vledYci1kZLVMom24FooW/yFq1IH a2xQd5nNg7vexqkr6g5jmMPyvgVTVUTxrAXxGH3EYF2gjvdbCmEpSgOrSOFWklUnm1aN HQY5l6qE2wY0eU5UsUBfzP+c4mPrlLimRDOFPSXL5ePAEfMLb6ABKa/RONDgrNOr3dA4 6vnBnuodqD4CTEex8ISA5BlnjAR34kY+VRuxJpY5EPyrWMFH7ynTD6Tgqg8O4lK83Qj4 a+FVe9pt/T8g6KtMLhvZFKXjjZIz/4wLWQXQ/D1FK/87wnbXnchG40/+r/Syg8BB3N4M TFmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=MHURYBeQVeoBPbObVLSYcO/S6E2cSgoicvv6fj2+D0E=; b=y4DgSmF2Rv1+v0lokXnXBSVfJUuumDLm3H0J6yJu2qZyZe4mNxOsQMrAf/7sUFBHlS nt4U1D8Kmj4DKLgUrmAPU7NcZHzXPY0ZNLvCNzF/H41wSAO4L6huVrn50aAvlmbh6KDS +F3QeMpN5uvXrmGD0KONQEI9yWIIj58aqeHAn9hyPZPmpUqm0ul8e/OtCL9jE4MCXeow C8urC9o0bfnUf6doV+hHfW5y8Ufgh/hMrXkCOCIGNnWwVpdHfI65hx2uoSuT9g9CN2Bg aQ4Io0hOHH0Zt/FlqA69zQNVwIGcijkNnmNCbG1LjDiHy+EljlVWNvoTN025z1KyHyAw sr5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=igwJWOfq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 132-v6si6295494pfy.293.2018.06.28.02.26.18; Thu, 28 Jun 2018 02:26:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=igwJWOfq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935087AbeF1JZQ (ORCPT + 99 others); Thu, 28 Jun 2018 05:25:16 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53164 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935016AbeF1JZO (ORCPT ); Thu, 28 Jun 2018 05:25:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MHURYBeQVeoBPbObVLSYcO/S6E2cSgoicvv6fj2+D0E=; b=igwJWOfqW6fZAREOPe3F0OorP hUW3vmGDEaXrUC16MNfIvMBm7gMBfpBErraIlc4GmKEydnCSZqNTRB0XbPsVMRh+q5lFNrK4a18IY WScqX90kaHQO5uNvZFYTIANVo8dt7Lc8zPIzciNMDVTDDynDm0nUPxGTpfDpUniij6N2e6tixd2Qh IMsnYzUno/KWGQAFanQh/h3CPc8FDUqpLlpZuFIwBHCgFh1bgvGYcJKBkkd9+olv4JxjHs2zBDK0I ulWpXcZY/59IxAUDC3v/r60Ua86Y7ly0Vrzbogf2blFueoWUtxKWUQc1nfyBSX8aWFrYGNHW5wX+e ejweBnX4w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYTAo-0002yp-4A; Thu, 28 Jun 2018 09:25:06 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 904982029F1D5; Thu, 28 Jun 2018 11:25:04 +0200 (CEST) Date: Thu, 28 Jun 2018 11:25:04 +0200 From: Peter Zijlstra To: Ard Biesheuvel Cc: Linux Kernel Mailing List , linux-arm-kernel , the arch/x86 maintainers , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , Steven Rostedt Subject: Re: [PATCH 2/5] kernel/jump_label: implement generic support for relative references Message-ID: <20180628092504.GC2494@hirez.programming.kicks-ass.net> References: <20180627160604.8154-1-ard.biesheuvel@linaro.org> <20180627160604.8154-3-ard.biesheuvel@linaro.org> <20180628085003.GA2494@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 11:04:45AM +0200, Ard Biesheuvel wrote: > On 28 June 2018 at 11:02, Ard Biesheuvel wrote: > >>> @@ -56,7 +72,9 @@ jump_label_sort_entries(struct jump_entry *start, struct jump_entry *stop) > >>> > >>> size = (((unsigned long)stop - (unsigned long)start) > >>> / sizeof(struct jump_entry)); > >>> - sort(start, size, sizeof(struct jump_entry), jump_label_cmp, NULL); > >>> + sort(start, size, sizeof(struct jump_entry), jump_label_cmp, > >>> + IS_ENABLED(CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE) ? jump_label_swap > >>> + : NULL); > >>> } > >> > >> That will result in jump_label_swap being an unused symbol for some > >> compile options. > > > > No, and isn't that the point of IS_ENABLED()? The compiler sees a > > reference to jump_label_swap(), so it won't complain about it being > > unused. Ah, ok. I hadn't figured it was quite that smart about it. > > Meh. I thought IS_ENABLED() was preferred over #ifdef, no? Dunno, I just reacted to the proposed code's uglyness :-) > ... and it means the sort() routine will unconditionally perform an > indirect function call even if the arch does not require it. Yeah, not sure I care about that here, this is a one time affair, very far away from any fast paths.