From c1d69fb7e48290c88de557add3188f72e959fe0d Mon Sep 17 00:00:00 2001 From: jhibbits Date: Sat, 26 May 2018 04:33:19 +0000 Subject: [PATCH] On POWER9 clear the HID0_RADIX before enabling the page tables POWER9 supports Radix page tables in addition to Hashed page tables. When Radix page tables are in use, the TLB is cut in half, so that half of the TLB is used for the page walk cache. This is the default behavior, however FreeBSD currently does not support Radix tables. Clear this bit so that we can use the full TLB. Do this in the MMU logic so that configuration can be localized to the specific translation format. Once we do support Radix tables, the setup for that will be localized to the Radix MMU kobj. --- sys/powerpc/aim/moea64_native.c | 7 +++++++ sys/powerpc/include/hid.h | 1 + 2 files changed, 8 insertions(+) diff --git a/sys/powerpc/aim/moea64_native.c b/sys/powerpc/aim/moea64_native.c index b8178c0ff45b..b9eee3741607 100644 --- a/sys/powerpc/aim/moea64_native.c +++ b/sys/powerpc/aim/moea64_native.c @@ -116,6 +116,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -384,6 +385,12 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); + switch (mfpvr() >> 16) { + case IBMPOWER9: + mtspr(SPR_HID0, mfspr(SPR_HID0) & ~HID0_RADIX); + break; + } + /* * Install kernel SLB entries */ diff --git a/sys/powerpc/include/hid.h b/sys/powerpc/include/hid.h index 77940012beb1..1b0381115343 100644 --- a/sys/powerpc/include/hid.h +++ b/sys/powerpc/include/hid.h @@ -33,6 +33,7 @@ #define _POWERPC_HID_H_ /* Hardware Implementation Dependent registers for the PowerPC */ +#define HID0_RADIX 0x0080000000000000 /* Enable Radix page tables (POWER9) */ #define HID0_EMCP 0x80000000 /* Enable machine check pin */ #define HID0_DBP 0x40000000 /* Disable 60x bus parity generation */