svn commit: r302395 - in projects/powernv/powerpc: aim pseries
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Thu Jul 7 20:28:59 UTC 2016
Author: nwhitehorn
Date: Thu Jul 7 20:28:57 2016
New Revision: 302395
URL: https://svnweb.freebsd.org/changeset/base/302395
Log:
Make n_slbs and page sizes more useful parameters and take care to flush
the TLB completely at startup (we were not setting the IS field
appropriately). This gets the MMU intiailized and the kernel on its
way to bus enumeration on bare-metal POWER8 systems.
Modified:
projects/powernv/powerpc/aim/mmu_oea64.c
projects/powernv/powerpc/aim/mmu_oea64.h
projects/powernv/powerpc/aim/moea64_native.c
projects/powernv/powerpc/pseries/mmu_phyp.c
Modified: projects/powernv/powerpc/aim/mmu_oea64.c
==============================================================================
--- projects/powernv/powerpc/aim/mmu_oea64.c Thu Jul 7 20:01:03 2016 (r302394)
+++ projects/powernv/powerpc/aim/mmu_oea64.c Thu Jul 7 20:28:57 2016 (r302395)
@@ -572,8 +572,10 @@ moea64_probe_large_page(void)
/* FALLTHROUGH */
default:
- moea64_large_page_size = 0x1000000; /* 16 MB */
- moea64_large_page_shift = 24;
+ if (moea64_large_page_size == 0) {
+ moea64_large_page_size = 0x1000000; /* 16 MB */
+ moea64_large_page_shift = 24;
+ }
}
moea64_large_page_mask = moea64_large_page_size - 1;
Modified: projects/powernv/powerpc/aim/mmu_oea64.h
==============================================================================
--- projects/powernv/powerpc/aim/mmu_oea64.h Thu Jul 7 20:01:03 2016 (r302394)
+++ projects/powernv/powerpc/aim/mmu_oea64.h Thu Jul 7 20:28:57 2016 (r302395)
@@ -81,6 +81,7 @@ extern int moea64_large_page_shift;
extern uint64_t moea64_large_page_size;
extern u_int moea64_pteg_count;
extern u_int moea64_pteg_mask;
+extern int n_slbs;
#endif /* _POWERPC_AIM_MMU_OEA64_H */
Modified: projects/powernv/powerpc/aim/moea64_native.c
==============================================================================
--- projects/powernv/powerpc/aim/moea64_native.c Thu Jul 7 20:01:03 2016 (r302394)
+++ projects/powernv/powerpc/aim/moea64_native.c Thu Jul 7 20:28:57 2016 (r302395)
@@ -382,7 +382,7 @@ moea64_cpu_bootstrap_native(mmu_t mmup,
__asm __volatile ("slbmfee %0,%1; slbie %0;" : "=r"(seg0) :
"r"(0));
- for (i = 0; i < 64; i++) {
+ for (i = 0; i < n_slbs; i++) {
if (!(slb[i].slbe & SLBE_VALID))
continue;
@@ -467,7 +467,7 @@ tlbia(void)
TLBSYNC();
- for (i = 0; i < 0xFF000; i += 0x00001000) {
+ for (i = 0x800 /* IS=10 */; i < 0xFF000; i += 0x00001000) {
#ifdef __powerpc64__
__asm __volatile("tlbiel %0" :: "r"(i));
#else
Modified: projects/powernv/powerpc/pseries/mmu_phyp.c
==============================================================================
--- projects/powernv/powerpc/pseries/mmu_phyp.c Thu Jul 7 20:01:03 2016 (r302394)
+++ projects/powernv/powerpc/pseries/mmu_phyp.c Thu Jul 7 20:28:57 2016 (r302395)
@@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$");
#include "phyp-hvcall.h"
-extern int n_slbs;
-
static struct rmlock mphyp_eviction_lock;
/*
More information about the svn-src-projects
mailing list