Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2404663iof; Wed, 8 Jun 2022 04:23:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq2vDLs64bq1w4XzYXYq43gCvjprIhQeEVnu19xlTntnt5twi5+AktLliIRXkytb+QYFyr X-Received: by 2002:a05:6a00:1a08:b0:510:a1db:1a91 with SMTP id g8-20020a056a001a0800b00510a1db1a91mr34273171pfv.69.1654687401006; Wed, 08 Jun 2022 04:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654687401; cv=none; d=google.com; s=arc-20160816; b=yiTRo0WeJDILIG5UzfpO8owtLTcqnu9elwmxE/pDq2KeadvgdrUT+AOapqXdPRX0Cq 27q29V3j34Q6hnvyOoVe0qTohYR2F+QH+jXZ+MJqGKFcyjB0zpCPYj9A+85D+ENUdTrB s44NPhCWhpHzOELX/jCS3toH/p2MU5RyJBayCLwz+Hzqdnk0UoSwRxCxOSw5Yl+bRLpR 44wotdhz5FtPCWEpoga/Pecqhlbha+0JHgGb3BiWatBRA+m1QJqJZviom1UsNqSmRkY9 8NfDXW2qSkcbY7DSeBDKNNutdd8flECWMHP0m9SUv1CNiRkKx3MJiB68Uao3eTNBpcIe cBvA== 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=OoPhMbEYex1PX+ZLNK85TgImMwttBH/Ba5TncTc4WYE=; b=EsM625lw0eHkRwgoBcRqzrEC6K9Kdeml0BnFrv86OfvqP5Db8YB0ICs01XzZkmdCpt vJN2MKV7LqZFTS3edYvgsa1b9x2E4Wt+MvvBG+Q7Yey13krvunSvj/YaEgfqdANc2A9u 5hfN4Q6dyr6OP3/vqtS0nlEqew9xl79WOUNHdJNxjOSGXW9QrU/HMxVIQjlvGDoOAfug 0pdg6v84wwwY1M/agrMBEDDRZYc9GI9D0Q3aeO1eyQcGYsHHZYkU4Mn57dxtMbYP0tR1 0WdRMnc3LRb6IzCFnk0OhAAonRNKWJUbtvuGohYksUht1s3LDyij3YAFlwFY6bukBa5L wtAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WRB83dfy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i131-20020a639d89000000b003fa23e7ac05si30833417pgd.418.2022.06.08.04.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 04:23:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WRB83dfy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 84569156B74; Wed, 8 Jun 2022 03:45:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237204AbiFHKp3 (ORCPT + 99 others); Wed, 8 Jun 2022 06:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237155AbiFHKp0 (ORCPT ); Wed, 8 Jun 2022 06:45:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B6D4D921C; Wed, 8 Jun 2022 03:45:25 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1622C60DDF; Wed, 8 Jun 2022 10:45:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AD46C34116; Wed, 8 Jun 2022 10:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654685124; bh=LYPCoycPntOqqUyvwzMbi2reXIKks5cigZIK3ndZ14w=; h=From:To:Cc:Subject:Date:From; b=WRB83dfy5epf1QY0IUOGrasmswrkvVv94EvRPlD/obZQHm+iRggmoNolTT1KQqgpu ymrnpWcUckIM/yQ8SJLbr8i5dO0tk8zBAWG1lD5slAM1vff6FAmBrEtO6+Wnw+nvVO ooUF/dLmDNnuDkDoPw/TcIbgCf0BaM1PifwtSM6kMVhchnjm+3GrrYAQPaghksj6Ar puLW2A2xbYvvbiOvVi3nvAJbPGILB87x2gRdHFmn6CrI74n660ywOPnki4Fay+iqOQ ZTekVQhM5jkOhVgMthQ1Qg6mwtk6ZZFyFpgHpe87e3+5DSS/mCeewARVDGABe6/8aN wooxIxCJM9jQA== From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: Ard Biesheuvel , Peter Zijlstra , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-mips@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 0/3] jump_label: get rid of NOP patching where possible Date: Wed, 8 Jun 2022 12:45:09 +0200 Message-Id: <20220608104512.1176209-1-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2014; h=from:subject; bh=LYPCoycPntOqqUyvwzMbi2reXIKks5cigZIK3ndZ14w=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBioH2yp35gwHFD9tVcWbTkYNW5Bl0OgP+AuoaSgKiw PM6tYBaJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYqB9sgAKCRDDTyI5ktmPJPBhDA CTzcfmFfDApSEEh5wmEbMx0vORABRF2UHR26VW+xnQEuxvv3fdWj4MhkrnbKTdZgg8+ODpY/ZsawYJ cO4u2Dim9utRc7CfedpbcKYOkNDMb+8p/ZwMLLM3dkOdcmbfT7OiL/zboI4wMm423oYhrgw5WV+4I7 16OcblldunBfmU2SI5CgXeHsnVGEuvnePZvjzRJmXE9tD1wxj+zNvYanu80N5hjVWfWiouyWLRjPkn IoVURWaRyizrbmSQOBqqrQDXMF8BuA/C52KdsdtS6nB0RHDjdHnL2FRAJ1GLLCLPnFmNO4/1DHumhC GORpJUs1RRZbvMF5MruEcikCx9ZjVy6qIkq0QjhcJzma6o+v3V/KYsVWCh8Kyoxr1Uyk/YS7SsncJe 5CnPhqGzJLQwUeqeMepDka6Cww3XL4opAW7T1zHtjB92HHtcxDoniAdU2TOYvOMb9Vnqzqhy2jv2YW Vr3lVoqYKw7qGHONu6TPnJwZhPqSUR7HjpEWh2/Gnz2vc= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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. Cc: Peter Zijlstra 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 | 17 ++++++++ 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, 34 insertions(+), 147 deletions(-) -- 2.30.2