From: Peter Zijlstra <peterz@infradead.org>
To: WANG Xuerui <kernel@xen0n.name>
Cc: Youling Tang <tangyouling@loongson.cn>,
Huacai Chen <chenhuacai@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Jason Baron <jbaron@akamai.com>, Zhangjin Wu <falcon@tinylab.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
loongarch@lists.linux.dev
Subject: Re: [PATCH v2] LoongArch: Add jump-label implementation
Date: Wed, 10 May 2023 13:23:11 +0200 [thread overview]
Message-ID: <20230510112311.GA2176161@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <15594820-0a95-94bb-132f-5008d31c041f@xen0n.name>
On Wed, May 10, 2023 at 05:34:33PM +0800, WANG Xuerui wrote:
> Hi Peter,
>
> My 2 cents:
>
> On 2023/5/10 17:27, Peter Zijlstra wrote:
> > On Wed, May 10, 2023 at 05:16:46PM +0800, Youling Tang wrote:
> > > Add jump-label implementation based on the ARM64 version.
> > >
> > > Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> >
> > > <snip>
> > >
> > > + if (type == JUMP_LABEL_JMP)
> > > + insn = larch_insn_gen_b(jump_entry_code(entry), jump_entry_target(entry));
> > > + else
> > > + insn = larch_insn_gen_nop();
> > > +
> > > + larch_insn_patch_text(addr, insn);
> > > +}
> >
> > This all implies Loongarch is fine with the nop<->b transition (much
> > like arm64 is), but I found no actual mention of what transitions are
> > valid for the architecture in your inst.c file -- perhaps you could put
> > a small comment there to elucidate the occasional reader that doesn't
> > have your arch manual memorized?
>
> Do you mean by "valid transition" something like "what kind of
> self-modification is architecturally sound, taking ICache /
> micro-architecture behavior etc. into consideration"?
Yes that. There are definitely architectures that have limitations on
what instructions can be hot-patched in the face of concurrent execution
without jumping through too many hoops.
next prev parent reply other threads:[~2023-05-10 11:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 9:16 [PATCH v2] LoongArch: Add jump-label implementation Youling Tang
2023-05-10 9:27 ` Peter Zijlstra
2023-05-10 9:34 ` WANG Xuerui
2023-05-10 11:23 ` Peter Zijlstra [this message]
2023-05-11 1:32 ` Youling Tang
2023-05-10 9:28 ` WANG Xuerui
2023-05-11 1:33 ` Youling Tang
2023-05-11 7:43 ` Peter Zijlstra
2023-05-11 10:07 ` WANG Xuerui
2023-05-11 10:21 ` David Laight
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=20230510112311.GA2176161@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=chenhuacai@kernel.org \
--cc=corbet@lwn.net \
--cc=falcon@tinylab.org \
--cc=jbaron@akamai.com \
--cc=jpoimboe@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=tangyouling@loongson.cn \
/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