Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1120847rdb; Mon, 19 Feb 2024 05:07:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9TtMcu/jppn60xfjivmBjq5RnToMChLtLmK3fvqOOU9h6+gT1WOUwmmkstKUGdSSaMwddbGNV+oTFk+vmZpV95UWdQ5eXeyj/vbkuTA== X-Google-Smtp-Source: AGHT+IHInCfPI7siIOupqwny+bW+Sz5SEka8yxqTCkhTHXPOzfBE2Ly85Tc9QEwXS2rwkBc9nOSm X-Received: by 2002:a17:90a:a00a:b0:298:b9f7:83f7 with SMTP id q10-20020a17090aa00a00b00298b9f783f7mr8220516pjp.24.1708348028026; Mon, 19 Feb 2024 05:07:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708348028; cv=pass; d=google.com; s=arc-20160816; b=QTWI+u3ai+kW9oDOKY/nYW37/ftWZc937OlVQbMce3EMNxJ59bz/f8R8NyIGN9vEZb pqIxpigM+daCLZD2rnCPa6Hcocta+jMNmGV6vJvvysKbVIz+cWKVUyNtFC9cyNLIybqt YXvZKs8Gk9R47RVKU8zBbrp8BA4vag/2brrCkNCv/d3rHZexdqIghIP/64gfzEvWbRwY nBSbp+eFg8shpWGLCofbrs0AmsrTJBe8G+Hweu/Y6idfqLnJ2XWp1LT+ftP+9OsZDqhd tLN3o0ABbNkHypP6uMA5igPnPSpiTnkt/tn0AXIigcZqk5j5ItNmj0QByHdDkE7Ukp/R 0YYA== 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:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=aZa4mO8qqPKe3eN5waWyGoC0yRwgzSyD5393+d3U3DU=; fh=gwAII37AmKM/2VKT75K4Fr7s+foyKb/57CLYjp1LKvo=; b=IVo7ZSv8mAR1r0dRJ0CF7iEoFh3zfQriRDhTuZqKDi65rvDqvIC3VLohYG4v3smZ7v nCKapHGnqfr7XBfDLh1AsKKgydTllZLsgElYGxHXS9Y5ceSIygDteA7Y4huC475BHwQq hcLpQHzXbk6yXbZ7jmtCDmvkPGeesqbZ3goXdKQgz6ONviwcsyjJ8AieEG3E7EWq8M34 zRqgnGfitPaV6+ZMjdpJzL4W7q91DvgGNCYCeM0IgfEpr+bHEEup8BUD4s+nfrq3aEfw P5Esf+HiMWuKtT1eAYHy8hNuDmX+1oHIPT7ep5LWO4IlkpqMclEhB5kEYwmdwdtpmuZh sngA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=efSH1iWp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q23-20020a17090aa01700b00299c528462asi420777pjp.182.2024.02.19.05.07.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 05:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=efSH1iWp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id ED97BB21F6F for ; Mon, 19 Feb 2024 12:52:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7EFF2E85B; Mon, 19 Feb 2024 12:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="efSH1iWp" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E43942E844 for ; Mon, 19 Feb 2024 12:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708347151; cv=none; b=B2iX62Y0YZ+AorreLZeCELMAgdeujbHzDnRgXsVQuNWbeeB94QSB44GSK3A5q9dOf825AHtg2uFqgvdM/cWFMykBwVmqA1wajrqPmdeqjuOrtJPhKJTy+68cpfSJJOByrwniXE3Uou6WHcSCbg9kKFl7x9l1x+u9OaJKhEJqR9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708347151; c=relaxed/simple; bh=oFTNQdLe9IZPhk9GU/tAEuzjPFGM/mjuC7YNdKT5FeM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=o+HgGoc2gcqUMb6K2UuXwjBF2n7QTreoInztM7gyvHRVzrQVd1ZK8k4ycis+ELUBapyRCwNisJch4sSZxRkYdqzjWibIypZQocEv6shqs5/7bXGr56P8TZzSEa2NIxDbqg80cab6hU3OWtdcETBDl/5VaR/t75803FQy1FsaJzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=efSH1iWp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 045B9C433F1; Mon, 19 Feb 2024 12:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708347150; bh=oFTNQdLe9IZPhk9GU/tAEuzjPFGM/mjuC7YNdKT5FeM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=efSH1iWpvJ2lvF7CV+Lz23JHIj5dcAdE4JHFDSdbVVPeBq37vZ0Iix8QV+WOPSUbI oEPF49HuEbvx3+hUohbXwBMHPVcTTMoKW/0bPVPUxcfCCBC6tScCjrMdbWxjAr08Z+ T7LXUbcCv3c838J1dGlajH3Wp7l5R9WzroiChxC+U9ucIqJsndB4bmwO14/gFFfkbq LnG3U/QIJomnz+zKMZaWjl/7snmBMGqsI/CJ6aorh9P4g+l+rDLuK2ksBK6eqxr1iP ejYdCIPHxqPYKqS7kQGRM0otcMxj9mLf0csMo3iPDvaE4sSmzl6/dlH9F7uZKLi7q8 RSGfihMtiW+/g== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Samuel Holland , Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Samuel Holland Subject: Re: [PATCH 3/7] riscv: kprobes: Use patch_text_nosync() for insn slots In-Reply-To: <20240212025529.1971876-4-samuel.holland@sifive.com> References: <20240212025529.1971876-1-samuel.holland@sifive.com> <20240212025529.1971876-4-samuel.holland@sifive.com> Date: Mon, 19 Feb 2024 13:52:27 +0100 Message-ID: <87a5nwfwfo.fsf@all.your.base.are.belong.to.us> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Samuel Holland writes: > These instructions are not yet visible to the rest of the system, > so there is no need to do the whole stop_machine() dance. > > Signed-off-by: Samuel Holland > --- > > arch/riscv/kernel/probes/kprobes.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/kernel/probes/kprobes.c b/arch/riscv/kernel/probe= s/kprobes.c > index 2f08c14a933d..cbf8197072bf 100644 > --- a/arch/riscv/kernel/probes/kprobes.c > +++ b/arch/riscv/kernel/probes/kprobes.c > @@ -28,9 +28,9 @@ static void __kprobes arch_prepare_ss_slot(struct kprob= e *p) >=20=20 > p->ainsn.api.restore =3D (unsigned long)p->addr + offset; >=20=20 > - patch_text(p->ainsn.api.insn, &p->opcode, 1); > - patch_text((void *)((unsigned long)(p->ainsn.api.insn) + offset), > - &insn, 1); > + patch_text_nosync(p->ainsn.api.insn, &p->opcode, 1); > + patch_text_nosync(p->ainsn.api.insn + offset, > + &insn, 1); Nit: 100 chars lines! Nice find! Reviewed-by: Bj=C3=B6rn T=C3=B6pel