Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 Fix bug with incorrect range calcul...



details:   https://anonhg.NetBSD.org/src/rev/593cfb3be95e
branches:  trunk
changeset: 935075:593cfb3be95e
user:      ryo <ryo%NetBSD.org@localhost>
date:      Wed Jun 24 08:27:47 2020 +0000

description:
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

diffstat:

 sys/arch/aarch64/aarch64/pmap.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 53e67f32d9ad -r 593cfb3be95e sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Wed Jun 24 08:20:13 2020 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Wed Jun 24 08:27:47 2020 +0000
@@ -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 <ryo%nerv.org@localhost>
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index