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 since uvm_faut() will fail if cache...



details:   https://anonhg.NetBSD.org/src/rev/6eca566c926c
branches:  trunk
changeset: 457070:6eca566c926c
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Jun 10 05:56:15 2019 +0000

description:
since uvm_faut() will fail if cache maintain instructions (e.g., "dc cvau".
that has ESR.WnR=1 = write access) for a read only page causes a data abort trap,
It shoulde be treat the access type as read access in a data abort with
cache operation (ESR_ISS_DATAABORT_CM=1)

pointed out and tested by mrg@. thanks

diffstat:

 sys/arch/aarch64/aarch64/fault.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 0faf3db2d3ed -r 6eca566c926c sys/arch/aarch64/aarch64/fault.c
--- a/sys/arch/aarch64/aarch64/fault.c  Mon Jun 10 00:51:46 2019 +0000
+++ b/sys/arch/aarch64/aarch64/fault.c  Mon Jun 10 05:56:15 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fault.c,v 1.9 2019/04/06 03:06:24 thorpej Exp $        */
+/*     $NetBSD: fault.c,v 1.10 2019/06/10 05:56:15 ryo Exp $   */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.9 2019/04/06 03:06:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.10 2019/06/10 05:56:15 ryo Exp $");
 
 #include "opt_compat_netbsd32.h"
 #include "opt_ddb.h"
@@ -171,6 +171,8 @@
 
        if ((eclass == ESR_EC_INSN_ABT_EL0) || (eclass == ESR_EC_INSN_ABT_EL1))
                ftype = VM_PROT_READ | VM_PROT_EXECUTE;
+       else if (__SHIFTOUT(esr, ESR_ISS_DATAABORT_CM))
+               ftype = VM_PROT_READ;
        else
                ftype = (rw == 0) ? VM_PROT_READ : VM_PROT_WRITE;
 



Home | Main Index | Thread Index | Old Index