Skip to contentSkip to conversation

ppc/ppc405: Fix TLB flushing

PATCH Superseded Cédric Le Goater 1 participant 1 message Jan 13, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc/ppc405: Fix TLB flushing

Commit cd0c6f473532 did not take into account 405 CPUs when adding support to batching of TCG tlb flushes. Set the TLB_NEED_LOCAL_FLUSH flags when the SPR_40x_PID is switched and when the TLB updated.

Cc Thomas Huth <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Fabiano Rosas <[email protected]>
Fixes cd0c6f473532 ("ppc: Do some batching of TCG tlb flushes")
---
 target/ppc/mmu_helper.c | 2 ++
 1 file changed, 2 insertions(+)

It's alive ! Thanks to all :)

...
printk: console [ttyS0] enabled
ef600300.serial: ttyS1 at MMIO 0xef600300 (irq = 17, base_baud = 119047) is a 16550
brd: module loaded
libphy: Fixed MDIO Bus: probed
e1000: Intel(R) PRO/1000 Network Driver
e1000: Copyright (c) 1999-2006 Intel Corporation.
e1000 0008:00:01.0: enabling device (0000 -> 0003)
e1000 0008:00:01.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
e1000 0008:00:01.0 eth0: Intel(R) PRO/1000 Network Connection
drmem: No dynamic reconfiguration memory found
Freeing unused kernel image (initmem) memory: 152K
Kernel memory protection not selected by kernel config.
Run /init as init process
process '/bin/busybox' started with executable stack
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Saving random seed: random: dd: uninitialized urandom read (512 bytes read) OK
Starting network: e1000 0008:00:01.0 eth0: Unable to allocate interrupt Error: -22
ip: SIOCSIFFLAGS: Invalid argument
FAIL

Welcome to Buildroot
buildroot login: root
Jan 1 00:00:18 login[123]: root login on 'ttyS0' # cat /proc/cpuinfo
processor : 0
cpu : 405EP
clock : 133.333333MHz
revision : 9.80 (pvr 5121 0950)
bogomips : 266.66

timebase : 133333333
platform : PowerPC 40x Platform
model : est,hotfoot
Memory : 128 MB
# poweroff
# Stopping network: ifdown: interface eth0 not configured
OK
Saving random seed: random: dd: uninitialized urandom read (512 bytes read) OK
Stopping klogd: OK
Stopping syslogd: start-stop-daemon: warning: killing process 45: No such process FAIL
umount: devtmpfs busy - remounted read-only
umount: can't unmount /: Invalid argument
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system poweroff
reboot: System halted
System Halted, OK to turn off power
QEMU 6.2.50 monitor - type 'help' for more information

target/ppc/mmu_helper.c +2 -0
index 59df6952aea1..ccca16979965 100644
@@ -682,6 +682,7 @@ target_ulong helper_4xx_tlbre_hi(CPUPPCState *env, target_ulong entry)
     }
     ret |= size << PPC4XX_TLBHI_SIZE_SHIFT;
     env->spr[SPR_40x_PID] = tlb->PID;
+    env->tlb_need_flush |= TLB_NEED_LOCAL_FLUSH;
     return ret;
 }
 
@@ -794,6 +795,7 @@ void helper_4xx_tlbwe_lo(CPUPPCState *env, target_ulong entry,
                   tlb->prot & PAGE_WRITE ? 'w' : '-',
                   tlb->prot & PAGE_EXEC ? 'x' : '-',
                   tlb->prot & PAGE_VALID ? 'v' : '-', (int)tlb->PID);
+    env->tlb_need_flush |= TLB_NEED_LOCAL_FLUSH;
 }
 
 target_ulong helper_4xx_tlbsx(CPUPPCState *env, target_ulong address)
Signature · 1 line
2.31.1