target/ppc: Fix slbia TLB invalidation gap
authorNicholas Piggin <npiggin@gmail.com>
Wed, 18 Mar 2020 04:41:34 +0000 (14:41 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 24 Mar 2020 00:05:37 +0000 (11:05 +1100)
commitf9e3e1a35e8fd63d61fae58bd98d24d7defa9316
tree6b07e23a3ee1910860e65abbed5211468aa42515
parentcb9fb64d0789a3ec47eb0d7549026e353e98b8c1
target/ppc: Fix slbia TLB invalidation gap

slbia must invalidate TLBs even if it does not remove a valid SLB
entry, because slbmte can overwrite valid entries without removing
their TLBs.

As the architecture says, slbia invalidates all lookaside information,
not conditionally based on if it removed valid entries.

It does not seem possible for POWER8 or earlier Linux kernels to hit
this bug because it never changes its kernel SLB translations, and it
should always have valid entries if any accesses are made to userspace
regions. However other operating systems which may modify SLB entry 0
or do more fancy things with segments might be affected.

When POWER9 slbia support is added in the next patch, this becomes a
real problem because some new slbia variants don't invalidate all
non-zero entries.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20200318044135.851716-1-npiggin@gmail.com>
Reviewed-by: C├ędric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/mmu-hash64.c