Module Name:    src
Committed By:   jmcneill
Date:           Tue Jan 28 23:24:09 UTC 2020

Modified Files:
        src/sys/external/bsd/drm2/ttm: ttm_bo_vm.c

Log Message:
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@.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c
diff -u src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.12 src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.13
--- src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.12	Sat Mar  9 01:59:47 2019
+++ src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c	Tue Jan 28 23:24:09 2020
@@ -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 @@ ttm_bo_uvm_fault(struct uvm_faultinfo *u
 	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 @@ ttm_bo_uvm_fault(struct uvm_faultinfo *u
 			    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;
 	}

Reply via email to