From owner-svn-src-projects@FreeBSD.ORG Wed Jun 1 14:02:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCAFC106564A; Wed, 1 Jun 2011 14:02:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 941B68FC15; Wed, 1 Jun 2011 14:02:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p51E2P6p072852; Wed, 1 Jun 2011 14:02:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p51E2PZ5072849; Wed, 1 Jun 2011 14:02:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106011402.p51E2PZ5072849@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 1 Jun 2011 14:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222562 - projects/pseries/powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2011 14:02:25 -0000 Author: nwhitehorn Date: Wed Jun 1 14:02:25 2011 New Revision: 222562 URL: http://svn.freebsd.org/changeset/base/222562 Log: Fix a bug in determining the page table size under the power hypervisor, add a mostly redundant check for the CPU SLB size from the device tree, and hook up a hypercall to H_CEDE as the idle loop when running under the power hypervisor. Modified: projects/pseries/powerpc/pseries/mmu_phyp.c projects/pseries/powerpc/pseries/platform_chrp.c Modified: projects/pseries/powerpc/pseries/mmu_phyp.c ============================================================================== --- projects/pseries/powerpc/pseries/mmu_phyp.c Wed Jun 1 13:15:24 2011 (r222561) +++ projects/pseries/powerpc/pseries/mmu_phyp.c Wed Jun 1 14:02:25 2011 (r222562) @@ -55,6 +55,8 @@ #include "phyp-hvcall.h" +extern int n_slbs; + /* * Kernel MMU interface */ @@ -122,8 +124,12 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t } res = OF_getprop(node, "ibm,pft-size", prop, sizeof(prop)); - if (prop != NULL) - final_pteg_count = 1 << prop[1]; + if (res <= 0) + panic("mmu_phyp: unknown PFT size"); + final_pteg_count = 1 << prop[1]; + res = OF_getprop(node, "ibm,slb-size", prop, sizeof(prop[0])); + if (res > 0) + n_slbs = prop[0]; moea64_pteg_count = final_pteg_count / sizeof(struct lpteg); Modified: projects/pseries/powerpc/pseries/platform_chrp.c ============================================================================== --- projects/pseries/powerpc/pseries/platform_chrp.c Wed Jun 1 13:15:24 2011 (r222561) +++ projects/pseries/powerpc/pseries/platform_chrp.c Wed Jun 1 14:02:25 2011 (r222562) @@ -73,6 +73,10 @@ static int chrp_smp_start_cpu(platform_t static struct cpu_group *chrp_smp_topo(platform_t plat); #endif static void chrp_reset(platform_t); +#ifdef __powerpc64__ +#include "phyp-hvcall.h" +static void phyp_cpu_idle(void); +#endif static platform_method_t chrp_methods[] = { PLATFORMMETHOD(platform_probe, chrp_probe), @@ -123,6 +127,7 @@ chrp_attach(platform_t plat) realmaxaddr = phys[0].mr_size; pmap_mmu_install("mmu_phyp", BUS_PROBE_SPECIFIC); + cpu_idle_hook = phyp_cpu_idle; } #endif @@ -357,3 +362,10 @@ chrp_reset(platform_t platform) OF_reboot(); } +#ifdef __powerpc64__ +static void +phyp_cpu_idle(void) +{ + phyp_hcall(H_CEDE); +} +#endif