Date: Sun, 24 Feb 2019 15:07:20 -0600 From: Justin Hibbits <chmeeedalf@gmail.com> To: Mark Millard <marklmi@yahoo.com> Cc: FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, Dennis Clarke <dclarke@blastwave.org> Subject: Re: An experimental hack that appears to allow old PowerMacG5 4-core (system total) system to boot reliably (head -r343884 based context) Message-ID: <CAHSQbTBX3UR0M6V4sOjO9KFMWbi32bCR5TmBj6kF%2BgF9hF_kLg@mail.gmail.com> In-Reply-To: <AE42887B-3B50-452F-85AA-CCB382179124@yahoo.com> References: <AE42887B-3B50-452F-85AA-CCB382179124@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 23, 2019 at 1:36 PM Mark Millard <marklmi@yahoo.com> wrote: > > For sys/powerpc/aim/mp_cpudep.c 's cpudep_ap_bootstrap I added as shown below: > > +extern void hack_into_slb_if_needed(void* vap); // HACK!!! > + > uintptr_t > cpudep_ap_bootstrap(void) > { > . . . > + hack_into_slb_if_needed(pcpup->pc_curpcb); // HACK!!! > + > sp = pcpup->pc_curpcb->pcb_sp; > > and in src/sys/powerpc/aim/slb.c I added an implementation: > > +void hack_into_slb_if_needed(void* vap); // HACK!!! > +void hack_into_slb_if_needed(void* vap) // HACK!!! > +{ // HACK!!! > + struct slb *cache= PCPU_GET(aim.slb); > + vm_offset_t va= (vm_offset_t)vap; > + uint64_t slbv= kernel_va_to_slbv(va); > + uint64_t esid= va>>ADDR_SR_SHFT; > + uint64_t slbe= (esid<<SLBE_ESID_SHIFT) | SLBE_VALID; > + int i; > + > + for (i = 0; i < n_slbs; i++) { > + if (i == USER_SLB_SLOT) > + continue; > + if (cache[i].slbe == (slbe | i)) > + break; > + } > + > + if (i==n_slbs) > + slb_insert_kernel(slbe,slbv); > +} // HACK!!! > + > > So far I've not had any boot hang-ups after this. > > Given the random nature of the hang-ups it will be a > while before I conclude for sure how reliable this > change makes booting, but so far so good. > > (I recognize that the "break" could be "return" > and then then the "if (i==n_slbs)" would not be > needed.) > > > Other issues not fixed by this: > > This does not change the buf*daemon* randomly getting > hung up (and so timing out on shutdown). This appears > to be the same issue that leads to the fans sometimes > starting to run full-rate because of pmac_thermal > being hun -up. > > For buf*daemon* "top -SHIopid" before shutdown shows > just the ones that will not hang-up. The same goes for > seeing before hand for pmac_thermal vs. the fans. > > === > Mark Millard Hi Mark, Fantastic work tracking this down! So the problem is we now can fault when accessing KVA space. I think we should allow this, otherwise we can hamper performance with reduced KVA size. I'll have to think about how best to do this. Would you be willing to test patches I come up with? - Justin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHSQbTBX3UR0M6V4sOjO9KFMWbi32bCR5TmBj6kF%2BgF9hF_kLg>