From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Anton Johansson <anjo@rev.ng>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [RFC PATCH-for-10.1 3/4] tcg: Have tcg_req_mo() use runtime TCGContext::guest_mo
Date: Fri, 21 Mar 2025 15:46:28 +0100 [thread overview]
Message-ID: <cb0c2703-cb84-477f-8f3b-3a715f373664@linaro.org> (raw)
In-Reply-To: <obxwsiulhaid5f5rpjdgaclzzbay4dgs4jko2wxyojk5lwjmm5@7gctc6ef5n7s>
On 21/3/25 15:39, Anton Johansson wrote:
> On 21/03/25, Philippe Mathieu-Daudé wrote:
>> In order to use TCG with multiple targets, replace the
>> compile time use of TCG_GUEST_DEFAULT_MO by a runtime
>> access to tcg_ctx->guest_mo.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> accel/tcg/internal-target.h | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
>> index 1cb35dba99e..014ee756f9d 100644
>> --- a/accel/tcg/internal-target.h
>> +++ b/accel/tcg/internal-target.h
>> @@ -49,11 +49,9 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
>> * Filter @type to the barrier that is required for the guest
>> * memory ordering vs the host memory ordering. A non-zero
>> * result indicates that some barrier is required.
>> - *
>> - * This is a macro so that it's constant even without optimization.
>> */
>> #define tcg_req_mo(type) \
>> - ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO)
>> + ((type) & tcg_ctx->guest_mo & ~TCG_TARGET_DEFAULT_MO)
>>
>> /**
>> * cpu_req_mo:
>> --
>> 2.47.1
>>
>
> I'll parrot some older feedback by Richard
>
> https://lore.kernel.org/all/92cc9335-10bf-4a74-9eb4-249de5545dc5@linaro.org/
>
> but tcg_ctx->guest_mo can be undefined or bogus here. Could we not
> take cpu and access cpu->cc->tcg_ops->guest_default_memory_order
> directly instead?
Yes, cpu_req_mo() has access to @cpu.
next prev parent reply other threads:[~2025-03-21 14:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 12:57 [RFC PATCH-for-10.1 0/4] tcg: Move TCG_GUEST_DEFAULT_MO -> TCGCPUOps::guest_default_memory_order Philippe Mathieu-Daudé
2025-03-21 12:57 ` [PATCH-for-10.1 1/4] tcg: Always define TCG_GUEST_DEFAULT_MO Philippe Mathieu-Daudé
2025-03-21 14:39 ` Anton Johansson via
2025-03-21 15:14 ` Richard Henderson
2025-03-21 17:44 ` Pierrick Bouvier
2025-03-21 12:57 ` [PATCH-for-10.1 2/4] tcg: Simplify tcg_req_mo() macro Philippe Mathieu-Daudé
2025-03-21 14:40 ` Anton Johansson via
2025-03-21 15:14 ` Richard Henderson
2025-03-21 17:44 ` Pierrick Bouvier
2025-03-21 12:57 ` [RFC PATCH-for-10.1 3/4] tcg: Have tcg_req_mo() use runtime TCGContext::guest_mo Philippe Mathieu-Daudé
2025-03-21 14:39 ` Anton Johansson via
2025-03-21 14:46 ` Philippe Mathieu-Daudé [this message]
2025-03-21 15:16 ` Richard Henderson
2025-03-21 12:57 ` [RFC PATCH-for-10.1 4/4] tcg: Define guest_default_memory_order in TCGCPUOps Philippe Mathieu-Daudé
2025-03-21 13:20 ` Philippe Mathieu-Daudé
2025-03-21 14:34 ` Anton Johansson via
2025-03-21 15:25 ` Richard Henderson
2025-03-21 17:47 ` Pierrick Bouvier
2025-03-21 14:40 ` [RFC PATCH-for-10.1 0/4] tcg: Move TCG_GUEST_DEFAULT_MO -> TCGCPUOps::guest_default_memory_order Anton Johansson via
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=cb0c2703-cb84-477f-8f3b-3a715f373664@linaro.org \
--to=philmd@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=anjo@rev.ng \
--cc=pbonzini@redhat.com \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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;
as well as URLs for NNTP newsgroup(s).