Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp468191lqp; Wed, 22 May 2024 09:36:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFpcW1lDsoPm6RXqGNMdD/YpfXQ8r18lQE4NK6TVREJhITpNnZ5RpN212C+vpzQaZjU0xhxF6GBiQAqWcx5MmjXp4G49J2gQTPsNRAyg== X-Google-Smtp-Source: AGHT+IFU6EJvKZe2iA15q7G54nQdMPta99UL+VpbSzv+Iq5UdLraTkdkNQxS/w/mQsxQ/hh6NRBW X-Received: by 2002:a17:902:fa88:b0:1eb:acff:63bf with SMTP id d9443c01a7336-1f31c99c464mr19944965ad.37.1716395762219; Wed, 22 May 2024 09:36:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716395762; cv=pass; d=google.com; s=arc-20160816; b=k3h3S1D7UCw2JhTJiQawxzQxnAFiPz6U6ZBSVTYExO/gpHQKXmZ9yvHQgwflylWWwF KUwHsd0yGamHs4D2acN70gA1NJ2TpdCiiZvohLrcXdmthAYtq3lVCu4B5QWYpbH5YZc/ ysBX2YoYDyPbMKZwX85veYeJetF1fLZ1DxYXg6jHmf5xyTn8HhkSRTaeBmRo8Nj67X1D btSBCcM99ZAGmLI/sXSQvl+8nTQjuFigJ7KjgFGKaTooWWcDlXsN093RjgjUL1Ofaabh VAH1islSzLOqvkprT3BepyFp1iOBzI1gtEAI4Bp4mlvPvag4vjFS3U1M8oxfQ9GJQDkL YTUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:to:from:cc:in-reply-to :subject:date:dkim-signature; bh=zqGp54J8ESCUs+m4e0ISGDjXBHl6d8o9SoEATv+WGEw=; fh=3l807L9rTD7Kk8f8Ip+EQUUGgvjTS+LDGepgySnQLx8=; b=RLd8mnFLomc+GyOYtFgeu8bMdGNQZREqLeNpvfhuXET+hG54SzWuykLUgEa2+MAIEk El/Ciz39e2hGQ6B5cbxlVuRWD8ZoWPEu1/7qsogQTg/qTEtdERGo6xjW5Uh77zSA/v7a uXmnTOzXBsDDXPLMIGUB2zzBKVz/z49WSNjuEEL74oWWZK7wp6PwvfPGAVBxtYcTmHBn V1q6WCiIw3It41SAlTCA+iGSwmigNyftQKfD56UsudEMuHao6jVL2j4R+/PnyuT9plOi B0jWSX861/+0vPTjyL5q60iMTK/Hvc/7xc14iAKJtCPa6UvXgNelV6Wy2kbkx88P0/qW Zx1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=HtrmE6xM; arc=pass (i=1 spf=pass spfdomain=dabbelt.com dkim=pass dkdomain=dabbelt-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-186496-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186496-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f2f3da3649si29462735ad.651.2024.05.22.09.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 09:36:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186496-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=HtrmE6xM; arc=pass (i=1 spf=pass spfdomain=dabbelt.com dkim=pass dkdomain=dabbelt-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-186496-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186496-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A0B26281B4E for ; Wed, 22 May 2024 16:35:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49010141981; Wed, 22 May 2024 16:35:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dabbelt-com.20230601.gappssmtp.com header.i=@dabbelt-com.20230601.gappssmtp.com header.b="HtrmE6xM" Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C24FF13D63D for ; Wed, 22 May 2024 16:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716395741; cv=none; b=Y9s2JpmU8blh4yTCEtLX5lMyEypanPZkjkKwP0drf5Oe0Ws4RFcmxq/kwb3w/oaCHP8i/O9ZpAvxMvIM2jlbHdi6Cu+J13uIyh/qsRKfhpK5/fAd/NPpxVgkgzIgYiyCU9rhCiFGEcFqGprd+ItBfJ9/v8C/uYVLqPEveQAGOw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716395741; c=relaxed/simple; bh=ecV+Oyo2l55T+lgG4gHLU7xjXVBi1+Yif2LgyDcmDxw=; h=Date:Subject:In-Reply-To:CC:From:To:Message-ID:Mime-Version: Content-Type; b=OQC/bhrndU0dID0mODGTiZJr/SHvmmhjGISN15rVbQHEp7hrjE+bREddWYr4Fk6NRHuCnLnXUDZFyrFW8qrUjXpBy7Ip/pJHJZ9EBHWF1+2RAJjuauq4ONkGW2M3lhqFzI7eJNrzrMVkG4Bn++DFsr4znVNpoLvuYXEVEdTG65o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com; spf=pass smtp.mailfrom=dabbelt.com; dkim=pass (2048-bit key) header.d=dabbelt-com.20230601.gappssmtp.com header.i=@dabbelt-com.20230601.gappssmtp.com header.b=HtrmE6xM; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dabbelt.com Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6f467fb2e66so2662169b3a.1 for ; Wed, 22 May 2024 09:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20230601.gappssmtp.com; s=20230601; t=1716395739; x=1717000539; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=zqGp54J8ESCUs+m4e0ISGDjXBHl6d8o9SoEATv+WGEw=; b=HtrmE6xMZTdFEhKgt13YIQEDrqCI4ETA+mjN5Zapn5pq8wH5H/bTFaH4dEZ1vgAdxq CKNgUjZg0rFvTd1D5hpKDQhBF4OtHTmUfuGQb5hxa72Y1gKFGCwtL3IsJ/UOO1At5J3n VSNKPScxudu36ZAMKQdJH+yuQzzRb0OxvcSFEzsgxcr1i8t/Xd3JTxghdlwb1IjJLIF9 rUVIt9sjaLUq8QdGO+Hbv0eqxNOisT1unXxBkmSi1WRN7y27Y9mOJCUZYPHC9I9xIruW F1VxBtsdn1H0RwoNz+hpHDR+jldkP8oAalp+tkpE+OVcM9p+qsUztnZJZkDn+ut/WIfm qeeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716395739; x=1717000539; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zqGp54J8ESCUs+m4e0ISGDjXBHl6d8o9SoEATv+WGEw=; b=iROPh3GbzjZInoHlb6NDEh646R14MHiElgq+egjoj0fGlKwWPJkHH9ymzPEgtgqw0e bjn/NiQ633G+kO4h9KNrybVYmQeTh5iWNhz4YMNNalDR8ouVZNWGMewTO7injWXQ1LS8 2BisS5pMydmMDXAnjshWB8/QTRMi3frIFTd61twMWeZoZu0nb7LXpH1fET+g94e6mmoJ +z0j48s00W09U9XU2PR9IpM76pdC5WhqyrWg5BvT4zKri2cDrf3Fjx+Fq0h4wr7vZAH8 OdOngwxiNSUb4vAgGJCCDl6IjAEbsN51Hz1gua+5SHa96YGyf29J1sJmG3jYTFBk0SAM Hz5g== X-Forwarded-Encrypted: i=1; AJvYcCVBsGKtTBUBb0uJ9GK3S0HhRSmcg8jvSlFUA7y5CbQhUxWJLZ8NtFgBhF+NXf4hwZB/tPVzEpH/twBLtOwjg5WxyP+oZgtnr8d47R4v X-Gm-Message-State: AOJu0YxODwkWTgXC3glNV/SMmoj37075MhWrWdDYvYWX/cqaoyQPiQoA bRamCYZyZnMDDFIVafVV5/05bREX++0hAVmu9c7Rk3J8XLAAOUD5oztDBusi6lQ= X-Received: by 2002:a05:6a00:4f8b:b0:6f3:ef3d:60eb with SMTP id d2e1a72fcca58-6f6d62200f1mr2432509b3a.34.1716395738743; Wed, 22 May 2024 09:35:38 -0700 (PDT) Received: from localhost ([192.184.165.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2a82896sm22664747b3a.69.2024.05.22.09.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 09:35:38 -0700 (PDT) Date: Wed, 22 May 2024 09:35:38 -0700 (PDT) X-Google-Original-Date: Wed, 22 May 2024 09:35:36 PDT (-0700) Subject: Re: [PATCH v2 0/7] riscv: Various text patching improvements In-Reply-To: <20240327160520.791322-1-samuel.holland@sifive.com> CC: Bjorn Topel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, samuel.holland@sifive.com, Ard Biesheuvel , daniel@iogearbox.net, jbaron@akamai.com, jpoimboe@kernel.org, peterz@infradead.org, rostedt@goodmis.org, bpf@vger.kernel.org From: Palmer Dabbelt To: samuel.holland@sifive.com Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On Wed, 27 Mar 2024 09:04:39 PDT (-0700), samuel.holland@sifive.com wrote: > Here are a few changes to minimize calls to stop_machine() and > flush_icache_*() in the various text patching functions, as well as > to simplify the code. > > This series is based on "[PATCH v3 0/2] riscv: fix patching with IPI"[1]. > > [1]: https://lore.kernel.org/linux-riscv/20240229121056.203419-1-alexghiti@rivosinc.com/ > > Changes in v2: > - Remove unnecessary line wrapping > - Further simplify patch_insn_set()/patch_insn_write() loop conditions > - Use min() instead of min_t() since both sides are unsigned long > > Samuel Holland (7): > riscv: jump_label: Batch icache maintenance > riscv: jump_label: Simplify assembly syntax > riscv: kprobes: Use patch_text_nosync() for insn slots > riscv: Simplify text patching loops > riscv: Pass patch_text() the length in bytes > riscv: Use offset_in_page() in text patching functions > riscv: Remove extra variable in patch_text_nosync() > > arch/riscv/include/asm/jump_label.h | 4 +- > arch/riscv/include/asm/patch.h | 2 +- > arch/riscv/kernel/jump_label.c | 16 +++++-- > arch/riscv/kernel/patch.c | 69 ++++++++++++++--------------- > arch/riscv/kernel/probes/kprobes.c | 19 ++++---- > arch/riscv/net/bpf_jit_comp64.c | 7 +-- > 6 files changed, 63 insertions(+), 54 deletions(-) I don't have any issues with this, but given that we've run into some possible text patching bug with this ftrace thing I'm just going to hold off until 6.11 for these. Maybe that's a bit too conservative, but with the bug only manifesting on HW it might be tough to sort out.