From patchwork Mon Feb 27 22:21:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 9594355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0244C604A2 for ; Mon, 27 Feb 2017 22:21:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E630E27F54 for ; Mon, 27 Feb 2017 22:21:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9B142847F; Mon, 27 Feb 2017 22:21:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4D51127F54 for ; Mon, 27 Feb 2017 22:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GhbwZ1ibUdStDB36Z2LoabHr+34gx4pyNEOQ8F8CCdo=; b=d68RWyCSXTi7P0buMPXFXDMwT GQYrfLM41vTo6fV4DrdhUEoHtOM11hvfekcS+hfX1bDkJ+iXjVB2kK/PPIZyOS9P4Vkg6jUERPKNA 8rKm4pwkwMlWZHTl3m5gqPOalTIqlWDrNgdYa5ITkmHkecU0/QdvBOEiSU3AgSNYnIuXy6N56Gg+p 7lROpKNOlUrb/SjyIGNNVI9eEzzLDB/QOV4mYwrKltbN/BOVn5FpyQub2s72fTPwcew8dbvYP0xA0 Cnj5f9a8rC/B6umSAMd93tXdh5uToROhX4S8LKSVsSbL6zVuN5ZFfp/L/efpjHd0lnNYhGPdwwRi4 fZsSauDKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ciTg1-0006or-Fi; Mon, 27 Feb 2017 22:21:53 +0000 Received: from mail-cys01nam02on0087.outbound.protection.outlook.com ([104.47.37.87] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ciTfx-0006mF-Uv for linux-arm-kernel@lists.infradead.org; Mon, 27 Feb 2017 22:21:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TyLOY07O92w1FDYtC0adfK7E/4WPXuMYFdXBYgrXrik=; b=KbTo91z8mlWBlVbyRS+3JuGH7RDhHyA5+knIFT4q4RdktRmjFqv7Q7TFP8d0MqKaSG/vUDhorsPw+/VWTOrRUveE4D5X79DsCRLUTUOCOjyV2Tir8oNZYKonE6hrJ9PfBn9sFB98n7QUEvxpC7PGg7x+9lYXOxsMLZsUwwAazIY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@cavium.com; Received: from ddl.caveonetworks.com (50.233.148.156) by BL2PR07MB2417.namprd07.prod.outlook.com (10.167.101.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Mon, 27 Feb 2017 22:21:25 +0000 Subject: Re: [PATCH] jump_label: align jump_entry table to at least 4-bytes To: Steven Rostedt , linux-mips@linux-mips.org, Ralf Baechle References: <1488221364-13905-1-git-send-email-jbaron@akamai.com> <93219edf-0f6d-5cc7-309c-c998f16fe7ac@akamai.com> <20170227160601.5b79a1fe@gandalf.local.home> <6db89a8d-6053-51d1-5fd4-bae0179a5ebd@caviumnetworks.com> <20170227170911.2280ca3e@gandalf.local.home> From: David Daney Message-ID: <7fa95eea-20be-611c-2b63-fca600779465@caviumnetworks.com> Date: Mon, 27 Feb 2017 14:21:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170227170911.2280ca3e@gandalf.local.home> X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: MWHPR07CA0042.namprd07.prod.outlook.com (10.169.230.28) To BL2PR07MB2417.namprd07.prod.outlook.com (10.167.101.141) X-MS-Office365-Filtering-Correlation-Id: 1374d8a0-fb5f-471e-1094-08d45f5ef8c2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BL2PR07MB2417; X-Microsoft-Exchange-Diagnostics: 1; BL2PR07MB2417; 3:iefQaMUW5EPco++0BdMecYTJWERlHIKlAmDf9gbtt8dxo1WZFjAWTD+yeTM8FXQrIAPujBI19kjjysbCKg5M2XwEroPc5odmNyLqdcci/H8L5NgA45RIeG0fcyrddAir9F1m9zNjFQD+XptmpzDU27jSJTfYSzxhDmeh8QtoaHAwiFXpACdvByY1LHyOSjddGhgzo9flJZAxlDinBlcA5//Ukj204wUiKxLsxOB4hm9XFkfevX847t8MoVDiDL3Y8vAb3C5qRqKWUMYAiUuOxQ==; 25:rZUvClGPCroH4b3D6OQ/SAl3KiTwoj/cFq63XJXqugE6rNNuVKtPrt7hocaMRWwiCWy/UyJehsWqz7orllN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/Zysw27qtTghA5HNjnx2YCJ4GkGZ2btbK3j7hcEhFm72wP8Lkxc+hwXou+l5GcyERFBzD9+u08lv320ga1qP9Lb9m3w3PsdFMMj/kv3SR4KfeP9UmQhFe/zzCNpXBo1o79AQVVw+ryGO+Dw2eO+N8+Qhy+W7DiiD5zqhQkegzjr5Ve6G/FxImrFlFPbdUanO+mXG0jmPkFEKus7+fkzDZxeIzWbohhH/RAQYKi1CmlBRRJWztx9icD/z/7eI4EplcMRV/1QAOJmCv3w7cC5QKJHzRD52njcZM83pb5yeS8tcj90LL8wrlIph5ZJhoSIlw3qB5tCsTRzVvymAeh6HGYaAuTUV5yQoEnkfH5zq9lgXJOa18SAsVy0fZARvkFXKf0Yfpqvt77c= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(20161123558025)(6072148); SRVR:BL2PR07MB2417; BCL:0; PCL:0; RULEID:; SRVR:BL2PR07MB2417; X-Microsoft-Exchange-Diagnostics: 1; BL2PR07MB2417; 4:4Cifc4p05CgGVBePIsyf26AOyKBuRqOf8TGoVGqxOVukZc1s/ZPWvZ9me9grw2eaBGlgmdaMYW5xSLxy8lTfBaB79GWh/vMlafpIRtk8mHAjGVFSW4zKq/3a7S75n17yVYY+UTX0pjwevq5/zf/z/5eMbtvbCB1jAUx3JHFENQrfAORlaRSK+y0lEMJYH3BAfMu+C4+ZozptcWNax6wtVLI5/Pk/qeJ3SdTdl3wIfzEwLt3zTysBAPGT9oIcUaRhOVTbo0hlF8eSbGi1+znTL8ef2IRavwK/cBWWjCzpFIGTVlaRk9Q0uVAuRO/lPM7lvD8w+cc15V5Q/O2/2WPVKFY+pjV+R9cLjMkStkIuDrkgbd8LXz3hGM8qIePEYaxYJAdmgYzjR+PCFUJgzYjwoiwMMPH28CP6HStrogJCFGDOFme+5ST/1JeTgLXdl2HExFq6dFfZJmrIH4Ni5J8ehQmv1I+WUm+Vh/qhFnrYyr7KA/vkhxosknWlVn9b7WnIxqa1i8n63jOjhxGuDSTUu1owkMuJHSLmet32pG+PNScaQABix4jbotUZldPfhewa59+vfmyjWf9WkjXbURy0qD+uFx9R1G303HS0DCPuuzxGBNV+COFHCY2XEVdp59t0 X-Forefront-PRVS: 02318D10FB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(24454002)(189002)(199003)(377454003)(101416001)(66066001)(65806001)(65956001)(76176999)(50986999)(54356999)(568964002)(189998001)(270700001)(6116002)(97736004)(68736007)(64126003)(4610100001)(5890100001)(2476003)(31696002)(36756003)(4001350100001)(3846002)(2906002)(65826007)(4326007)(42882006)(54906002)(81156014)(69596002)(229853002)(106356001)(6246003)(6666003)(38730400002)(83506001)(53546006)(6512007)(81166006)(7416002)(2950100002)(8676002)(6486002)(5660300001)(25786008)(6506006)(305945005)(84326002)(93886004)(7736002)(53416004)(31686004)(42186005)(105586002)(92566002)(53936002)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR07MB2417; H:ddl.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR07MB2417; 23:vIONGLVZ/4DjuT7tiTvylJLfHc1FVup0WaDNiY03o?= =?us-ascii?Q?QdqQ6QVWaDZJfYEeMF2SSCwNdtBC+oF6OoGYSW5tAr64oGKJLu15Zm4BBapP?= =?us-ascii?Q?T5+jfBBuq5NxutVe188RcmM1zucwzOC3wfrjxzhMvFQv02DpsYwrFJuZIaTc?= =?us-ascii?Q?hYsIgh6+9qBefdyJzx9hmAf9iqAEq0GYNZFAYSLBvJ580CpYZEH9ZMslVQWj?= =?us-ascii?Q?4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SFZcsvxb45N09tS2/gapn9CIgPnU6/OPquCDcLRsarzKa1X7/iQ==; 24:qi1rNiVuYwW8zczxM6zP+pt/A+BCqE98YfYP22zvlum/CKpe36V+tnpy7W23KqIu83GCEIwAKhIvz5V7mxLYLTM2IJrV+h/HYRlWWrwVEpA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR07MB2417; 7:FNA038Zo2OIN6fc7yc3QdFya4kcevACZO7gbYXxSYY82Fni1mMlFPiiT+C4jL39NyWXOQUHXIrPj7hdMOkCDy57pHhKY6gclpg78xcUX1Qvs6vHnroNc9ALSu3ZpztNH1q4xntL0vN3WICcYHBwzcj428WSmhUxdon0s/kDO28jBdrGPZZaMzg3/ogyryR5283ib5MvOpzCMd42yiJ++dMMRlMYCzJ828C2oFtGOK+ENahGb3/8KGNneze/GkSNWWKRSzp67LlieY3yJTCWuz9NCmwybVH0vyVN/4c2DsJ7rhpBb9q0pk70LXlracmN7h1h4/iOeG721Qmnb4aWYkA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2017 22:21:25.4083 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR07MB2417 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170227_142150_142696_3B2785EC X-CRM114-Status: GOOD ( 16.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Metcalf , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Russell King , Rabin Vincent , Jason Baron , Paul Mackerras , Anton Blanchard , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Ingo Molnar , linux-arm-kernel@lists.infradead.org, Zhigang Lu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 02/27/2017 02:09 PM, Steven Rostedt wrote: > On Mon, 27 Feb 2017 13:41:13 -0800 > David Daney wrote: > >> On 02/27/2017 01:06 PM, Steven Rostedt wrote: >>> On Mon, 27 Feb 2017 11:59:50 -0800 >>> David Daney wrote: >>> >>>> For me the size is not the important issue, it is the alignment of the >>>> struct jump_entry entries in the table. I don't understand how your >>>> patch helps, and I cannot Acked-by unless I understand what is being >>>> done and can see that it is both correct and necessary. >>> >>> You brought up a very good point and I'm glad that I had Jason Cc all >>> the arch maintainers in one patch. >>> >>> I think jump_labels may be much more broken than we think, and Jason's >>> fix doesn't fix anything. We had this same issues with tracepoints. >>> >>> I'm looking at jump_label_init, and how we iterate over an array of >>> struct jump_entry's that was put together by the linker. The problem is >>> that jump_entry is not a power of 2 in size. >>> >> >> ELF sections may have an ENTSIZE property exactly for arrays. Since >> each jump_entry will have a unique value they cannot be merged, but we >> can tell the assembler they are an array and get them properly packed. >> Perhaps something like (untested): >> >> .pushsection __jump_table, \"awM\",@progbits,24 >> FOO >> .popsection >> > > And the linker will honor this too? See attached for mips. It seems to do the right thing. I leave it as an exercise to the reader to fix the other architectures. Consult your own binutils experts to verify that what I say is true. David Daney From 484111a11bb5187a4c190cd80b4a03a18ee7047b Mon Sep 17 00:00:00 2001 From: David Daney Date: Mon, 27 Feb 2017 14:14:30 -0800 Subject: [PATCH] MIPS: jump_lable: Give __jump_table elements an entsize. Since the __jump_table is a big array of non power-of-2 sized elements, tell the linker the size so they can be properly packed. Since each element will have unique "code" and "key" fields, no merging will ever occur, but it should end up properly packed. Signed-off-by: David Daney --- arch/mips/include/asm/jump_label.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h index e776725..c9a695f 100644 --- a/arch/mips/include/asm/jump_label.h +++ b/arch/mips/include/asm/jump_label.h @@ -26,14 +26,26 @@ #define NOP_INSN "nop" #endif +#ifdef CONFIG_64BIT +typedef u64 jump_label_t; +#else +typedef u32 jump_label_t; +#endif + +struct jump_entry { + jump_label_t code; + jump_label_t target; + jump_label_t key; +}; + static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { asm_volatile_goto("1:\t" NOP_INSN "\n\t" "nop\n\t" - ".pushsection __jump_table, \"aw\"\n\t" + ".pushsection __jump_table, \"awM\",@progbits, %1\n\t" WORD_INSN " 1b, %l[l_yes], %0\n\t" ".popsection\n\t" - : : "i" (&((char *)key)[branch]) : : l_yes); + : : "i" (&((char *)key)[branch]), "i" (sizeof(struct jump_entry)): : l_yes); return false; l_yes: @@ -44,27 +56,15 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool { asm_volatile_goto("1:\tj %l[l_yes]\n\t" "nop\n\t" - ".pushsection __jump_table, \"aw\"\n\t" + ".pushsection __jump_table, \"awM\"@progbits, %1\n\t" WORD_INSN " 1b, %l[l_yes], %0\n\t" ".popsection\n\t" - : : "i" (&((char *)key)[branch]) : : l_yes); + : : "i" (&((char *)key)[branch]), "i" (sizeof(struct jump_entry)) : : l_yes); return false; l_yes: return true; } -#ifdef CONFIG_64BIT -typedef u64 jump_label_t; -#else -typedef u32 jump_label_t; -#endif - -struct jump_entry { - jump_label_t code; - jump_label_t target; - jump_label_t key; -}; - #endif /* __ASSEMBLY__ */ #endif /* _ASM_MIPS_JUMP_LABEL_H */ -- 2.9.3