aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2016-02-16 02:13:55 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2016-02-16 02:13:55 +0000
commitdebd17c5e7ff021196c81116ad8218568049aa07 (patch)
treef7be3f9a1e080032bb21ce39a9de723598cd83c7
parent1bd4272fb965bdce2c52ebea756df23d5fd74249 (diff)
downloadsrc-debd17c5e7ff021196c81116ad8218568049aa07.tar.gz
src-debd17c5e7ff021196c81116ad8218568049aa07.zip
Fix a panic bug that cropped up in the PTE rewrite.
PTE was getting overwritten by just the flags. Pointy-hat to: jhibbits
Notes
Notes: svn path=/head/; revision=295642
-rw-r--r--sys/powerpc/booke/pmap.c3
-rw-r--r--sys/powerpc/include/pte.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index 86da60a68808..0b45c878ea4a 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -1759,7 +1759,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
tlb_miss_lock();
tlb0_flush_entry(va);
- *pte = flags;
+ *pte &= ~PTE_FLAGS_MASK;
+ *pte |= flags;
tlb_miss_unlock();
mtx_unlock_spin(&tlbivax_mutex);
diff --git a/sys/powerpc/include/pte.h b/sys/powerpc/include/pte.h
index 7108072ed6a7..8cbd70b591f5 100644
--- a/sys/powerpc/include/pte.h
+++ b/sys/powerpc/include/pte.h
@@ -270,6 +270,7 @@ typedef uint64_t pte_t;
/* Macro argument must of pte_t type. */
#define PTE_ARPN_SHIFT 12
+#define PTE_FLAGS_MASK 0x00ffffff
#define PTE_RPN_FROM_PA(pa) (((pa) & ~PAGE_MASK) << PTE_ARPN_SHIFT)
#define PTE_PA(pte) ((vm_paddr_t)(*pte >> PTE_ARPN_SHIFT) & ~PAGE_MASK)
#define PTE_ISVALID(pte) ((*pte) & PTE_VALID)