Module Name:    src
Committed By:   chs
Date:           Mon Sep 21 18:41:59 UTC 2020

Modified Files:
        src/sys/uvm: uvm_amap.c uvm_io.c

Log Message:
the previous fix for PR 55366 in uvm_amap.c 1.124 was incomplete:
 - amap_adjref_anons() must also ignore AMAP_REFALL when updating
   the ppref, not just when deciding whether or not to initialize ppref.
 - UVM_EXTRACT_QREF relies on AMAP_REFALL to work properly,
   and since we can't use AMAP_REFALL then we can't use QREF either.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/uvm/uvm_amap.c
cvs rdiff -u -r1.28 -r1.29 src/sys/uvm/uvm_io.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/uvm/uvm_amap.c
diff -u src/sys/uvm/uvm_amap.c:1.124 src/sys/uvm/uvm_amap.c:1.125
--- src/sys/uvm/uvm_amap.c:1.124	Sun Sep 20 23:03:01 2020
+++ src/sys/uvm/uvm_amap.c	Mon Sep 21 18:41:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_amap.c,v 1.124 2020/09/20 23:03:01 chs Exp $	*/
+/*	$NetBSD: uvm_amap.c,v 1.125 2020/09/21 18:41:59 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.124 2020/09/20 23:03:01 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.125 2020/09/21 18:41:59 chs Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -1602,11 +1602,7 @@ amap_adjref_anons(struct vm_amap *amap, 
 
 #ifdef UVM_AMAP_PPREF
 	if (amap->am_ppref && amap->am_ppref != PPREF_NONE) {
-		if (all) {
-			amap_pp_adjref(amap, 0, amap->am_nslot, refv);
-		} else {
-			amap_pp_adjref(amap, offset, len, refv);
-		}
+		amap_pp_adjref(amap, offset, len, refv);
 	}
 #endif
 	amap_unlock(amap);

Index: src/sys/uvm/uvm_io.c
diff -u src/sys/uvm/uvm_io.c:1.28 src/sys/uvm/uvm_io.c:1.29
--- src/sys/uvm/uvm_io.c:1.28	Wed May 25 17:43:58 2016
+++ src/sys/uvm/uvm_io.c	Mon Sep 21 18:41:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_io.c,v 1.28 2016/05/25 17:43:58 christos Exp $	*/
+/*	$NetBSD: uvm_io.c,v 1.29 2020/09/21 18:41:59 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_io.c,v 1.28 2016/05/25 17:43:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_io.c,v 1.29 2020/09/21 18:41:59 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,6 +87,10 @@ uvm_io(struct vm_map *map, struct uio *u
 	error = 0;
 
 	flags |= UVM_EXTRACT_QREF | UVM_EXTRACT_CONTIG | UVM_EXTRACT_FIXPROT;
+
+	/* XXX cannot use QREF with without AMAP_REFALL, and REFALL is unsafe */
+	flags &= ~UVM_EXTRACT_QREF;
+
 	/*
 	 * step 1: main loop...  while we've got data to move
 	 */

Reply via email to