From owner-freebsd-arm@freebsd.org Sat Feb 8 03:11:07 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10BCB235FD4 for ; Sat, 8 Feb 2020 03:11:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-8.consmr.mail.gq1.yahoo.com (sonic308-8.consmr.mail.gq1.yahoo.com [98.137.68.32]) (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 48DxyL0Hynz4KFK for ; Sat, 8 Feb 2020 03:11:05 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: qWvN9zsVM1nR_cMviK.Hcem5fL8pUm1trN8oe2qJZB.sg12_DzAQAJmgfbqcP5J wF9GUo1WcUr3jfP6D1vXJC1flXSSasDI.V8kUGFhM5YTr8c.ewu9yrPIzRYm4C7AAbX0P4uG31Wb N28nhYqmFrtzjdn9GUur.AVw_y0S1b8FB89sbDZ9I9abcUFRsik5uqkfipK1IPpQ8wQi5pIc3atD fj_SqMTXVj7D_MN0.KNbAPJ0BMxpDmFJM0BKwqYKOalLwuEi8tOnYX5q2jtwD8BwBkNovI_Q7nfn M7AMDy5wUDDgoCAzDJm2Pu.OrTQmJSrv9iAJCOXt23al1wtzbTHD.HF2mxLXKF10Rlw5Nfr2BGm4 7Mju0jk5Rp_13l4dvjEmwtzx66X3rZESjqMPKrxC5G7JvEX7B31_iAfboVA752u4.Jn4kGvmsJmo lZPp8S1v4Ro8rQr94Gh1dktyR4ja23gQXioGNXSbYTQD_K56djGJnX5WCvwBiZACFYjzlMcufukP HBEt.f0GEKyfwzhGjf6mp.bJDrNuzbm2F.0BJl2lNlHgF9ijPLOREmWZIOnshEOIWAEfyRlvTjHN aTztLFCh48Ow9CKGsZnDkzSteYrkd4O7JfMsTLsncczLqcq3MgFgFW234O1X0SbkqX7pYlN1TmQ3 Tc5SeY_JeBKVxLQpdL5JiSRSpJa8Hn10fh7OUlo3kDFSuWDlrvOEj_j40.EgF6TN3dYQJRHlTgMR CooyUlIohFEJBoqzMwdr2AyoyV7g.XzeEHdebDTtGlDPQ.vBY1S5VQOM4__kwyuueOrSg4jAkybM 9oW3WdSf6hQ91VMeTwtGjmM.Itya4IBd4aWH_qhnGu55m_02t79SU_U0Dai4ZlmC93u8eR1rk.9. kkBBQc29rXbmpsbX19s7NsOdh1OutkawsMFhgTrfaiLCzqxFNwXz2vFjEH_i.yz.Vedi32wIc7dw bqKwAAbjSe9dCoudDzribZgQvV9_xqvAMLlTK.Aje0dwicyPiGXYAWmeeIuKwzfmIWny3xtUJCr0 cPND3ai3c1FQhNTpOiCkKF9RYQMEhlxVMcZ17UH8KGYt7zgim1n65WjY9Y47Wtuw.lgF66iXKbS1 ByGSoUoZuhYTrALE6sP5bZm8mLgO6kNYwCTfhKwWIfU9L97gYZzqtJSzu4AJgb5MaK9NnwW8i_SB rZZmrGqIYi9FuyLMeU2tZ8liv1EsrOCrIgDloosqmrDXwKRxj7hwDT9xOQK49phZ7ElB.qJfK5uw oc8oAKLAh7n5UPflisDz1v90Xtzlyt75LYYKDYVDGqzs8u7uWQxszf_gMNWOU0YSN5YJ5Fg5B9HM .fvEIrLqV4icN1pWFhmhD66QPb687qUnEt1G7KWntuSQ8a.Wwf9FEiJDXbjSf1tyuy_bGE4S4jj8 aO3MkMIcf.JiS3kbPhIts_n17OgcUDFgVps91V1.0goRLT9tPLuvK_SkPSmGNQPfGE1oEWIxjaqo gMpo- Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Sat, 8 Feb 2020 03:11:04 +0000 Received: by smtp427.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID dac240b61f7c793ad799b9e5d949dbc2; Sat, 08 Feb 2020 03:10:59 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: RPi3 not using SMP? From: Mark Millard In-Reply-To: <6B6CCB8F-B56A-4758-BEEC-6418718C95CB@yahoo.com> Date: Fri, 7 Feb 2020 19:10:58 -0800 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9F1B762C-D1DA-40F6-A2D6-451B40A39E4A@yahoo.com> References: <20200208011940.GA8570@www.zefox.net> <6B6CCB8F-B56A-4758-BEEC-6418718C95CB@yahoo.com> To: bob prohaska , "jeff@freebsd.org" X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Rspamd-Queue-Id: 48DxyL0Hynz4KFK X-Spamd-Bar: - X-Spamd-Result: default: False [-1.28 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.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.85)[-0.853,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-0.92)[-0.924,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (0.80), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.66), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[32.68.137.98.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 03:11:07 -0000 [I now have some bounds on when PSCI_FN_VERSION gets a 0 result from smc #0 instead of the correct result: 2. Hopefully I can narrow the range more.] On 2020-Feb-7, at 18:46, Mark Millard wrote: > On 2020-Feb-7, at 17:19, bob prohaska wrote: >=20 >> For some weeks now an RPi3 running -current has seemed rather = slow.... >>=20 >> On looking at the early part of the boot message the processor >> attributes seem rather scant: >>=20 >> ...... >> elease APs...APs not started >> CPU 0: ARM Cortex-A53 r0p4 affinity: 0 >> Instruction Set Attributes 0 =3D >> Instruction Set Attributes 1 =3D <> >> Processor Features 0 =3D >> Processor Features 1 =3D <> >> Memory Model Features 0 =3D >> Memory Model Features 1 =3D <8bit VMID> >> Memory Model Features 2 =3D <32bit CCIDX,48bit VA> >> Debug Features 0 =3D <2 CTX BKPTs,4 Watchpoints,6 = Breakpoints,PMUv3,Debugv8> >> Debug Features 1 =3D <> >> Auxiliary Features 0 =3D <> >> Auxiliary Features 1 =3D <> >> CPU 1: (null) (null) r0p0 affinity: 0 >> CPU 2: (null) (null) r0p0 affinity: 0 >> CPU 3: (null) (null) r0p0 affinity: 0 >> ............ >> In a top window, STATE is reported as RUN, rather than the >> former CPUn. >>=20 >> Is a software switch now required to enable multiprocessing? >>=20 >> Or, could it be related to the lines: >> psci0: PSCI version number mismatched with DT=20 >> as pointed out by Mark M in reference to the cpu_reset failed >> problem, which is still manifest?=20 >>=20 >> The kernel is at r357644. >=20 > Head -r356767's kernel does not have this problem for RPi3/4 used as > aarch64 FreeBSD. >=20 > Head -r356776 and later all have this problem for both RPi3 and RPi4. >=20 > Note: There are no head versions between those. >=20 > The console log shows evidence of the problem much earlier. > Instead of saying: >=20 > psci0: on ofwbus0 > psci0: PSCI version 0.2 compatible >=20 > (once) it says: >=20 > psci0: on ofwbus0 > psci0: PSCI version number 0 mismatched with DT, default 2 > device_attach: psci0 attach returned 6 >=20 > (and those 3 lines repeat in various places) for which none of > them show up for -r356767 . >=20 > Without identifying and using PSCI, the extra cores will not > start and the cpu(s) will not reset. (PSCI is the ARM interface > for doing such things.) >=20 > I've no clue why, but the version number it gets in my RPi4 > experiments is 0. My only guess is that at some point > memory important to ARM's PSCI operation has been touched > and is no longer valid for the PSCI operation. I've been doing some crude printf-based information gathering for RPi4B boots (based on head -r357529 just because it is convenient in my context) and I have learned some about the staging of when PSCI_FN_VERSION works vs. when it is no longer working. For the below text extraction from a boot . . . Lines with: "PSCI_FN_VERSION 2" are working cases. Lines with: "PSCI_FN_VERSION 0" are no-longer-working cases. . . . FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git = c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) uma_startup1 start: PSCI_FN_VERSION 2 uma_startup1 end: PSCI_FN_VERSION 2 uma_startup2 start: PSCI_FN_VERSION 2 uma_startup2 end: PSCI_FN_VERSION 2 VT(efifb): resolution 1824x984 module firmware already present! psci_fdt_get_callfn: method 'smc' psci_fdt_get_callfn: arm_smccc_hvc '0xffff0000008663b0' psci_fdt_get_callfn: arm_smccc_smc '0xffff0000008663c8' psci_init: PSCI_FN_VERSION 0 Starting CPU 1 (1) Starting CPU 2 (2) Starting CPU 3 (3) FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs random: unblocking device. uma_startup3 start: PSCI_FN_VERSION 0 uma_startup3 start: PSCI_FN_VERSION 0 . . . So sometime after uma_startup2 ends but before psci_init sets up the normal use of arm_smccc_smc things are messed up. My guess is that one or more of the kernel memory allocations ended up getting memory used by ARM's PSCI implementation and the content was invalidated for ARM's PSCI purposes. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)