From owner-svn-src-head@freebsd.org Sat May 26 04:33:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CA43EFDB1C; Sat, 26 May 2018 04:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B38A681F0D; Sat, 26 May 2018 04:33:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9447F2D83; Sat, 26 May 2018 04:33:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4Q4XKN5015834; Sat, 26 May 2018 04:33:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4Q4XKlu015832; Sat, 26 May 2018 04:33:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201805260433.w4Q4XKlu015832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 26 May 2018 04:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334235 - in head/sys/powerpc: aim include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include X-SVN-Commit-Revision: 334235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2018 04:33:21 -0000 Author: jhibbits Date: Sat May 26 04:33:19 2018 New Revision: 334235 URL: https://svnweb.freebsd.org/changeset/base/334235 Log: 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. Modified: head/sys/powerpc/aim/moea64_native.c head/sys/powerpc/include/hid.h Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat May 26 04:24:25 2018 (r334234) +++ head/sys/powerpc/aim/moea64_native.c Sat May 26 04:33:19 2018 (r334235) @@ -116,6 +116,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -383,6 +384,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 Modified: head/sys/powerpc/include/hid.h ============================================================================== --- head/sys/powerpc/include/hid.h Sat May 26 04:24:25 2018 (r334234) +++ head/sys/powerpc/include/hid.h Sat May 26 04:33:19 2018 (r334235) @@ -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 */