]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r348828
authorAlan Cox <alc@FreeBSD.org>
Sun, 15 Sep 2019 17:22:29 +0000 (17:22 +0000)
committerAlan Cox <alc@FreeBSD.org>
Sun, 15 Sep 2019 17:22:29 +0000 (17:22 +0000)
commit0ab1d3e30e14e16ea05b500431029cf4de7eb313
treeb31654f4b24128f8ebe3fd5b7a74380703c6ec69
parent0f5c99fa9aaeda57d7b0ea2c05c0df8ff424cca5
MFC r348828
  Implement an alternative solution to the amd64 and i386 pmap problem that
  we previously addressed in r348246 (and MFCed in r348479).

  This pmap problem also exists on arm64 and riscv.  However, the original
  solution developed for amd64 and i386 cannot be used on arm64 and riscv.
  In particular, arm64 and riscv do not define a PG_PROMOTED flag in their
  level 2 PTEs.  (A PG_PROMOTED flag makes no sense on arm64, where unlike
  x86 or riscv we are required to break the old 4KB mappings before making
  the 2MB mapping; and on riscv there are no unused bits in the PTE to
  define a PG_PROMOTED flag.)

  This commit implements an alternative solution that can be used on all
  four architectures.  Moreover, this solution has two other advantages.
  First, on older AMD processors that required the Erratum 383 workaround,
  it is less costly.  Specifically, it avoids unnecessary calls to
  pmap_fill_ptp() on a superpage demotion.  Second, it enables the
  elimination of some calls to pagezero() in pmap_kernel_remove_{l2,pde}().

  In addition, remove a related stale comment from pmap_enter_{l2,pde}().
sys/amd64/amd64/pmap.c
sys/arm64/arm64/pmap.c
sys/i386/i386/pmap.c
sys/riscv/riscv/pmap.c