From owner-freebsd-ppc@freebsd.org Sat Apr 13 18:39:24 2019 Return-Path: Delivered-To: freebsd-ppc@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 1D07A157FF46 for ; Sat, 13 Apr 2019 18:39:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-20.consmr.mail.ne1.yahoo.com (sonic316-20.consmr.mail.ne1.yahoo.com [66.163.187.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D55618D4D6 for ; Sat, 13 Apr 2019 18:39:22 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: X13VITEVM1nKoTp9x3a89fNq_uUm53u1T53x9s8vwIbWHt1eVYs5X5RKFWQxVp1 _PWNpTZZN9H7q5ubc9enPRpfkBnZwm.DPZZtZFJmgs5_TDdaVtjRoi2Bov9NqcSYCNkL7pthn7CD qGn1rq9diH3DwY72Omk8dXsurudkNw5J63YbxrY8.bgSyONJNPyQEXnD1ByAzIRFxkSfClqgDDLh 6chXd3F9uz7.DzbGGbj4rMudc2TqmYMlnyE2vuZHddl6oWZte6tDZkrx6eV2ttXnZT4fMnauxvK7 lgcezef7phUyfrx8Lkbr1ATspsz3brTkFHwk.aa66gTV9jhjAzF.47w8eCCOthjmkmBm5qT38C7s JLfww4NPKlhn7RjrYCCHsK6mqXOK5GnDN_7aYeGe1Hz3mDehzdaB9PSj8EuxOV.Seyp7WsnXlQlW EbS5DBSd3A1FANu4sWAwWJ1FlrPiqg9TVBnQtNnfMN6loyltVjkB7HyQ88U73thAFZ3tjVaoUX5q Mtz2usdUp_GJvFoZpje5unziWhlY9TeslV5AvbRUK61VxNgzwznxxdU1VWFEo8JSuxPjX97VW6fk EAb_heB6Xm1_tgEXZKz6F4eXmio.PXqDgPVU4homzBBc0jamtdUyP7UuseSNd21i2IDWveMIUAMy .RpD.iNunRdaDmd286IMkPDxgKwz8_Kf0GWrQ3EVKfnKDiDnIts2boV4AnGK238WlC.da1B8CfF9 HvDpv11dImn7P2QLaslGdtVst3ttdx24B1EgYjAX9qgf2PE6Gg.ntBa..2.eXRkqfOmmDi148d5S 4BJ4jTvdZriFb5RzViV.Hx7DjS_5SH3EogqjZ3PAbnRBE8qwIXweyLljZAzNfWWEER33JCZuQfG_ ue6jWA8mkLVcWzvp60vyRY6.k_TgVJgQxJQ0GtnuSJZnXUjR7gN6Qqt9Z0siERTUk.zHrNl.gshh qzWKVFFcmLwF4StOwBFRaPjJw8ygm.4FdMmsFqUJfAHih4oSo2e9S73Lb91YBn4PJyryx9QSLyNi CkKh7Gzr3.H5cuXpmaN1y8TbRrCaz8zG_Skk5iu3y0reX3SIw3xdYSlH6SLjea3eKm6JoeiT9PIx eTKiq Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Sat, 13 Apr 2019 18:39:20 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.103]) ([76.115.7.162]) by smtp413.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 44b9f688445dc052e9dd34379a30d737; Sat, 13 Apr 2019 18:39:19 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: Patches to allow usefdt mode that works on a 2 socket PowerMac3, 6 example too --and makes more work on 2-socket/1-core-each PowerMac11, 2 From: Mark Millard In-Reply-To: Date: Sat, 13 Apr 2019 11:39:18 -0700 Cc: freebsd-ppc@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <55E83F50-197D-43C7-B4D6-E69A5AEC2630@yahoo.com> References: <988F644F-D5E7-4FB4-AAB3-A72E9DA88CE6@yahoo.com> <465DBF40-EEF5-4D4A-95F6-DF17EB5B130B@yahoo.com> <5aecd21e-e53c-f14c-0bdc-8732fa88fed6@blastwave.org> To: Dennis Clarke X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: D55618D4D6 X-Spamd-Bar: + X-Spamd-Result: default: False [1.93 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.92)[0.915,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.20)[ip: (3.49), ipnet: 66.163.184.0/21(1.43), asn: 36646(1.15), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.06)[0.064,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.25)[0.255,0]; RCVD_IN_DNSWL_NONE(0.00)[146.187.163.66.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[146.187.163.66.rep.mailspike.net : 127.0.0.17] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Apr 2019 18:39:24 -0000 [My adjustment to fdt_add_subnode_namelen was inept.] On 2019-Apr-12, at 16:17, Mark Millard wrote: > On 2019-Apr-12, at 14:20, Dennis Clarke wrote: > >> On 4/12/19 4:51 PM, Mark Millard wrote: >>> On 2019-Apr-12, at 13:13, Dennis Clarke wrote: >>>> On 4/12/19 3:19 PM, Mark Millard via freebsd-ppc wrote: >> . >> . >> . >>>> >>>> Would you be so kind as to paste all this into : >>>> >>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233863 >>>> >>>> Really I would like to run some tests and follow up in the bug reports. >>> Okay I'll paste them in as attachments. But be warned: >> >> Fair warning received loud and clear :-) >> >>> The 2 files do not deal with threads being stuck sleeping >>> (and, so, the fans going) or other such. The stuck-sleeping >>> problem happens for both multi-socket G5's and multi-socket >>> G4's. (I do not have access to single-socket multi-core >>> powerpc64 or powerpc machines to test.) >> >> I have multiple G5 type boxen and will try them out. At least try >> to. >> >>> So do not expect too much from these patches: They address >>> some necessary issues but are not sufficient for everything. >>> >> >> Of course. No problem. >> >> >>> These patches for the openfirmware->fdt translation are >>> closer to being reasonable for FreeBSD official use >>> than my highly context-specific stuck-sleeping patches for >>> usefdt mode. >> >> Well to be frank we know this is for mac g5 hardware and thus having >> them working at all in any fashion is better than the current situation. >> Apple made a ton of them and they are dirt cheap and available as >> opposed to the IBM Power situation which is expensive and just in >> datacenters. > > > I have added another attachment with patches for having hang-ups > at AP startup happen less often. These are in AIM-specific code > and so has less of a chance of causing other contexts problems. > They are also powerpc64 specific. Again, the patches are > investigatory and not in a form for direct check-in to FreeBSD. > > This pair of patches narrows the time period over which threads > from the stages: > > SI_SUB_KTHREAD_INIT = 0xe000000, /* init process*/ > SI_SUB_KTHREAD_PAGE = 0xe400000, /* pageout daemon*/ > SI_SUB_KTHREAD_VM = 0xe800000, /* vm daemon*/ > SI_SUB_KTHREAD_BUF = 0xea00000, /* buffer daemon*/ > SI_SUB_KTHREAD_UPDATE = 0xec00000, /* update daemon*/ > SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ > #ifndef EARLY_AP_STARTUP > SI_SUB_SMP = 0xf000000, /* start the APs*/ > #endif > > can conflict with starting an AP via an slb replacement position > picked via expressions like mftb()%n_slbs . It does this by > explicitly picking and setting up a slb slot for its use just > before starting the AP. > > (The AP has to be part way along before it can do its own > automatic-random-slb-slot-replacements from what I can tell.) > > The patches do not remove the race and still do sometimes fail to > prevent getting a hang-up on a AP start. But it greatly decreased > the rate of hangups in my testing. (So it is a good source of > evidence about the original problem.) > > If EARLY_AP_STARTUP was supported and used, the AP startup would > not have hang-up problems from mftb()%n_slbs based slb > replacements for other threads. > > The patches are a hack, rather than a general/complete fix --and > I do not expect to see them in FreeBSD. But they do help set up > a better context for investigating other things. The disabling of blocking duplicate paths in fdt_add_subnode_namelen was done incorrectly. I'll replace the attachment after building and testing. I think this is the explanation for the PowerMac11,2 shutdown -r or -p problems. The code should have just disabled the return, more like: if (offset >= 0) #if 0 // Some Macintoshes have identical package-to-pathname results for // multiple nodes of the same type and unit under the parent node. // Avoid blocking this for fdt. return -FDT_ERR_EXISTS; #else ; #endif else if (offset != -FDT_ERR_NOTFOUND) return offset; Instead the messed up change did the "return offset;" and so did not do the addition of the node, instead returning the pre-existing one to be manipulated. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)