Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/aarch64 Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/9e7df922597a
branches:  netbsd-9
changeset: 460805:9e7df922597a
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Nov 04 14:08:18 2019 +0000

description:
Pull up following revision(s) (requested by maya in ticket #393):

        sys/arch/aarch64/include/pmap.h: revision 1.26
        sys/arch/aarch64/aarch64/pmap.c: revision 1.48

Define PMAP_NEED_PROCWR, providing strategically placed i-cache
synchronization where just-changed memory is about to be executed.

Fixes SIGILLs seen when running Mono 6 on QEMU Cortex-A57.

ok ryo

diffstat:

 sys/arch/aarch64/aarch64/pmap.c |  20 ++++++++++++++++++--
 sys/arch/aarch64/include/pmap.h |   4 +++-
 2 files changed, 21 insertions(+), 3 deletions(-)

diffs (66 lines):

diff -r d09a18f20b31 -r 9e7df922597a sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Sun Nov 03 11:42:52 2019 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Mon Nov 04 14:08:18 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.41.2.2 2019/09/23 07:00:35 martin Exp $     */
+/*     $NetBSD: pmap.c,v 1.41.2.3 2019/11/04 14:08:18 martin 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.41.2.2 2019/09/23 07:00:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41.2.3 2019/11/04 14:08:18 martin Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -874,6 +874,22 @@
        pm_unlock(pm);
 }
 
+/*
+ * Routine:    pmap_procwr
+ *
+ * Function:
+ *     Synchronize caches corresponding to [addr, addr+len) in p.
+ *
+ */
+void
+pmap_procwr(struct proc *p, vaddr_t va, int len)
+{
+
+       /* We only need to do anything if it is the current process. */
+       if (p == curproc)
+               cpu_icache_sync_range(va, len);
+}
+
 static pt_entry_t
 _pmap_pte_adjust_prot(pt_entry_t pte, vm_prot_t prot, vm_prot_t protmask,
     bool user)
diff -r d09a18f20b31 -r 9e7df922597a sys/arch/aarch64/include/pmap.h
--- a/sys/arch/aarch64/include/pmap.h   Sun Nov 03 11:42:52 2019 +0000
+++ b/sys/arch/aarch64/include/pmap.h   Mon Nov 04 14:08:18 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.24 2019/04/08 21:18:22 ryo Exp $ */
+/* $NetBSD: pmap.h,v 1.24.4.1 2019/11/04 14:08:18 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -46,6 +46,7 @@
 
 #include <aarch64/pte.h>
 
+#define PMAP_NEED_PROCWR
 #define PMAP_GROWKERNEL
 #define PMAP_STEAL_MEMORY
 
@@ -272,6 +273,7 @@
 #define pmap_wired_count(pmap)         ((pmap)->pm_stats.wired_count)
 #define pmap_resident_count(pmap)      ((pmap)->pm_stats.resident_count)
 
+void   pmap_procwr(struct proc *, vaddr_t, int);
 bool   pmap_extract_coherency(pmap_t, vaddr_t, paddr_t *, bool *);
 void   pmap_icache_sync_range(pmap_t, vaddr_t, vaddr_t);
 



Home | Main Index | Thread Index | Old Index