freebsd-dev/sys/powerpc/booke
Justin Hibbits 8b079fcca7 powerpc/booke: Fix TLB1 entry accounting
It's possible, with per-CPU mappings, for TLB1 indices to get out of sync.
This presents a problem when trying to insert an entry into TLB1 of all
CPUs.  Currently that's done by assuming (hoping) that the TLBs are
perfectly synced, and inserting to the same index for all CPUs.  However,
with aforementioned private mappings, this can result in overwriting
mappings on the other CPUs.

An example:

    CPU0                    CPU1
    <setup all mappings>    <idle>
        3 private mappings
      kick off CPU 1
                            initialize shared mappings (3 indices low)
                            Load kernel module, triggers 20 new mappings
      Sync mappings at N-3
                            initialize 3 private mappings.

At this point, CPU 1 has all the correct mappings, while CPU 0 is missing 3
mappings that were shared across to CPU 1.  When CPU 0 tries to access
memory in one of the overwritten mappings, it hangs while tripping through
the TLB miss handler.  Device mappings are not stored in any page table.

This fixes by introducing a '-1' index for tlb1_write_entry_int(), so each
CPU searches for an available index private to itself.

MFC after:	3 weeks
2019-11-01 02:55:58 +00:00
..
booke_machdep.c powerpc/booke: Check for the metadata address by physical address 2018-12-03 04:47:28 +00:00
locore.S powerpc/booke: Don't zero MAS8, it's unnecessary 2019-10-20 15:50:33 +00:00
machdep_e500.c sys/powerpc: further adoption of SPDX licensing ID tags. 2017-11-27 15:09:59 +00:00
machdep_ppc4xx.c sys/powerpc: further adoption of SPDX licensing ID tags. 2017-11-27 15:09:59 +00:00
mp_cpudep.c sys/powerpc: further adoption of SPDX licensing ID tags. 2017-11-27 15:09:59 +00:00
platform_bare.c sys/powerpc: further adoption of SPDX licensing ID tags. 2017-11-27 15:09:59 +00:00
pmap.c powerpc/booke: Fix TLB1 entry accounting 2019-11-01 02:55:58 +00:00
spe.c powerpc/SPE: Enable SPV bit for EFSCFD instruction emulation 2019-07-20 18:22:01 +00:00
trap_subr.S powerpc/booke: Don't zero MAS8, it's unnecessary 2019-10-20 15:50:33 +00:00