Date: Thu, 14 Feb 2019 15:16:53 -0800 From: Mark Millard <marklmi@yahoo.com> To: Dennis Clarke <dclarke@blastwave.org> Cc: freebsd-ppc@freebsd.org Subject: Re: Some evidence about the PowerMac G5 multiprocessor boot hang ups with the modern VM_MAX_KERNEL_ADDRESS value Message-ID: <F4CC07D4-0144-4DCE-9D7F-9A8C1A576C19@yahoo.com> In-Reply-To: <cffd5295-fa2b-281d-754a-c01be1fb6fec@blastwave.org> References: <11680D15-D43D-4115-AF4F-5F6E4E0022C9@yahoo.com> <cffd5295-fa2b-281d-754a-c01be1fb6fec@blastwave.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-Feb-14, at 12:56, Dennis Clarke <dclarke at blastwave.org> = wrote: > On 2/13/19 10:35 PM, Mark Millard via freebsd-ppc wrote: >> I added some bootverbose messages to: >=20 > I clearly need to apply your "HACK" verbosity because I am seeing odd > behavior where I now need to set kern.smp.disabled=3D1 to get a boot = AND > then I get all four cores online. >=20 > Here is the /var/run/dmesg.boot with some 'malloc' lines snipped out. >=20 > Everything comes to a screetching halt at vt_upgrade(&vt_consdev) = unless I set kern.smp.disabled=3D1 and then I get a normal boot. >=20 > . . . Even without my additions, using boot -v at the loader prompt would echo more information, including during: subsystem f000000 cpu_mp_unleash(0)... done. (where I get a hangup much of the time). boot -v is independent of debug.verbose_sysinit=3D1 : they can be together or separately. Looks like I did not include the svnlite diff output as of my adding the address information and such. But I only added to the cpu_mp_unleash related activity overall. My updates svnlite diff is as follows: # svnlite diff /usr/src/sys/powerpc/powermac/platform_powermac.c = /usr/src/sys/powerpc/powerpc/mp_machdep.c = Index: = /usr/src/sys/powerpc/powermac/platform_powermac.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/src/sys/powerpc/powermac/platform_powermac.c (revision = 344018) +++ /usr/src/sys/powerpc/powermac/platform_powermac.c (working copy) @@ -344,6 +344,10 @@ =20 cpu =3D pc->pc_hwref; res =3D OF_getprop(cpu, "soft-reset", &reset, sizeof(reset)); + if (bootverbose) // HACK!!! + printf("powermac_smp_start_cpu 's OF_getprop for CPU = %d, hwref=3D%jx, awake=3D%x: res=3D%d, reset=3D%x\n", + pc->pc_cpuid, (uintmax_t)pc->pc_hwref, + pc->pc_awake, res, reset); if (res < 0) { reset =3D 0x58; =20 @@ -363,14 +367,33 @@ default: return (ENXIO); } + if (bootverbose) // HACK!!! + printf("powermac_smp_start_cpu for res<0 for CPU = %d, hwref=3D%jx, awake=3D%x: res=3D%d, reset=3D%x\n", + pc->pc_cpuid, (uintmax_t)pc->pc_hwref, + pc->pc_awake, res, reset); } =20 ap_pcpu =3D pc; =20 if (rstvec_virtbase =3D=3D NULL) + { // HACK!!! rstvec_virtbase =3D pmap_mapdev(0x80000000, PAGE_SIZE); + if (bootverbose) // HACK!!! + printf("powermac_smp_start_cpu for CPU %d, = hwref=3D%jx, awake=3D%x: rstvec_virtbase=3D%p\n", + pc->pc_cpuid, (uintmax_t)pc->pc_hwref, + pc->pc_awake, rstvec_virtbase); + } // HACK!!! =20 rstvec =3D rstvec_virtbase + reset; + if (bootverbose) // HACK!!! + printf("powermac_smp_start_cpu for CPU %d, hwref=3D%jx, = awake=3D%x: rstvec=3D%p\n", + pc->pc_cpuid, (uintmax_t)pc->pc_hwref, + pc->pc_awake, rstvec); +=20 + if (bootverbose) // HACK!!! + printf("Before reset 4&0 for CPU %d, hwref=3D%jx, = awake=3D%x\n", + pc->pc_cpuid, (uintmax_t)pc->pc_hwref, + pc->pc_awake); =20 *rstvec =3D 4; powerpc_sync(); @@ -382,10 +405,20 @@ (void)(*rstvec); powerpc_sync(); =20 + if (bootverbose) // HACK!!! + printf("After reset 4&0 for CPU %d, hwref=3D%jx, = awake=3D%x\n", + pc->pc_cpuid, (uintmax_t)pc->pc_hwref, + pc->pc_awake); + timeout =3D 10000; while (!pc->pc_awake && timeout--) DELAY(100); =20 + if (bootverbose) // HACK!!! + printf("After attempted wait for awake CPU %d, = hwref=3D%jx, awake=3D%x\n", + pc->pc_cpuid, (uintmax_t)pc->pc_hwref, + pc->pc_awake); + return ((pc->pc_awake) ? 0 : EBUSY); #else /* No SMP support */ Index: /usr/src/sys/powerpc/powerpc/mp_machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/src/sys/powerpc/powerpc/mp_machdep.c (revision 344018) +++ /usr/src/sys/powerpc/powerpc/mp_machdep.c (working copy) @@ -97,6 +97,9 @@ /* Initialize decrementer */ decr_ap_init(); =20 + if (bootverbose) // HACK!!! + printf("machdep_ap_bootstrap before ap_boot_mtx lock: = AP CPU #%d launched\n", PCPU_GET(cpuid)); + /* Serialize console output and AP count increment */ mtx_lock_spin(&ap_boot_mtx); ap_awake++; @@ -109,6 +112,8 @@ =20 while(smp_started =3D=3D 0) ; + if (bootverbose) // HACK!!! + printf("machdep_ap_bootstrap after smp_started!=3D0: AP = CPU #%d launched\n", PCPU_GET(cpuid)); =20 /* Start per-CPU event timers. */ cpu_initclocks_ap(); @@ -238,10 +243,19 @@ =20 ret =3D platform_smp_start_cpu(pc); if (ret =3D=3D 0) { + if (bootverbose) // HACK!!! + printf("cpu_mp_unleash = attempting to wait for pc_awake: CPU %d, hwref=3D%jx, awake=3D%x\n", + pc->pc_cpuid, = (uintmax_t)pc->pc_hwref, + pc->pc_awake); + timeout =3D 2000; /* wait 2sec for = the AP */ while (!pc->pc_awake && --timeout > 0) DELAY(1000); } + if (bootverbose) // HACK!!! + printf("cpu_mp_unleash after = platform_smp_start_cpu and waiting: CPU %d, hwref=3D%jx, awake=3D%x\n", + pc->pc_cpuid, = (uintmax_t)pc->pc_hwref, + pc->pc_awake); } else { pc->pc_awake =3D 1; } @@ -252,7 +266,13 @@ pc->pc_awake); smp_cpus++; } else + { // HACK!!! + if (bootverbose) // HACK!!! + printf("cpu_mp_unleash adding pc_cpuid = to stopped_cpus: CPU %d (dev=3D%x)\n", + pc->pc_cpuid, (int)pc->pc_hwref); CPU_SET(pc->pc_cpuid, &stopped_cpus); + } // HACK!!! + } =20 ap_awake =3D 1; (The above may not preserve all whitespace detail.) I'll note that I did some experimenting with a system-clang based kernel build, used with devel/powerpc64-binutils , avoiding loading kernel modules dynamically. I did not have any boot problems but I'd not done enough activity to infer too much. My normal builds are based on devel/powerpc64-xoolchain-gcc related tools, including devel/powerpc64-gcc . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F4CC07D4-0144-4DCE-9D7F-9A8C1A576C19>