From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Andrea Parri <parri.andrea@gmail.com>,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, paulmck@kernel.org, corbet@lwn.net
Cc: mmaas@google.com, hboehm@google.com, striker@us.ibm.com,
charlie@rivosinc.com, rehn@rivosinc.com, rdunlap@infradead.org,
sorear@fastmail.com, linux-riscv@lists.infradead.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 4/4] membarrier: riscv: Provide core serializing command
Date: Wed, 31 Jan 2024 10:33:59 -0500 [thread overview]
Message-ID: <8325617c-51a4-4747-8082-befe9ff1c0f3@efficios.com> (raw)
In-Reply-To: <20240131144936.29190-5-parri.andrea@gmail.com>
On 2024-01-31 09:49, Andrea Parri wrote:
> RISC-V uses xRET instructions on return from interrupt and to go back
> to user-space; the xRET instruction is not core serializing.
>
> Use FENCE.I for providing core serialization as follows:
>
> - by calling sync_core_before_usermode() on return from interrupt (cf.
> ipi_sync_core()),
>
> - via switch_mm() and sync_core_before_usermode() (respectively, for
> uthread->uthread and kthread->uthread transitions) before returning
> to user-space.
>
> On RISC-V, the serialization in switch_mm() is activated by resetting
> the icache_stale_mask of the mm at prepare_sync_core_cmd().
>
> Suggested-by: Palmer Dabbelt <palmer@dabbelt.com>
> Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2024-01-31 15:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 14:49 [PATCH v4 0/4] membarrier: riscv: Core " Andrea Parri
2024-01-31 14:49 ` [PATCH v4 1/4] membarrier: riscv: Add full memory barrier in switch_mm() Andrea Parri
2024-01-31 14:49 ` [PATCH v4 2/4] membarrier: Create Documentation/scheduler/membarrier.rst Andrea Parri
2024-01-31 14:49 ` [PATCH v4 3/4] locking: Introduce prepare_sync_core_cmd() Andrea Parri
2024-01-31 14:49 ` [PATCH v4 4/4] membarrier: riscv: Provide core serializing command Andrea Parri
2024-01-31 15:33 ` Mathieu Desnoyers [this message]
2024-02-16 0:56 ` [PATCH v4 0/4] membarrier: riscv: Core " Palmer Dabbelt
2024-02-22 20:20 ` patchwork-bot+linux-riscv
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=8325617c-51a4-4747-8082-befe9ff1c0f3@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=aou@eecs.berkeley.edu \
--cc=charlie@rivosinc.com \
--cc=corbet@lwn.net \
--cc=hboehm@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mmaas@google.com \
--cc=palmer@dabbelt.com \
--cc=parri.andrea@gmail.com \
--cc=paul.walmsley@sifive.com \
--cc=paulmck@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rehn@rivosinc.com \
--cc=sorear@fastmail.com \
--cc=striker@us.ibm.com \
/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
all inboxes | Powered by JetHome®