Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/ttm Do not extract mmap flags from the...



details:   https://anonhg.NetBSD.org/src/rev/381cd9350987
branches:  trunk
changeset: 744278:381cd9350987
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Jan 28 23:24:09 2020 +0000

description:
Do not extract mmap flags from the bus_space_mmap cookie as they may
conflict with the bo's existing protection flags. This caused VRAM to
be incorrectly mapped as Device-nGnRE on Arm64 instead of Normal-NC. Ok
riastradh@.

diffstat:

 sys/external/bsd/drm2/ttm/ttm_bo_vm.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r aaf9e9a2ceea -r 381cd9350987 sys/external/bsd/drm2/ttm/ttm_bo_vm.c
--- a/sys/external/bsd/drm2/ttm/ttm_bo_vm.c     Tue Jan 28 23:21:05 2020 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_bo_vm.c     Tue Jan 28 23:24:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ttm_bo_vm.c,v 1.12 2019/03/09 01:59:47 mrg Exp $       */
+/*     $NetBSD: ttm_bo_vm.c,v 1.13 2020/01/28 23:24:09 jmcneill Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.12 2019/03/09 01:59:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.13 2020/01/28 23:24:09 jmcneill Exp $");
 
 #include <sys/types.h>
 
@@ -89,7 +89,6 @@
        unsigned i;
        vm_prot_t vm_prot;      /* VM_PROT_* */
        pgprot_t pgprot;        /* VM_PROT_* | PMAP_* cacheability flags */
-       unsigned mmapflags;
        int ret;
 
        /* Thanks, uvm, but we don't need this lock.  */
@@ -189,13 +188,11 @@
                            0);
 
                        paddr = pmap_phys_address(cookie);
-                       mmapflags = pmap_mmap_flags(cookie);
                } else {
                        paddr = page_to_phys(u.ttm->pages[startpage + i]);
-                       mmapflags = 0;
                }
                ret = -pmap_enter(ufi->orig_map->pmap, vaddr + i*PAGE_SIZE,
-                   paddr, vm_prot, (PMAP_CANFAIL | pgprot | mmapflags));
+                   paddr, vm_prot, (PMAP_CANFAIL | pgprot));
                if (ret)
                        goto out3;
        }



Home | Main Index | Thread Index | Old Index