* [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020
@ 2020-11-09 9:04 Philippe Mathieu-Daudé
2020-11-09 9:04 ` [PATCH-for-6.0 1/2] target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN Philippe Mathieu-Daudé
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-09 9:04 UTC (permalink / raw)
To: qemu-devel
Cc: Aleksandar Rikalo, Philippe Mathieu-Daudé,
Huacai Chen, Aurelien Jarno, Richard Henderson
Based-on: <20201108234234.2389789-1-f4bug@amsat.org>
Philippe Mathieu-Daudé (2):
target/mips: Replace magic values by CP0PM_MASK or
TARGET_PAGE_BITS_MIN
target/mips: Do not include CP0 helpers in user-mode emulation
target/mips/cp0_helper.c | 9 +++------
target/mips/helper.c | 4 ++--
target/mips/meson.build | 2 +-
3 files changed, 6 insertions(+), 9 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH-for-6.0 1/2] target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN
2020-11-09 9:04 [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Philippe Mathieu-Daudé
@ 2020-11-09 9:04 ` Philippe Mathieu-Daudé
2020-11-09 9:04 ` [PATCH-for-6.0 2/2] target/mips: Do not include CP0 helpers in user-mode emulation Philippe Mathieu-Daudé
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-09 9:04 UTC (permalink / raw)
To: qemu-devel
Cc: Aleksandar Rikalo, Philippe Mathieu-Daudé,
Huacai Chen, Aurelien Jarno, Richard Henderson
Replace magic values related to page size:
12 -> TARGET_PAGE_BITS_MIN
13 -> CP0PM_MASK
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/cp0_helper.c | 5 +++--
target/mips/helper.c | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c
index a1b5140ccaf..e8b9343ec9c 100644
--- a/target/mips/cp0_helper.c
+++ b/target/mips/cp0_helper.c
@@ -904,7 +904,7 @@ void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagemask)
goto invalid;
}
/* We don't support VTLB entry smaller than target page */
- if ((maskbits + 12) < TARGET_PAGE_BITS) {
+ if ((maskbits + TARGET_PAGE_BITS_MIN) < TARGET_PAGE_BITS) {
goto invalid;
}
env->CP0_PageMask = mask << CP0PM_MASK;
@@ -913,7 +913,8 @@ void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagemask)
invalid:
/* When invalid, set to default target page size. */
- env->CP0_PageMask = (~TARGET_PAGE_MASK >> 12) << CP0PM_MASK;
+ mask = (~TARGET_PAGE_MASK >> TARGET_PAGE_BITS_MIN);
+ env->CP0_PageMask = mask << CP0PM_MASK;
}
void helper_mtc0_pagemask(CPUMIPSState *env, target_ulong arg1)
diff --git a/target/mips/helper.c b/target/mips/helper.c
index 063b65c0528..041432489d6 100644
--- a/target/mips/helper.c
+++ b/target/mips/helper.c
@@ -858,8 +858,8 @@ refill:
break;
}
}
- pw_pagemask = m >> 12;
- update_pagemask(env, pw_pagemask << 13, &pw_pagemask);
+ pw_pagemask = m >> TARGET_PAGE_BITS_MIN;
+ update_pagemask(env, pw_pagemask << CP0PM_MASK, &pw_pagemask);
pw_entryhi = (address & ~0x1fff) | (env->CP0_EntryHi & 0xFF);
{
target_ulong tmp_entryhi = env->CP0_EntryHi;
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH-for-6.0 2/2] target/mips: Do not include CP0 helpers in user-mode emulation
2020-11-09 9:04 [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Philippe Mathieu-Daudé
2020-11-09 9:04 ` [PATCH-for-6.0 1/2] target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN Philippe Mathieu-Daudé
@ 2020-11-09 9:04 ` Philippe Mathieu-Daudé
2020-11-09 17:33 ` [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Richard Henderson
2020-11-22 19:41 ` Philippe Mathieu-Daudé
3 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-09 9:04 UTC (permalink / raw)
To: qemu-devel
Cc: Aleksandar Rikalo, Philippe Mathieu-Daudé,
Huacai Chen, Aurelien Jarno, Richard Henderson
CP0 helpers are restricted to system-mode emulation.
Do not intent do build cp0_helper.c in user-mode (this
allows to simplify some #ifdef'ry).
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/cp0_helper.c | 4 ----
target/mips/meson.build | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c
index e8b9343ec9c..caaaefcc8ad 100644
--- a/target/mips/cp0_helper.c
+++ b/target/mips/cp0_helper.c
@@ -32,7 +32,6 @@
#include "sysemu/kvm.h"
-#ifndef CONFIG_USER_ONLY
/* SMP helpers. */
static bool mips_vpe_is_wfi(MIPSCPU *c)
{
@@ -1667,10 +1666,8 @@ target_ulong helper_evpe(CPUMIPSState *env)
}
return prev;
}
-#endif /* !CONFIG_USER_ONLY */
/* R6 Multi-threading */
-#ifndef CONFIG_USER_ONLY
target_ulong helper_dvp(CPUMIPSState *env)
{
CPUState *other_cs = first_cpu;
@@ -1709,4 +1706,3 @@ target_ulong helper_evp(CPUMIPSState *env)
}
return prev;
}
-#endif /* !CONFIG_USER_ONLY */
diff --git a/target/mips/meson.build b/target/mips/meson.build
index fa1f024e782..681a5524c0e 100644
--- a/target/mips/meson.build
+++ b/target/mips/meson.build
@@ -1,6 +1,5 @@
mips_ss = ss.source_set()
mips_ss.add(files(
- 'cp0_helper.c',
'cpu.c',
'dsp_helper.c',
'fpu_helper.c',
@@ -15,6 +14,7 @@
mips_softmmu_ss = ss.source_set()
mips_softmmu_ss.add(files(
+ 'cp0_helper.c',
'cp0_timer.c',
'machine.c',
'mips-semi.c',
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020
2020-11-09 9:04 [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Philippe Mathieu-Daudé
2020-11-09 9:04 ` [PATCH-for-6.0 1/2] target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN Philippe Mathieu-Daudé
2020-11-09 9:04 ` [PATCH-for-6.0 2/2] target/mips: Do not include CP0 helpers in user-mode emulation Philippe Mathieu-Daudé
@ 2020-11-09 17:33 ` Richard Henderson
2020-11-10 1:21 ` chen huacai
2020-11-22 19:41 ` Philippe Mathieu-Daudé
3 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2020-11-09 17:33 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Huacai Chen, Aleksandar Rikalo, Aurelien Jarno, Richard Henderson
On 11/9/20 1:04 AM, Philippe Mathieu-Daudé wrote:
> Based-on: <20201108234234.2389789-1-f4bug@amsat.org>
>
> Philippe Mathieu-Daudé (2):
> target/mips: Replace magic values by CP0PM_MASK or
> TARGET_PAGE_BITS_MIN
> target/mips: Do not include CP0 helpers in user-mode emulation
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020
2020-11-09 17:33 ` [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Richard Henderson
@ 2020-11-10 1:21 ` chen huacai
0 siblings, 0 replies; 6+ messages in thread
From: chen huacai @ 2020-11-10 1:21 UTC (permalink / raw)
To: Richard Henderson
Cc: Aleksandar Rikalo, Philippe Mathieu-Daudé,
qemu-level, Huacai Chen, Aurelien Jarno, Richard Henderson
Reviewed-by: Huacai Chen <chenhc@lemote.com>
On Tue, Nov 10, 2020 at 1:37 AM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 11/9/20 1:04 AM, Philippe Mathieu-Daudé wrote:
> > Based-on: <20201108234234.2389789-1-f4bug@amsat.org>
> >
> > Philippe Mathieu-Daudé (2):
> > target/mips: Replace magic values by CP0PM_MASK or
> > TARGET_PAGE_BITS_MIN
> > target/mips: Do not include CP0 helpers in user-mode emulation
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> r~
>
--
Huacai Chen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020
2020-11-09 9:04 [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2020-11-09 17:33 ` [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Richard Henderson
@ 2020-11-22 19:41 ` Philippe Mathieu-Daudé
3 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-22 19:41 UTC (permalink / raw)
To: qemu-devel
Cc: Huacai Chen, Aleksandar Rikalo, Aurelien Jarno, Richard Henderson
On 11/9/20 10:04 AM, Philippe Mathieu-Daudé wrote:
> Based-on: <20201108234234.2389789-1-f4bug@amsat.org>
>
> Philippe Mathieu-Daudé (2):
> target/mips: Replace magic values by CP0PM_MASK or
> TARGET_PAGE_BITS_MIN
> target/mips: Do not include CP0 helpers in user-mode emulation
>
> target/mips/cp0_helper.c | 9 +++------
> target/mips/helper.c | 4 ++--
> target/mips/meson.build | 2 +-
> 3 files changed, 6 insertions(+), 9 deletions(-)
Thanks, applied to mips-next.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-11-22 19:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 9:04 [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Philippe Mathieu-Daudé
2020-11-09 9:04 ` [PATCH-for-6.0 1/2] target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN Philippe Mathieu-Daudé
2020-11-09 9:04 ` [PATCH-for-6.0 2/2] target/mips: Do not include CP0 helpers in user-mode emulation Philippe Mathieu-Daudé
2020-11-09 17:33 ` [PATCH-for-6.0 0/2] target/mips: CP0 housekeeping patches for Nov 2020 Richard Henderson
2020-11-10 1:21 ` chen huacai
2020-11-22 19:41 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.