Received: by 2002:a05:7208:13ca:b0:7f:395a:35b6 with SMTP id r10csp38864rbe; Wed, 28 Feb 2024 09:53:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUVlDQImi8HZ9uqtl1SRjvA4aSHr6k7Irc6/FcRsVtXXShSPIF2eXrjdA/kJw9Fm2SoN4PIxTx2J30kVOchT6QDqzQBVkgkdruVaSjA5g== X-Google-Smtp-Source: AGHT+IEBezB9QYL5+DyxazZGglj6sRwuXOFFqd7otJhflQlOfZnFZ1wqcBEd1nEWTj6K68U8EvDL X-Received: by 2002:a17:90a:9a8f:b0:29b:6a7:c52c with SMTP id e15-20020a17090a9a8f00b0029b06a7c52cmr179191pjp.38.1709142783988; Wed, 28 Feb 2024 09:53:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709142783; cv=pass; d=google.com; s=arc-20160816; b=aDoHjZOvEfI165I79XX6tt2fg4NOorAwcJwyTpwYCg19Wgyf9vfcubKd4zQ1we13c1 UEJp0nQY+V259xZmMOVGOiiBKypjhCZvuZTQh9F1hZrvvi5buF6+Kr3bq+jwrkFqcIRt gasq99B8aDI7PSxu3Qszu2NjRZWOQPzaXTtLOekDuSDfCmLV1QHanbTZj/z6kmdoFcmm KhHrhkm8zzXwMLBW4A37FjS8V/zdQhnfGwePjF4saxc3dqq1zn0aFuh+Z+LABlA3R6lE GgA0qGi91ukbv4vEHLtencpZpRWWeZ8RLqWb2/8nZK5EWfV4MgibekU9IedICg1BPbgj x7Mg== 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:subject:cc:to :from:dkim-signature; bh=2PXWhKeObjvrv5a0sp4dojdugZSvAvimHcwo4W++JCk=; fh=hiK2yXzJvCiQhq52BuphGylztvI4viH57MdncFraua4=; b=eyklxbd0dtvfdYT/DsswULyhtGQLjbpZGzz1kme09GiTZF4lcuYnMyW5Zw0fmx5OiN ESwQGCPYa5co1eLqL0o7jANqxOdaDf+M0chgW5yfJC+n0+595HXJy7XetF09IE/cH5CM ZsvUtT+uo28ZeJH969GtZLez0TaAppzNVez7OkmsQI0OUId20CG2YSgQilc0jhoZabHD aIgEDadBB/NEa98I2fQokiTx4YzF+qk9knV8u7MmQJa3Je9AOV9bNVHswvZMfITKSNuc 1EtALmKWJ7KNJW/kRB6iP2qv80aoVE0SiSTBiDBUx2dxyh4C3WKGCJl37pMFENGOfcQS N6ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=q+5OvfTk; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-85467-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85467-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 qd14-20020a17090b3cce00b0029a94060f95si1809467pjb.59.2024.02.28.09.53.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:53:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85467-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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=q+5OvfTk; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-85467-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85467-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 A6AAD28B998 for ; Wed, 28 Feb 2024 17:52:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FC886EF02; Wed, 28 Feb 2024 17:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="q+5OvfTk" Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.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 2CDF315DBC1 for ; Wed, 28 Feb 2024 17:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709142718; cv=none; b=YLOUX5gD+mdQp+AsM7btBbWyCLRi7F3Bl8rURqXBhOkpBwVWCNrmkYc0KS4zHzOiGIQ9OtbwPbtJi6GP4MvquoMoxiI1cYCdGR6pI+V8iwIOu6EII31pdKec0EmVrx1VFASRG7Tuq8MfujCm5Ln3kRBOCy/s5xOGmKPyyEaDPM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709142718; c=relaxed/simple; bh=DYg0LXB04IOIyfloSAJ7RhMuraWDe4p86DhfIeb4hC8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=DAIHeo8G8rYlfcuMePtzLRyrMLhtMlSbKw3A67l6++jxwlRXP98aPH2taxht3VA1tjfs6U+2+Y/qUrdQIqWjbaU5NTpY5o81ITf7n9RPLkzz5tK+DRzGfztfN98CjzFAJUqKww24rTLMX2r535vS+uW8AQR9VorhSLdUHbBCQY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=q+5OvfTk; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d094bc2244so70571191fa.1 for ; Wed, 28 Feb 2024 09:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1709142714; x=1709747514; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2PXWhKeObjvrv5a0sp4dojdugZSvAvimHcwo4W++JCk=; b=q+5OvfTkSQ/neuhhx5Q0jFSnztg1vpt3gWh4/SFdi74J+3codoxO0txrzjdShKsu1R HCsBYu6B0mr402b+kTaCrhfMkvasPz8VUTX38YTBU1/jJ9UgwdzHTB6sMnNKpk/ELt5B 1g0h0QY0gUDOaqoaqZTZEyB5TU+nCH1N5fAhtTOFjMAQwIduLWgi+Y9bMJl9GCSBiOwO gr0YJ2tBCj671JkaVTtsOyUTS5B5QHtR9nW8DCmxRR2RAglEIg9Iu5VDbN8QjaP21YJX 5KFKM6zUOOVhQVm7abrDJ0BZEdbTueAlxePLkrwznjNoNZLQ/n4EeJmZZ6hnN+D7wVQM GsSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709142714; x=1709747514; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2PXWhKeObjvrv5a0sp4dojdugZSvAvimHcwo4W++JCk=; b=vV+nRTYAqEWPeHuvmHUtMIgwCEBVy0sG5NeOoWzTIKI2lEitX+3kwSnHWJ33TkYKL4 DZy1/nFZPHSFaWoYUvXYEAL26dN5ydH59ZSmY4VAE2JVXpa8ETgBMBEAF4K/H3BM/22e RWei32+8CBZkceqwJzqgKTnhrG4iheytIiuv4egOBvGNuq6yeY91F15EiZYvAISWDcO5 NUAG8sQGoN6GzTs4oGmrUm4VyrcCEyherJ55FVBI6ut/3b7vSU4xijFkirvt0qC2gl4y k2ef3rUrxrejgitizneaHlCJVbbYNplVszEsz5/I4koAuS2sY2K43HnRjWyrESvf+a8+ kv7Q== X-Forwarded-Encrypted: i=1; AJvYcCVQwKjTVMtLJ6YHc7Tl+1rXvBsPiPGEMsSfGCsSDIzHMJgxnh44d4ynwFq3L4DHDtVVv7lAMXY0sOtMqTzMR5OthN7LeLetq/Z6w9Uz X-Gm-Message-State: AOJu0YxTpj9TxtbhgCn3w9rmAyOxhy3mfnc+Zfe040G08JAsMPB6rLAJ Vb8sRnFyVl/l5nW4zJGV2Vazohw7fG+XQOwGB9VNVtRRo+RZDnpDbGA1eBnaXwg= X-Received: by 2002:a2e:994c:0:b0:2d2:3017:c144 with SMTP id r12-20020a2e994c000000b002d23017c144mr8654944ljj.39.1709142714369; Wed, 28 Feb 2024 09:51:54 -0800 (PST) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id m20-20020a7bca54000000b0041290251dc2sm2706543wml.14.2024.02.28.09.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:51:54 -0800 (PST) From: Alexandre Ghiti To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrea Parri , Anup Patel , Steven Rostedt , Masami Hiramatsu , Mark Rutland , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Alexandre Ghiti Subject: [PATCH 0/2] riscv: fix patching with IPI Date: Wed, 28 Feb 2024 18:51:47 +0100 Message-Id: <20240228175149.162646-1-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 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: 8bit patch 1 removes a useless memory barrier and patch 2 actually fixes the issue with IPI in the patching code. Changes in v2: - Add patch 1 and then remove the memory barrier from patch 2 as suggested by Andrea - Convert atomic_inc into an atomic_inc with release semantics as suggested by Andrea Alexandre Ghiti (2): riscv: Remove superfluous smp_mb() riscv: Fix text patching when IPI are used arch/riscv/include/asm/patch.h | 1 + arch/riscv/kernel/ftrace.c | 42 ++++++++++++++++++++++++++++++---- arch/riscv/kernel/patch.c | 19 ++++++++------- 3 files changed, 50 insertions(+), 12 deletions(-) -- 2.39.2