target/mips: CP0 housekeeping patches for Nov 2020
cover target/mips: CP0 housekeeping patches for Nov 2020
Based-on: <[email protected]>
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(-)
Signature · 1 line
2.26.2
PATCH 1/2 target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN
Replace magic values related to page size:
12 -> TARGET_PAGE_BITS_MIN
13 -> CP0PM_MASK
--- target/mips/cp0_helper.c | 5 +++-- target/mips/helper.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
target/mips/cp0_helper.c +3 -2
@@ -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)
target/mips/helper.c +2 -2
@@ -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;
Signature · 1 line
2.26.2
PATCH 2/2 target/mips: Do not include CP0 helpers in user-mode emulation
In reply to Philippe Mathieu-Daudé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).
--- target/mips/cp0_helper.c | 4 ---- target/mips/meson.build | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-)
target/mips/cp0_helper.c +0 -4
@@ -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 */
target/mips/meson.build +1 -1
@@ -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',
Signature · 1 line
2.26.2
Quoted 6 lines · Philippe Mathieu-Daudé
Based-on: <[email protected]>
Philippe Mathieu-Daudé (2):
target/mips: Replace magic values byCP0PM_MASKor
TARGET_PAGE_BITS_MIN
target/mips: Do not include CP0 helpers in user-mode emulation
r~
chen huacai
Reviewed-by Huacai ChenQuoted 13 lines · Richard Henderson
Quoted 6 lines · Philippe Mathieu-Daudé
Based-on: <[email protected]>
Philippe Mathieu-Daudé (2):
target/mips: Replace magic values byCP0PM_MASKor
TARGET_PAGE_BITS_MIN
target/mips: Do not include CP0 helpers in user-mode emulationReviewed-by Richard Henderson <[email protected]>r~
Signature · 1 line
Huacai Chen
Philippe Mathieu-Daudé
AppliedQuoted 11 lines · Philippe Mathieu-Daudé
Based-on: <[email protected]>
Philippe Mathieu-Daudé (2):
target/mips: Replace magic values byCP0PM_MASKor
TARGET_PAGE_BITS_MIN
target/mips: Do not include CP0 helpers in user-mode emulationtarget/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.