Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp635834iog; Wed, 15 Jun 2022 09:08:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tPco3frPy2rfT7Lg53IUnf52RAoS/UVlTX8MFEFYGietGUEFrkyg2bHTrLnzO2Lqpe54xG X-Received: by 2002:a17:906:739d:b0:713:c3f4:6ef with SMTP id f29-20020a170906739d00b00713c3f406efmr513284ejl.180.1655309307656; Wed, 15 Jun 2022 09:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655309307; cv=none; d=google.com; s=arc-20160816; b=w4PmhhvNy9zahz9VHvQiqsv9QzkAfNGoDSx4P14GGb+kSVLmyVyEVsRxR0Hi3qA+rC wDCmKbdh4LP4eIIwGSSKwFGTVzwRORKU+sL4iEG5p0EEnW6l6xoedXts2As9+GdRTbSz ICQomaWRO+/UGeJTqc26rJ9iKQ4IhlmkI1SA+BpvOz6kM38F1+VVEiTHLZHmUdJNtyVM wPMPLRwOg6ZRF9NL4FN7JuNK5dkOxJcelBRrOjEN8mX8/0HA9i+c091uykB/1P9cYQat si+xseNkK1Jsg/k304GkOUG9ObBiSmpLomJj+wU685LjiZsmScMxtlxUwXzW6ZD17yZB elnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4j+OY592QGRr2Bg+CzVeBLt5I39rlwUfJgC/rtWUmXE=; b=qJNyFgISGinIQsveglCU+Fqup7DvVXt5MF/4NsRuPPgBpuV0x9EGsCJmg6A+qn3c1r yMFoayVBdlt9ro4wDTF4L28kHGN5x/OavO5uxmqWzm2wqs0DfyZUqJtWzPsszWlIsE9q X9Yuy48PLl4aDLCb14gGo+vRfKOLAT73qWnbEZ2/uyFUEZN+eEPAFFYTyRoiPoAUraph N6yuFDcjblZVnZV16qBwaSEXUL1rj/an+v13GmxwrkJAM+ZN1WtZjBZ1d0izHlQZjJfR uo3BD6k/bjLEecOGs8nAsQSnoPEvJjhKXNBNVlAYYYS/AkHWMzzrSziFXWcTpn1Spu98 d0hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=POC0aKJe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a17090699c100b007122fe7f49csi15900672ejn.424.2022.06.15.09.07.59; Wed, 15 Jun 2022 09:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=POC0aKJe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236365AbiFOPly (ORCPT + 99 others); Wed, 15 Jun 2022 11:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbiFOPlx (ORCPT ); Wed, 15 Jun 2022 11:41:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7542E69F; Wed, 15 Jun 2022 08:41:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DF88EB81FCD; Wed, 15 Jun 2022 15:41:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17F57C34115; Wed, 15 Jun 2022 15:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655307709; bh=4W3jsjWJz1C/Sx04Tfe1wqMqpWb2MMMxBdXzowiBwj0=; h=From:To:Cc:Subject:Date:From; b=POC0aKJeGNB7XE6Kdew/cLf56vQ1GVOjdO2F91ip1Tbtr9z2Ae4tUdwjMmo3EWpAY LJMzPuTClEcbqsqdfRbERawI42b1v3fkXtT026TJc0AbrZhr1LtoZq+55rtXVHtY5s IH1sr0Wu+YGsD8goyoE753TVy9dfDgOTSz66NVIvFHsm9WUQkLRLak7ccL5yWRK+CJ /gK77t18jAy4rC7itoUN2Gyhr7KblsZ4NAxn89whuf4nLqIZCdvU8/w0rXzeIK+X9o lvLxXGlFTrMG1VZ0jo5QFSfHhG37plALl2uCPzQr4joSUFdHzg7sIApHTNozoDsi0o nyxLT0jA8WTUg== From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: Ard Biesheuvel , Peter Zijlstra , Mark Rutland , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-mips@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH v2 0/3] jump_label: get rid of NOP patching where possible Date: Wed, 15 Jun 2022 17:41:39 +0200 Message-Id: <20220615154142.1574619-1-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2266; h=from:subject; bh=4W3jsjWJz1C/Sx04Tfe1wqMqpWb2MMMxBdXzowiBwj0=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBiqf2wp3rY7kfOcb3a6vq+iySWA8sjXdE7fisy+IP4 5V4b7LOJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYqn9sAAKCRDDTyI5ktmPJBy1C/ 9CfZWST0pKJSzgtTRNYSOV/OB4KGvjvqU/RIT7j6gJrPJnBRnp0rAEyyHP70OXshALiz9UAWy4F/V3 MSOJScr97M4oIHuL12lFzUtO6gAvL4Jgo3+vpILcGidFqTs+kCbASCHsXHsXsrAxrJ+4RJDtGMadnS s2SviCOCJROLUM6j685o4HmrCG5ij50txvEDRWzjj7Zcfgl78JiBbTSYNScs8bH0kH0RxgvyNgcsQV NHWtFttrJhoTzfWa0F6gHLsBaOk2VErNYpx2JB3W6jpZPIO+4OpxG0cfxE4nl6LAFRcsAikVZ2j0bL Q4Prm1CBBp7bl3uELp/+cucFU1zIApBMLDra25RE+jQaWyu+GgVIdLGwUTHPEuUPLNk5oSp7AmQUL+ NKBiuUvAbfBuM5ts9BtZ29WbkXMM17mmoN/BoGBuzqn1S7c0QHnWfXLDIWGvar5tB6k+5Gc2HLMb5X E0mD09H9pc3jlLmvrMB0jEufoHOaw5K275xaPMz/sMB7Y= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only architecture that actually needs to convert compiler generated jump label NOP encodings into something else at runtime is MIPS, because the assembler cannot be trusted to emit a sequence that can be safely patched into a branch instruction. All other architectures either do nothing with jump label NOPs at load time, or patch a perfectly good NOP into a different one, or into the same one - none of this seems very useful, so let's get rid of it where we can. Changes since v1: - use a default implementation of arch_jump_label_transform_static() instead of an empty macro in patch #3 - fix MIPS with CONFIG_MODULES=n - add acks from Mark and Peter to patch #3 Cc: Peter Zijlstra Cc: Mark Rutland Cc: Thomas Bogendoerfer Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: linux-mips@vger.kernel.org Cc: linux-s390@vger.kernel.org Ard Biesheuvel (3): jump_label: s390: avoid pointless initial NOP patching jump_label: mips: move module NOP patching into arch code jump_label: make initial NOP patching the special case Documentation/staging/static-keys.rst | 3 -- arch/arc/kernel/jump_label.c | 13 ------- arch/arm/kernel/jump_label.c | 6 --- arch/arm64/kernel/jump_label.c | 11 ------ arch/mips/include/asm/jump_label.h | 2 + arch/mips/kernel/jump_label.c | 19 +++++++++ arch/mips/kernel/module.c | 5 ++- arch/parisc/kernel/jump_label.c | 11 ------ arch/riscv/kernel/jump_label.c | 12 ------ arch/s390/include/asm/jump_label.h | 5 +-- arch/s390/kernel/jump_label.c | 28 +++---------- arch/s390/kernel/module.c | 1 - arch/sparc/kernel/module.c | 3 -- arch/x86/kernel/jump_label.c | 13 ------- arch/x86/kernel/module.c | 3 -- include/linux/jump_label.h | 7 +--- kernel/jump_label.c | 41 +++----------------- 17 files changed, 38 insertions(+), 145 deletions(-) -- 2.35.1