From: Andrea Parri <parri.andrea@gmail.com>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: "Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Andrea Parri" <andrea@rivosinc.com>,
"Anup Patel" <anup@brainfault.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Masami Hiramatsu" <mhiramat@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org,
"Björn Töpel" <bjorn@rivosinc.com>
Subject: Re: [PATCH 2/2] riscv: Fix text patching when IPI are used
Date: Thu, 29 Feb 2024 01:42:55 +0100 [thread overview]
Message-ID: <Zd/TDyyG/5sxrPWx@andrea> (raw)
In-Reply-To: <20240228175149.162646-3-alexghiti@rivosinc.com>
On Wed, Feb 28, 2024 at 06:51:49PM +0100, Alexandre Ghiti wrote:
> For now, we use stop_machine() to patch the text and when we use IPIs for
> remote icache flushes (which is emitted in patch_text_nosync()), the system
> hangs.
>
> So instead, make sure every cpu executes the stop_machine() patching
> function and emit a local icache flush there.
>
> Co-developed-by: Björn Töpel <bjorn@rivosinc.com>
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Modulo the removal of the hunk discussed with Samuel,
Reviewed-by: Andrea Parri <parri.andrea@gmail.com>
Some nits / amendments to the inline comments below:
> + /*
> + * Make sure the patching store is effective *before* we
> + * increment the counter which releases all waiting cpus
> + * by using the release version of atomic increment.
> + */
s/cpus/CPUs
s/release version/release variant
The comment could be amended with a description of the matching barrier(s), say,
"The release pairs with the call to local_flush_icache_all() on the waiting CPU".
(Same for the comment in patch_text_cb().)
Andrea
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2024-02-29 0:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 17:51 [PATCH 0/2] riscv: fix patching with IPI Alexandre Ghiti
2024-02-28 17:51 ` [PATCH 1/2] riscv: Remove superfluous smp_mb() Alexandre Ghiti
2024-02-29 0:17 ` Andrea Parri
2024-02-28 17:51 ` [PATCH 2/2] riscv: Fix text patching when IPI are used Alexandre Ghiti
2024-02-28 18:21 ` Samuel Holland
2024-02-28 19:02 ` Alexandre Ghiti
2024-02-29 0:42 ` Andrea Parri [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zd/TDyyG/5sxrPWx@andrea \
--to=parri.andrea@gmail.com \
--cc=alexghiti@rivosinc.com \
--cc=andrea@rivosinc.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=bjorn@rivosinc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox