From: Helge Deller <deller@gmx.de>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 10/23] target/riscv: Use MMU_INDEX() helper
Date: Sun, 6 Aug 2023 16:42:47 +0200 [thread overview]
Message-ID: <700520df-f9d7-09a7-ded5-155eacbd11c6@gmx.de> (raw)
In-Reply-To: <dd180646-6c55-bfa6-0660-55eb5fa85917@linaro.org>
On 8/6/23 16:30, Richard Henderson wrote:
> On 8/6/23 05:17, Helge Deller wrote:
>> Use the new MMU_INDEX() helper to specify the index of the CPUTLB which
>> should be used. Additionally, in a follow-up patch this helper allows
>> then to optimize the tcg code generation.
>>
>> Signed-off-by: Helge Deller <deller@gmx.de>
>> ---
>> target/riscv/cpu.h | 4 ++--
>> target/riscv/cpu_helper.c | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
>> index 6ea22e0eea..6aba1df64a 100644
>> --- a/target/riscv/cpu.h
>> +++ b/target/riscv/cpu.h
>> @@ -88,7 +88,7 @@ typedef enum {
>> EXT_STATUS_DIRTY,
>> } RISCVExtStatus;
>>
>> -#define MMU_USER_IDX 3
>> +#define MMU_USER_IDX MMU_INDEX(3)
>>
>> #define MAX_RISCV_PMPS (16)
>>
>> @@ -446,7 +446,7 @@ void riscv_cpu_list(void);
>> void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp);
>>
>> #define cpu_list riscv_cpu_list
>> -#define cpu_mmu_index riscv_cpu_mmu_index
>> +#define cpu_mmu_index(e,i) MMU_INDEX(riscv_cpu_mmu_index(e,i))
>>
>> #ifndef CONFIG_USER_ONLY
>> void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
>> diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
>> index 9f611d89bb..a8e6950217 100644
>> --- a/target/riscv/cpu_helper.c
>> +++ b/target/riscv/cpu_helper.c
>> @@ -107,7 +107,7 @@ void cpu_get_tb_cpu_state(CPURISCVState *env, vaddr *pc,
>> #else
>> flags = FIELD_DP32(flags, TB_FLAGS, PRIV, env->priv);
>>
>> - flags |= cpu_mmu_index(env, 0);
>> + flags |= riscv_cpu_mmu_index(env, 0);
>> fs = get_field(env->mstatus, MSTATUS_FS);
>> vs = get_field(env->mstatus, MSTATUS_VS);
>
> This is the sort of non-obvious changes that I hoped to avoid by restricting all changes to accel/tcg/cputlb.c.
True.
And, since I've found some other missing pieces now too (e.g. in hppa)
I'm currently tempted to fully agree with you, that handling this
in accel/tcg/cputlb.c only is the better (and cleaner) solution.
I'll try you approach.
Helge
next prev parent reply other threads:[~2023-08-06 14:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-06 12:17 [PATCH v2 00/23] Introduce MMU_INDEX() Helge Deller
2023-08-06 12:17 ` [PATCH v2 01/23] cpu-defs.h; Add MMU_INDEX() helper Helge Deller
2023-08-06 12:17 ` [PATCH v2 02/23] target/i386: Use " Helge Deller
2023-08-06 12:17 ` [PATCH v2 03/23] target/hppa: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 04/23] target/alpha: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 05/23] target/avr: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 06/23] target/hexagon: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 07/23] target/loongarch: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 08/23] target/mips: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 09/23] target/openrisc: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 10/23] target/riscv: " Helge Deller
2023-08-06 14:30 ` Richard Henderson
2023-08-06 14:42 ` Helge Deller [this message]
2023-08-06 12:17 ` [PATCH v2 11/23] target/s390x: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 12/23] target/sparc: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 13/23] target/xtensa: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 14/23] target/arm: " Helge Deller
2023-08-06 14:31 ` Richard Henderson
2023-08-06 12:17 ` [PATCH v2 15/23] target/cris: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 16/23] target/m68k: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 17/23] target/microblaze: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 18/23] target/m68k: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 19/23] target/ppc: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 20/23] target/rx: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 21/23] target/sh4: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 22/23] target/tricore: " Helge Deller
2023-08-06 12:17 ` [PATCH v2 23/23] cpu-defs.h: Reduce generated code size by inverting MMU_INDEX() Helge Deller
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=700520df-f9d7-09a7-ded5-155eacbd11c6@gmx.de \
--to=deller@gmx.de \
--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).