From owner-freebsd-ppc@freebsd.org Wed May 1 00:08:47 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 ED46815A23A2 for ; Wed, 1 May 2019 00:08:46 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-22.consmr.mail.ne1.yahoo.com (sonic303-22.consmr.mail.ne1.yahoo.com [66.163.188.148]) (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 EF2216DE7F for ; Wed, 1 May 2019 00:08:45 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: Et90SM4VM1lsq_Sw2GmbTBNtnypgA6Bef9ailwmv0HhLHcVJXxO5SUqOhvgp5HR .IKmTKQZCWZHpNIVnjxuC0YVa33zlZsT.waCWh9Oy1lZfRZ0dnhT2k4W2yvpqSa.wJfLSqEF5zG0 JwotaGVa9Pv.2uSVAVDzdaZDzUjjQ6V0Yt2xkohznqS3NLoFp.CPFUkifSU7H8s1AyDZ4G28wXeG y3W5DbkaQgs7JmgrGVqpD_h0OIvpcswDXJPPc6Bh9.BNZT1s4ZtwdB7sk0MeY0F3mrAIeD7hNOzk gYXCDDluUhprW19pKgCWXgf2ki55uVrIv3Sktb2oG9X66.tXW_RBrMmgt4Cf2eOzKhymPNXN6FlS n4P2Su456dx_3PNfAgkgO_CKa1dZkXkCJ8Rc368iYaxhIcJjtmKmV8uWcGcjmdcioloJbFSAjloS EF252TgdCN1avY16v0FuOsqls5C6jqSJkuh2AcA.c6yk64FCEGI4Ky.MG9qvOuvVXOFgQZrHlboN RIFQgLYlJBUEURKljtMPrmalLu0njm8NezSAqdifkcAzTiswSHCHFzZfa7UK6KVaByOZ8pphqj78 SsxBCF121j_wY8I.1HK.8C8k0JjQqls5o437bjaauEY9oeLOwbFbEA3I4Ke1lSfn9COcYu9M01au 94kxNmq46r0FPLTQxPMGjDFUU87AUNRR9xn8S52Hwaby72jd91iysF2i3Ats8SZwoQ0NK2y_5wlv j_uATUy0becEa4Hgkb1y0eFVEL11CdfuRPuni.gogH0LdHdHp5524wvfq3UFjKR_gz4AJvl8YEeE ddCbb411SS6tm1GO3pRpzc3YZ83Nimk8Czng.MXnrEze_mKzHNZxGpJr3l0np.An.Z0SCSm2pclJ dpRw_9aoAPq7Yn3wlfetDex5nfg9yoShYin13Urv5pk2MFsoGjoRB8ZmkoulvVYmamr_DXfQqtYY GN7yPfy8teECsYTeCWOaYvqW5AD58wiMXvPVfCwvdVtQXsI5LM5V_.AQvxMFqGzPU17dqXPsc74R bFmaaFAK4t8WYoha47U2UyqRaFwJLsdfqEI7xhAYKedDTMqjFUVXR4.JNhJ0hSGmQhNiFwYJqMk3 VGZX1H9qksGArQ3jy6aeju9h3lxQgpsgeSflFxBpxAr_TFp5.d_qUzwPaLaezmvZ9JBNA.B8Csm5 h1.pKK3I- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Wed, 1 May 2019 00:08:38 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.103]) ([76.115.7.162]) by smtp414.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 43d6c35930f9581344943b12dd684ff2; Tue, 30 Apr 2019 23:58:26 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: n_slbs==32 vs. restore_kernsrs use of slbmte in its loop Message-Id: <1F4ED871-9964-4847-82A1-F69CD3B44EE2@yahoo.com> Date: Tue, 30 Apr 2019 16:58:25 -0700 To: Justin Hibbits , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: EF2216DE7F X-Spamd-Bar: / X-Spamd-Result: default: False [0.57 / 15.00]; RCVD_VIA_SMTP_AUTH(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]; TO_DN_ALL(0.00)[]; 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]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; 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)[]; NEURAL_HAM_MEDIUM(-0.13)[-0.129,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.18)[0.177,0]; NEURAL_HAM_LONG(-0.04)[-0.042,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.07)[ip: (2.93), ipnet: 66.163.184.0/21(1.39), asn: 36646(1.11), country: US(-0.06)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[148.188.163.66.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[148.188.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: Wed, 01 May 2019 00:08:47 -0000 When aim_early_init sets n_slbs=32, the code in restore_kernsrs does not seem to respect the figure and loops through doing 64-1 slbmte instances: restore_kernsrs: GET_CPUINFO(%r28) addi %r28,%r28,PC_KERNSLB ld %r29,16(%r28) /* One past USER_SLB_SLOT */ cmpdi %r29,0 beqlr /* If first kernel entry is invalid, * SLBs not in use, so exit early */ /* Otherwise, set up SLBs */ li %r29, 0 /* Set the counter to zero */ slbia slbmfee %r31,%r29 clrrdi %r31,%r31,28 slbie %r31 1: cmpdi %r29, USER_SLB_SLOT /* Skip the user slot */ beq- 2f ld %r31, 8(%r28) /* Load SLBE */ cmpdi %r31, 0 /* If SLBE is not valid, stop */ beqlr ld %r30, 0(%r28) /* Load SLBV */ slbmte %r30, %r31 /* Install SLB entry */ 2: addi %r28, %r28, 16 /* Advance pointer */ addi %r29, %r29, 1 cmpdi %r29, 64 /* Repeat if we are not at the end */ blt 1b blr Note the "64" in the last cmpd after %r29 is incremented by 1 --and the following blt. If I gather right, instead of 32-1 kernel slbmte assignments when n_slbs==32, this continues on to try for 64-1 assignments. (The "-1"s being for the USER_SLB_SLOT avoidance.) Is this okay for some reason? Guaranteed special values in %r30 and %r31 that avoid problems? (Not that n_slbs==32 is a G5 context. I'm not claiming this contributes to what I've been looking into. This constant 64 just looks odd given the variability in the n_slbs value.) === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)