git: kernel - Improve pmap_change_attr() when used on the DMAP

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Dec 15 12:22:36 PST 2019


commit c2ec3418751ed579ef32df1e012847d3c17cbc67
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Dec 15 12:18:44 2019 -0800

    kernel - Improve pmap_change_attr() when used on the DMAP
    
    * When used on the DMAP's 1GB or 2MB pages pmap_change_attr()
      basically didn't work because it tries to access terminal PTEs
      (and there aren't any), instead accidently accessing the
      underlying physical memory and causing corruption.
    
    * Fix this by (1) Forcing the DMAP to use 2MB pages and
      (2) special-casing DMAP addresses in pmap_change_attr()
      to act on the PDEs.
    
    * This is not a complete fix because the granularity for
      any DMAP VAs will still be ~2MB and not 4K.  Its use by
      the DRM subsystem requires more investigation.  But the
      changes should improve some of the reported GPU corruption
      issues.
    
    Reported-by: peeter
    Testing-by: multiple

Summary of changes:
 sys/platform/pc64/include/pmap.h |  6 ++-
 sys/platform/pc64/vmm/ept.c      |  7 +++-
 sys/platform/pc64/x86_64/pmap.c  | 89 ++++++++++++++++++++++++++++++++--------
 3 files changed, 82 insertions(+), 20 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c2ec3418751ed579ef32df1e012847d3c17cbc67


-- 
DragonFly BSD source repository


More information about the Commits mailing list