Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/booke Fix kernel panic due to tmpfs.



details:   https://anonhg.NetBSD.org/src/rev/7c67909e28f8
branches:  trunk
changeset: 973669:7c67909e28f8
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Jul 07 00:28:30 2020 +0000

description:
Fix kernel panic due to tmpfs.

pmap for booke assumes that the ``va'' argument for pmap_kenter_pa(9) is
page-aligned. However, by recent changes, tmpfs became to use ``va'' with
page offset via ubc_uiomove(9). So, truncate it to page boundary.

diffstat:

 sys/arch/powerpc/booke/e500_tlb.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 3fa821a650a2 -r 7c67909e28f8 sys/arch/powerpc/booke/e500_tlb.c
--- a/sys/arch/powerpc/booke/e500_tlb.c Mon Jul 06 23:33:38 2020 +0000
+++ b/sys/arch/powerpc/booke/e500_tlb.c Tue Jul 07 00:28:30 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: e500_tlb.c,v 1.21 2020/07/06 10:12:04 rin Exp $        */
+/*     $NetBSD: e500_tlb.c,v 1.22 2020/07/07 00:28:30 rin Exp $        */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define        __PMAP_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.21 2020/07/06 10:12:04 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.22 2020/07/07 00:28:30 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -536,6 +536,13 @@
 static bool
 e500_tlb_update_addr(vaddr_t va, tlb_asid_t asid, pt_entry_t pte, bool insert)
 {
+
+       /*
+        * In case where pmap_kenter_pa(9) is called for va with page offset.
+        * Required for tmpfs.
+        */
+       va &= ~PAGE_MASK;
+
 #if defined(MULTIPROCESSOR)
        e500_tlb_invalidate_addr(va, asid);
        return true;



Home | Main Index | Thread Index | Old Index