Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hppa Deal with PA2.0 cache move-in rules by purging...
details: https://anonhg.NetBSD.org/src/rev/a52b205502b0
branches: trunk
changeset: 752314:a52b205502b0
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Feb 22 21:32:55 2010 +0000
description:
Deal with PA2.0 cache move-in rules by purging the TLB as well as
flushing/purging the cache.
diffstat:
sys/arch/hppa/hppa/pmap.c | 45 +++++++++++++++++++++++++++++++++++--------
sys/arch/hppa/include/pmap.h | 8 ++++++-
2 files changed, 43 insertions(+), 10 deletions(-)
diffs (126 lines):
diff -r 0e6fb4d1fd18 -r a52b205502b0 sys/arch/hppa/hppa/pmap.c
--- a/sys/arch/hppa/hppa/pmap.c Mon Feb 22 20:13:01 2010 +0000
+++ b/sys/arch/hppa/hppa/pmap.c Mon Feb 22 21:32:55 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.67 2010/02/17 14:16:53 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.68 2010/02/22 21:32:55 skrll Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.67 2010/02/17 14:16:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.68 2010/02/22 21:32:55 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -257,7 +257,14 @@
void
pmap_pagefree(struct vm_page *pg)
{
- fdcache(HPPA_SID_KERNEL, VM_PAGE_TO_PHYS(pg), PAGE_SIZE);
+ paddr_t pa = VM_PAGE_TO_PHYS(pg);
+ pdcache(HPPA_SID_KERNEL, pa, PAGE_SIZE);
+
+#if defined(HP8000_CPU) || defined(HP8200_CPU) || \
+ defined(HP8500_CPU) || defined(HP8600_CPU)
+ pdtlb(HPPA_SID_KERNEL, pa);
+ pitlb(HPPA_SID_KERNEL, pa);
+#endif
uvm_pagefree(pg);
}
@@ -415,12 +422,12 @@
pmap_pte_flush(pmap_t pmap, vaddr_t va, pt_entry_t pte)
{
+ fdcache(pmap->pm_space, va, PAGE_SIZE);
+ pdtlb(pmap->pm_space, va);
if (pte & PTE_PROT(TLB_EXECUTE)) {
ficache(pmap->pm_space, va, PAGE_SIZE);
pitlb(pmap->pm_space, va);
}
- fdcache(pmap->pm_space, va, PAGE_SIZE);
- pdtlb(pmap->pm_space, va);
#ifdef USE_HPT
if (pmap_hpt) {
struct hpt_entry *hpt;
@@ -1696,16 +1703,21 @@
KASSERT(!(pg->mdpage.pvh_attrs & PVF_NC));
/* purge cache for all possible mappings for the pa */
- mutex_enter(&pg->mdpage.pvh_lock);
for (pve = pg->mdpage.pvh_list; pve; pve = pve->pv_next) {
vaddr_t va = pve->pv_va & PV_VAMASK;
+ pa_space_t sp = pve->pv_pmap->pm_space;
if (purge)
- pdcache(pve->pv_pmap->pm_space, va, PAGE_SIZE);
+ pdcache(sp, va, PAGE_SIZE);
else
- fdcache(pve->pv_pmap->pm_space, va, PAGE_SIZE);
+ fdcache(sp, va, PAGE_SIZE);
+#if defined(HP8000_CPU) || defined(HP8200_CPU) || \
+ defined(HP8500_CPU) || defined(HP8600_CPU)
+ pdtlb(sp, va);
+ ficache(sp, va, PAGE_SIZE);
+ pitlb(sp, va);
+#endif
}
- mutex_exit(&pg->mdpage.pvh_lock);
}
/*
@@ -1723,6 +1735,12 @@
memset((void *)pa, 0, PAGE_SIZE);
fdcache(HPPA_SID_KERNEL, pa, PAGE_SIZE);
+#if defined(HP8000_CPU) || defined(HP8200_CPU) || \
+ defined(HP8500_CPU) || defined(HP8600_CPU)
+ pdtlb(HPPA_SID_KERNEL, pa);
+ ficache(HPPA_SID_KERNEL, pa, PAGE_SIZE);
+ pitlb(HPPA_SID_KERNEL, pa);
+#endif
}
/*
@@ -1745,6 +1763,15 @@
pdcache(HPPA_SID_KERNEL, spa, PAGE_SIZE);
fdcache(HPPA_SID_KERNEL, dpa, PAGE_SIZE);
+#if defined(HP8000_CPU) || defined(HP8200_CPU) || \
+ defined(HP8500_CPU) || defined(HP8600_CPU)
+ pdtlb(HPPA_SID_KERNEL, spa);
+ pdtlb(HPPA_SID_KERNEL, dpa);
+ ficache(HPPA_SID_KERNEL, spa, PAGE_SIZE);
+ ficache(HPPA_SID_KERNEL, dpa, PAGE_SIZE);
+ pitlb(HPPA_SID_KERNEL, spa);
+ pitlb(HPPA_SID_KERNEL, dpa);
+#endif
}
void
diff -r 0e6fb4d1fd18 -r a52b205502b0 sys/arch/hppa/include/pmap.h
--- a/sys/arch/hppa/include/pmap.h Mon Feb 22 20:13:01 2010 +0000
+++ b/sys/arch/hppa/include/pmap.h Mon Feb 22 21:32:55 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.23 2009/11/15 12:26:02 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.24 2010/02/22 21:32:55 skrll Exp $ */
/* $OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $ */
@@ -119,6 +119,12 @@
static inline paddr_t hppa_unmap_poolpage(vaddr_t va)
{
pdcache(HPPA_SID_KERNEL, va, PAGE_SIZE);
+#if defined(HP8000_CPU) || defined(HP8200_CPU) || \
+ defined(HP8500_CPU) || defined(HP8600_CPU)
+ pdtlb(HPPA_SID_KERNEL, va);
+ ficache(HPPA_SID_KERNEL, va, PAGE_SIZE);
+ pitlb(HPPA_SID_KERNEL, va);
+#endif
return (paddr_t)va;
}
Home |
Main Index |
Thread Index |
Old Index