target/ppc: Fix 440 tlbwe TLB invalidation gaps
authorNicholas Piggin <npiggin@gmail.com>
Mon, 13 Nov 2023 12:19:15 +0000 (22:19 +1000)
committerNicholas Piggin <npiggin@gmail.com>
Fri, 23 Feb 2024 13:24:43 +0000 (23:24 +1000)
commite8fe14112bea38377409728b7b0d684bd187ff56
tree4f9e8ba669907dc8dc68abf4526f8ab7795c7c73
parenta21d89b5f4084d8b739d81149e777522f1120e08
target/ppc: Fix 440 tlbwe TLB invalidation gaps

The 440 tlbwe (write entry) instruction misses several cases that must
flush the TCG TLB:

- If the new size is smaller than the existing size, the EA no longer
  covered should be flushed. This looks like an inverted inequality
  test.
- If the TLB PID changes.
- If the TLB attr bit 0 (translation address space) changes.
- If low prot (access control) bits change.

Fix this by removing tricks to avoid TLB flushes, and just invalidate
the TLB if any valid entry is being changed, similarly to 4xx.
Optimisations will be introduced in subsequent changes.

Tested-by: BALATON Zoltan <balaton@eik.bme.hu>
Acked-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
target/ppc/mmu_helper.c