Module Name:    src
Committed By:   ryo
Date:           Wed Jun 24 08:27:47 UTC 2020

Modified Files:
        src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
Fix bug with incorrect range calculation when doing icache sync.
This is called by sysarch(ARM_SYNC_ICACHE) from aarch32 (compat_netbsd32) emul 
process.

pointed out by rin@, thanks.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/aarch64/aarch64/pmap.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/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.78 src/sys/arch/aarch64/aarch64/pmap.c:1.79
--- src/sys/arch/aarch64/aarch64/pmap.c:1.78	Sun Jun 14 21:47:14 2020
+++ src/sys/arch/aarch64/aarch64/pmap.c	Wed Jun 24 08:27:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.78 2020/06/14 21:47:14 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.79 2020/06/24 08:27:47 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <[email protected]>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2020/06/14 21:47:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.79 2020/06/24 08:27:47 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -913,7 +913,7 @@ pmap_icache_sync_range(pmap_t pm, vaddr_
 		pte = *ptep;
 		if (lxpde_valid(pte)) {
 			vaddr_t eob = (va + blocksize) & ~(blocksize - 1);
-			vsize_t len = ulmin(eva, eob - va);
+			vsize_t len = ulmin(eva, eob) - va;
 
 			if (l3pte_writable(pte)) {
 				cpu_icache_sync_range(va, len);

Reply via email to