mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
target-mips: fix TLBR wrt SEGMask
Like r4k_map_address(), r4k_helper_tlbp() should use SEGMask to mask the address. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
e0d002f17d
commit
bc3e45e13a
1 changed files with 6 additions and 0 deletions
|
@ -1856,6 +1856,9 @@ void r4k_helper_tlbp(CPUMIPSState *env)
|
|||
mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
|
||||
tag = env->CP0_EntryHi & ~mask;
|
||||
VPN = tlb->VPN & ~mask;
|
||||
#if defined(TARGET_MIPS64)
|
||||
tag &= env->SEGMask;
|
||||
#endif
|
||||
/* Check ASID, virtual page number & size */
|
||||
if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag) {
|
||||
/* TLB match */
|
||||
|
@ -1871,6 +1874,9 @@ void r4k_helper_tlbp(CPUMIPSState *env)
|
|||
mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
|
||||
tag = env->CP0_EntryHi & ~mask;
|
||||
VPN = tlb->VPN & ~mask;
|
||||
#if defined(TARGET_MIPS64)
|
||||
tag &= env->SEGMask;
|
||||
#endif
|
||||
/* Check ASID, virtual page number & size */
|
||||
if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag) {
|
||||
r4k_mips_tlb_flush_extra (env, i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue