From owner-freebsd-ppc@freebsd.org Sun Feb 24 21:07:36 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 3B87F150C73F for ; Sun, 24 Feb 2019 21:07:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0331888780 for ; Sun, 24 Feb 2019 21:07:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-x229.google.com with SMTP id z20so5652739ljj.10 for ; Sun, 24 Feb 2019 13:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7TFxM+ZyEXAFs2+RRuyplbSfS6Pz61ri9UvCVcQReRQ=; b=L9mPIyAqhNkXd7IDJklyk2jjWhFCwDEM2ok0LX8YXHGV0HWE0laykJndu1Pc4sdZkr ZmyAuTOvMPWMchUkEI/mDrK4UThVSFvHZ456Pina7ZCSk9zml6sLavxaqtYcpQcEJdbW Z6KjPios464QmUSXJnfOay7fCeGhQvWrrExH2bzJMBcvDRFMcYryppDLGLc2QeL8x01Z VjiXFvUUeGflCiRty4hmSoe+HnS1xTAIljz5ZTR8mOwkaekDP2v3bb5DC3nwLJg9XV8V nhiPB73XUx4yISREVoPlPRig2H/OGjbHbFLm0a4bQ9u6NNWU2jFpnAsKoPnz3Cen9IHF nA5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7TFxM+ZyEXAFs2+RRuyplbSfS6Pz61ri9UvCVcQReRQ=; b=pEVyNhZiNujLGyAjoT5SILy2W85y/OJn9Lyf1Wl5JzKJNmlyAAZjgbMlv0HRa0w5mV qui7KTUOrTmvL9rWF2T2U/w5ZBytbacAd68rauRjc6Tyuzb3aWQ+BvT/NyuIW4TgY8h6 saizVyErkijFwmzlD2BGmnGSktDgz5otAgdpVowsC6sVQBZaJ749QvURIqHhEPbd+eFo scNjgPj3VIbKqi1vKJmLcabGaB+/63khT2aoiy8vx0AzfohHkuwtbKe3+a/bldKIa8Wi 37SH9/+qZb/9ybVbm/U3dl222RzWGpv4/CBc6P1HWlgvQn2P9P0ScKRYPtTtuJFUEYWM 1khQ== X-Gm-Message-State: AHQUAuZYmjz5fAzpZg2rih5fDeUHAUnr8A9qg4gJvbdb0UOZN1C98HzR +5zRrO4yVLNgeLlEyS6WM5ijIZW9iymzR+b8PpM= X-Google-Smtp-Source: AHgI3IbSgyBPOgdvTG8RB9G9NpgMqYPE0Dn0mUJ9MgbWRteQb9KzNiT4brkdkm1fWsq5kbABcY1IfFfo9P80WyeD6Cw= X-Received: by 2002:a2e:89d9:: with SMTP id c25mr8639821ljk.105.1551042452169; Sun, 24 Feb 2019 13:07:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Justin Hibbits Date: Sun, 24 Feb 2019 15:07:20 -0600 Message-ID: Subject: Re: An experimental hack that appears to allow old PowerMacG5 4-core (system total) system to boot reliably (head -r343884 based context) To: Mark Millard Cc: FreeBSD PowerPC ML , Dennis Clarke Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0331888780 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=L9mPIyAq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2a00:1450:4864:20::229 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-6.69 / 15.00]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.90)[-0.896,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[9.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.78)[ip: (-9.59), ipnet: 2a00:1450::/32(-2.25), asn: 15169(-2.00), country: US(-0.07)]; RCVD_COUNT_TWO(0.00)[2] 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: Sun, 24 Feb 2019 21:07:36 -0000 On Sat, Feb 23, 2019 at 1:36 PM Mark Millard 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< + 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