Date: Wed, 1 Jun 2011 14:02:25 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r222562 - projects/pseries/powerpc/pseries Message-ID: <201106011402.p51E2PZ5072849@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106011402.p51E2PZ5072849>