From nobody Tue Jul 4 16:32:59 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QwSyW12n5z4lXRh for ; Tue, 4 Jul 2023 16:33:07 +0000 (UTC) (envelope-from sfaisal@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QwSyV1kW5z3Bn3 for ; Tue, 4 Jul 2023 16:33:06 +0000 (UTC) (envelope-from sfaisal@juniper.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=juniper.net header.s=PPS1017 header.b=GEm5e+Ce; dkim=pass header.d=juniper.net header.s=selector1 header.b=djYtqJHO; spf=pass (mx1.freebsd.org: domain of sfaisal@juniper.net designates 208.84.65.16 as permitted sender) smtp.mailfrom=sfaisal@juniper.net; dmarc=pass (policy=reject) header.from=juniper.net; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0108157.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 364E7vus021535; Tue, 4 Jul 2023 09:33:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=PPS1017; bh=++F/YXQ2MqMjsclSffaAllgNGjYshBRWam7yaX+4kf4=; b=GEm5e+CeMgLg29FU/L0YDghvhDG6FXD52Sh2ot8TSO8+qM+/sJdoPknr11OUEF0N1tkj cbVSnfCwe8iOTKpC7jtbkY1SkfTd4yl1Fz1D73r4onGrFvc09FbNz74Bte1oe/fpPVpJ /K0zeMN9p4SDfwx/UbSEgohJuDcakKLN7xrsI7ehxx7wYkGP1k/Ocxki4TknVwgMbQSD xU9oY+aV4H44iLovGnDEAVjUWOb1i1mjk9XJegEv52VhkWAn4yT339AYgGsQ6h/9jPTy 6vngNs5zmO25rbk/uI+SswMG+FtKBumQWsev7X3iFY+Zy0nMtmYqP/8WDXUe9Qhv+874 7Q== Received: from co1pr02cu001.outbound.protection.outlook.com (mail-westus2azlp17011012.outbound.protection.outlook.com [40.93.10.12]) by mx0a-00273201.pphosted.com (PPS) with ESMTPS id 3rm1b0a1jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Jul 2023 09:33:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KxM/coIEVvm8/nzWy6kb11vZgkusiwbHIR/PfIp7Y7BTtZ9DX0GbjBY8WW6jDfsT43O0N1oZv0P7EdmHjQHw76uYZqZdMYfXo3MklwkWGrZEJHXGQPA6LVARnpZOrNSnqszjAEGC+6L7A0Rro/ZyELMdcQpDGikLrLYWFJ1WAhEzFzn+B7NXIXdW/ZFz9DgphnuAlWrbt5p2RXmJDSnMn9Ss3QLddaGiVR8B5rGM0pwrH8vFe2sCXA08BQ3QRqRMzj4D1z8gEs01FPXHQmy/FuqSMbn/4ykwsd+tdr8fXJvtbjkJ6WF14qoNLihGxMJZM2f9qKIhcY+KiL5ljumhEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=++F/YXQ2MqMjsclSffaAllgNGjYshBRWam7yaX+4kf4=; b=lSE70erjTg2pU5vMoGQF3PFvBa/rLBP8HEbIAZuT2KAQSXpE0393bCAimNn0E8sG0M8Tz+3tsqN/wDK7ji4ydfL8bGpQ1AdZUtGQOS34KUsxXlSiD/uZl+5bAJsW3TMGJ1Zfxf+pT94HO8De2hFUWUwW2Jp1aHbV1lqBgmHl6fYSAR0EF1R66cNrJPT1IaUIkmXQEtoLjwUfYHtWsJ3VbEFv80MC/dMZRyd6qyoVIX6xSz9UxOep2vSfHPkZ5wW+RIJBwdtx5+K3YBta6HjtQOUVgnbo+CadpVqNYmqqCmPkVoRo6C1srAS2ZM8JMLcCH/B1T91ENf8g4WKKpABqZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=juniper.net; dmarc=pass action=none header.from=juniper.net; dkim=pass header.d=juniper.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=++F/YXQ2MqMjsclSffaAllgNGjYshBRWam7yaX+4kf4=; b=djYtqJHOA0ZqHo/hX01m6O/H/bYLXGJrzwiVq+RvDO0TTXOaEd9Jzekau2SUwU6EHw3TFN6twN7kMED8ZuiqNTOe0Azowt0EMZ90ePyIAUwSVxP4j8HABS1fVQNfYoZSpw0nSdYbgsYraKSVtUEEF2ny7T7sjV/2iH+hEXT21dU= Received: from BYAPR05MB6677.namprd05.prod.outlook.com (2603:10b6:a03:ec::28) by CO6PR05MB7524.namprd05.prod.outlook.com (2603:10b6:5:351::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Tue, 4 Jul 2023 16:33:00 +0000 Received: from BYAPR05MB6677.namprd05.prod.outlook.com ([fe80::65c0:5c8:b916:d4e1]) by BYAPR05MB6677.namprd05.prod.outlook.com ([fe80::65c0:5c8:b916:d4e1%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 16:33:00 +0000 From: Sha Faisal To: "andrew@fubar.geek.nz" , Mahesh Vardhamanaiah CC: "freebsd-arm@FreeBSD.org" , Steve Kiernan , Amit Verma Subject: Re: Kernel crash before login prompt Thread-Topic: Kernel crash before login prompt Thread-Index: AQHZqYguFdDezJe7q0OItnaHAyE0G6+gIhyygAAx4gCAADjn4YAA/1uAgAA2tE2AABtLgIAAA7fpgAAE8QCAAAatgIAAHk8CgAEPZxCAABR/gIAABIjOgAahl4o= Date: Tue, 4 Jul 2023 16:32:59 +0000 Message-ID: References: <6537067F-670A-4B52-87FA-FF2DBAD68120@fubar.geek.nz> <1327534fa4a1da584a3a38b194999595@fubar.geek.nz> <2bf93ae22548705e689e0bdd47f9d7db@fubar.geek.nz> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-IN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_0633b888-ae0d-4341-a75f-06e04137d755_Enabled=True;MSIP_Label_0633b888-ae0d-4341-a75f-06e04137d755_SiteId=bea78b3c-4cdb-4130-854a-1d193232e5f4;MSIP_Label_0633b888-ae0d-4341-a75f-06e04137d755_SetDate=2023-06-30T11:11:59.7583418Z;MSIP_Label_0633b888-ae0d-4341-a75f-06e04137d755_ContentBits=0;MSIP_Label_0633b888-ae0d-4341-a75f-06e04137d755_Method=Standard x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR05MB6677:EE_|CO6PR05MB7524:EE_ x-ms-office365-filtering-correlation-id: 4b76324f-bd62-426f-237c-08db7cac5480 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MwjeH03dlFsetYOIzXTeqoDR/5J3v/+9SC6ZgqabrNQZoFgEVbkAHl0bCePcFM2CDNMvsqI1uIoheSvB9UtuhoHkwz2NL2wVCa+rVo4T1xOZmbTMCFfIlE347XXJtdw51rQvuYS33f7e+CW+XeYpqzTYCQFN97Xe2PQznP1D22rPdoW8uiJ4x75kbG7jnmjnREfFKiytfENW/KRQePtk5h0oPWj0Wi4LtVtbkrfFLhcjt45wVrPECA/lMBm3Kp1ACl3tJJhqm8SNjKVfxsFcHwRDZWGEF2s2mHmC/kWbUUzWZBRagiD/CzfOnEostpAnyQ4eI8KEdJ7b5J3va2m/6rK0oo3+bELyOaCMrVl1VykvI8iu9QIeo6fGkgn0KHbsG2rlPDAnmlZ83StaMwZz3U+ncIbOR1E7gTrxPWdxvsApzD1R3uJh5uRgjnmbm8BfUziL2yleU+EwLuw1Rs4j1X8cQ6CmPaiAg5uXRTcMGTQRNp8uDzsWwjOnKA29RHoAXrVbthzFjSL85wrCCjmJ6SB+MFUJriZjg5RLvMXGbTPBGIzN7yhdtIzLSPi/TaxDBElzHX71Rvxb14SiuClkflDtqxKHvI0Dv/53XPXvo7sGiigREixmtoiO//7sSuHl2SD6v8FAh9ExVQVTBAWK2Nbqm/KCvNFc72Xh2d0e+XE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR05MB6677.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(376002)(136003)(396003)(39860400002)(451199021)(91956017)(6636002)(4326008)(64756008)(66476007)(66556008)(76116006)(66446008)(66946007)(122000001)(38100700002)(107886003)(86362001)(38070700005)(186003)(26005)(6506007)(53546011)(9686003)(83380400001)(33656002)(478600001)(71200400001)(7696005)(55016003)(110136005)(54906003)(41300700001)(9326002)(8676002)(8936002)(52536014)(5660300002)(2906002)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?61eBIILNmmzHU89xImt8zXiPogezVvNLHctK4ItLtLXWqwDLscssV2u84UNw?= =?us-ascii?Q?EBZNYqLRggohkzTR49CEwBW6KF17dZ/81NidBZcyjtAI4HJxijriAJJDcClP?= =?us-ascii?Q?dfxW60qRkuFZkNb1t3CBXF7ys3vhOY8s6XW2KrcZ5NC3DMOCwlTlBaDMDajc?= =?us-ascii?Q?K9kQyDIuEVCgold37jkD4dTVGsvB6KiTMh8lgBxy7uCgGk/JntAR++cx7qTz?= =?us-ascii?Q?8r/ZSSPKNQcqJWQkaQBOuRGONa4wO98nhe0a8I50vlKL+wJIBi6IPiNO0Ecs?= =?us-ascii?Q?BSfVR8FHk5So8Kc8EF3UuX+9mH999PT7ZcvOq2RX0s0IPWN28qtxwdEcpx5m?= =?us-ascii?Q?SD+TEOh88uKb283y1ptLvXiHd2eSCxtDPl5n+Jh4LnL8fbI4oFBUMa/xk8aa?= =?us-ascii?Q?esn8IEoNlEhDOMMK+NT4hvdpRU6z1HfkkKfOnwgQum6y13SzQwD05RuD1zos?= =?us-ascii?Q?7xJYMJVaeArW+jUL0N7oJlyYxH5wLWqKRHDdJTYxb/zWhLO+k9/7oFLxBil0?= =?us-ascii?Q?PdDo7SqNDvcEyS+Fz/V1dH4/PKhFS7qHdozqL385suOl5kXvvLYDDHICTCKY?= =?us-ascii?Q?KmOlHCTHD2Fv1LWPLh20b39g0UKWoqAii59y1H2vEGygmPaV7Pp99/JUwLEE?= =?us-ascii?Q?A7kZHTAh1iT28bF0njlRGdQSgAA1hnrm6jeA5nRUkgK4odKlE+pPraO/OcJd?= =?us-ascii?Q?d/rePXnM9weVHjdearFTtJDJLm2qMp4L3juXQq/NVxK8mmh/1C8xCClCpWL0?= =?us-ascii?Q?B0Dfe3DpNKU+Wwoz4ZG4ZaafdYPcLGbFrLgdouFliQLRo7voUWeMNYhxckIL?= =?us-ascii?Q?xnTlrCfS+Ot4lfDgqjhi03bnnWg6u4C16wFJon01T+wMNSTUKRKmSU3Nn491?= =?us-ascii?Q?QbfAyAULnBmSJpMtSULGjReOgHwVeOQ+DMKbEA1oR3qXBSp+BzKkeDJqicWt?= =?us-ascii?Q?SbGr4R/fPtu/U+BQrjWybJiCYVLVORwtYcRgj0DYI9pTOV3xgAIcvGKqMiVG?= =?us-ascii?Q?UEB1BYPoWScfawNPpuLrkO+Ys1n7TUrt4rLNxKETnDAlLLIFItek7/di8uCH?= =?us-ascii?Q?h/rMoEQlpv0wd0v1DgI3+MkSCyYUSSVn/wyDirt1AwcNMiHlDZdO3YnkQD6l?= =?us-ascii?Q?ibbHEKKawJqexPZf9JITRYGQmR0tyNisz9m6jmhQrVrOh9gPQWLBkLWU8Dec?= =?us-ascii?Q?wNT6o4ZRNvkshUxQMMb1EBJbWAgU+uVk4qB/aIgUrcu8/CWTD1RvqAXtBCz8?= =?us-ascii?Q?EovND4PKW/pn1bnYKaCHjrA38Y31ZJMaYkZ+W0qjE7TRVIxn/xgd2Px8p+Oa?= =?us-ascii?Q?MSfNKBi04Elw38pw6rcgstNmiOuwN+rZcqV0PLaUSTPPh06ykwhMjGxTr5d1?= =?us-ascii?Q?1USIPU7u30R07xk5g8TCqS4mgXrBsJjp+d/gFcsCOBMUHB2LUDfO82Sc9qWY?= =?us-ascii?Q?H1KKFtCjlGokHZt4gZHqXc7i/e/02nvScMqQq9N0cBFvjviaY3o65S9tg1EU?= =?us-ascii?Q?YT1pQSFql/LOwbGNqEZ2JBu655Wcw+3kJ8NtkVpmu41PfVkufOx1UVunAT9p?= =?us-ascii?Q?E2IoFEuCCzPKb5N32cUq5Q1XI+zcLZb1GcefhIdUkwERDo1OVuItA9xEknPi?= =?us-ascii?Q?HA=3D=3D?= Content-Type: multipart/alternative; boundary="_000_BYAPR05MB667729839AB0CF24294B14F5B72EABYAPR05MB6677namp_" List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR05MB6677.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b76324f-bd62-426f-237c-08db7cac5480 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2023 16:32:59.6515 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lotlAOlN4fW2xpuNPUCOnl8FYfFw4EF/9OwH8brsh5scKnt4UQtwmI5pNxy4TK2fqHm+hX+L5dqIFjV/BASqVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR05MB7524 X-Proofpoint-ORIG-GUID: yFyBGfcdJ4I_-4sJ_DzHt0XGryLVYA6g X-Proofpoint-GUID: yFyBGfcdJ4I_-4sJ_DzHt0XGryLVYA6g X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-04_10,2023-07-04_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 priorityscore=1501 mlxlogscore=999 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307040143 X-Spamd-Result: default: False [-5.04 / 15.00]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.973]; NEURAL_HAM_MEDIUM(-0.97)[-0.968]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; R_SPF_ALLOW(-0.20)[+ip4:208.84.65.16]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017,juniper.net:s=selector1]; RCVD_IN_DNSWL_LOW(-0.10)[208.84.65.16:from]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; ASN(0.00)[asn:26211, ipnet:208.84.65.0/24, country:US]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[juniper.net:+]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_NONE(0.00)[40.93.10.12:received]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_SOME(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[] X-Rspamd-Queue-Id: 4QwSyV1kW5z3Bn3 X-Spamd-Bar: ----- X-ThisMailContainsUnwantedMimeParts: N --_000_BYAPR05MB667729839AB0CF24294B14F5B72EABYAPR05MB6677namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Andrew, Can we have a short discussions on the below issue. We are not able to debug further. Please let me know your time zone and convenient time. Regards Faisal Juniper Business Use Only From: Sha Faisal Date: Friday, 30 June 2023 at 16:45 To: andrew@fubar.geek.nz , Mahesh Vardhamanaiah Cc: freebsd-arm@FreeBSD.org , Steve Kiernan , Amit Verma Subject: Re: Kernel crash before login prompt Hello Andrew, Below is the disas of sched_pickcpu() /b/sfaisal/stable_main/src/sys/kern/sched_ule.c: 1325 { 0xffff000000223724 <+0>: sub sp, sp, #0x90 0xffff000000223728 <+4>: stp x29, x30, [sp, #48] 0xffff00000022372c <+8>: stp x28, x27, [sp, #64] 0xffff000000223730 <+12>: stp x26, x25, [sp, #80] 0xffff000000223734 <+16>: stp x24, x23, [sp, #96] 0xffff000000223738 <+20>: stp x22, x21, [sp, #112] 0xffff00000022373c <+24>: stp x20, x19, [sp, #128] 0xffff000000223740 <+28>: add x29, sp, #0x30 1326 struct cpu_group *cg, *ccg; 1327 struct td_sched *ts; 1328 struct tdq *tdq; 1329 cpuset_t *mask; 1330 int cpu, pri, r, self, intr; 1331 1332 self =3D PCPU_GET(cpuid); 0xffff000000223744 <+32>: ldr w19, [x18, #60] 0xffff000000223748 <+36>: mov w21, w1 0xffff00000022374c <+40>: mov x20, x0 Also, below is the show allpcpu log db> show allpcpu Current CPU: 0 cpuid =3D 0 dynamic pcpu =3D 0x2886100 curthread =3D 0xffff0000008166a0: pid 0 tid 100000 critnest 1 "swapper" curpcb =3D 0xffff00000068bb40 fpcurthread =3D none idlethread =3D 0xffff000041b82000: tid 100003 "idle: cpu0" spin locks held: cpuid =3D 1 dynamic pcpu =3D 0x41393300 curthread =3D none curpcb =3D 0 fpcurthread =3D none idlethread =3D 0xffff000041b81880: tid 100004 "idle: cpu1" spin locks held: cpuid =3D 2 dynamic pcpu =3D 0x4139e300 curthread =3D none curpcb =3D 0 fpcurthread =3D none idlethread =3D 0xffff000041b81260: tid 100005 "idle: cpu2" spin locks held: cpuid =3D 3 dynamic pcpu =3D 0x413a9300 curthread =3D none curpcb =3D 0 fpcurthread =3D none idlethread =3D 0xffff000041b80c40: tid 100006 "idle: cpu3" spin locks held: Regards Faisal From: andrew@fubar.geek.nz Date: Friday, 30 June 2023 at 16:26 To: Mahesh Vardhamanaiah Cc: Sha Faisal , freebsd-arm@FreeBSD.org , Steve Kiernan , Amit Verma Subject: Re: Kernel crash before login prompt [External Email. Be cautious of content] On 2023-06-30 10:48, Mahesh Vardhamanaiah wrote: > Hi Andrew, > > We are observing that self is getting -65536 at line 1329 in > sched_pickcpu() before panic. What is the disassembly around reading the cpuid? It looks like it is getting 0xffff0000 when it should be zero. > > From the code flow > > sched_add [1](struct thread [2] *td [3], int flags [4])-> > sched_pickcpu()->PCPU_GET > > as below > > static int > > 1321 [5] sched_pickcpu [6](struct thread [2] *td [3], int flags [4]) > > 1322 [7] { > > 1323 [8] struct cpu_group [9] *cg [10], *ccg; > > 1324 [11] struct td_sched [12] *ts [13]; > > 1325 [14] struct tdq [15] *tdq [15]; > > 1326 [16] cpuset_t [17] *mask [18]; > > 1327 [19] int cpu [20], pri, r [21], self [22], intr; > > 1328 [23] > > 1329 [24] self [22] =3D PCPU_GET [25](cpuid [26]); > > PCPU_GET is defined differently in Freebsd14 compared to Freebsd12 but > I am unable to dump the pcpup in db> prompt is it proper ? > > Is it expected to be a global ? You can print all pcpu structs with "show allpcpu". Andrew --_000_BYAPR05MB667729839AB0CF24294B14F5B72EABYAPR05MB6677namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello Andrew,

 

Can we have a short discussions on the below issue.

We are not able to debug further.

 

Please let me know your time zone and convenient time.

 

Regards

Faisal

 

 


Juniper Business Use Only

From:
Sha Faisal &l= t;sfaisal@juniper.net>
Date: Friday, 30 June 2023 at 16:45
To: andrew@fubar.geek.nz <andrew@fubar.geek.nz>, Mahesh Vardha= manaiah <maheshmv@juniper.net>
Cc: freebsd-arm@FreeBSD.org <freebsd-arm@freebsd.org>, Steve K= iernan <stevek@juniper.net>, Amit Verma <amitv@juniper.net>
Subject: Re: Kernel crash before login prompt

Hello Andrew,

Below is the disas of sched_pickcpu()

 

/b/sfaisal/sta= ble_main/src/sys/kern/sched_ule.c:

1325  &nb= sp; {

   0= xffff000000223724 <+0>:     sub     sp, sp, #0x90=

   0= xffff000000223728 <+4>:     stp     x29, x30, [sp= , #48]

   0= xffff00000022372c <+8>:     stp     x28, x27, [sp= , #64]

   0= xffff000000223730 <+12>:    stp     x26, x25, [sp= , #80]

   0= xffff000000223734 <+16>:    stp     x24, x23, [sp= , #96]

   0= xffff000000223738 <+20>:    stp     x22, x21, [sp= , #112]

   0= xffff00000022373c <+24>:    stp     x20, x19, [sp= , #128]

   0= xffff000000223740 <+28>:    add     x29, sp, #0x3= 0

 <= o:p>

1326  &nb= sp;         struct cpu_group *cg, *ccg;

1327  &nb= sp;         struct td_sched *ts;

1328  &nb= sp;         struct tdq *tdq;

1329  &nb= sp;         cpuset_t *mask;

1330  &nb= sp;         int cpu, pri, r, self, intr;

1331

1332  &nb= sp;         self =3D PCPU_GET(cpuid);=

   0= xffff000000223744 <+32>:    ldr     w19, [x18, #6= 0]

   0= xffff000000223748 <+36>:    mov     w21, w1

   0= xffff00000022374c <+40>:    mov     x20, x0

 

 

 

Also, below is the show allpcpu log

 

db> show allpcpu
Current CPU: 0

cpuid        =3D 0
dynamic pcpu =3D 0x2886100
curthread    =3D 0xffff0000008166a0: pid 0 tid 100000 critne= st 1 "swapper"
curpcb       =3D 0xffff00000068bb40
fpcurthread  =3D none
idlethread   =3D 0xffff000041b82000: tid 100003 "idle: cpu0&= quot;
spin locks held:

cpuid        =3D 1
dynamic pcpu =3D 0x41393300
curthread    =3D none
curpcb       =3D 0
fpcurthread  =3D none
idlethread   =3D 0xffff000041b81880: tid 100004 "idle: cpu1&= quot;
spin locks held:

cpuid        =3D 2
dynamic pcpu =3D 0x4139e300
curthread    =3D none
curpcb       =3D 0
fpcurthread  =3D none
idlethread   =3D 0xffff000041b81260: tid 100005 "idle: cpu2&= quot;
spin locks held:

cpuid        =3D 3
dynamic pcpu =3D 0x413a9300
curthread    =3D none
curpcb       =3D 0
fpcurthread  =3D none
idlethread   =3D 0xffff000041b80c40: tid 100006 "idle: cpu3&= quot;
spin locks held:

 

Regards

Faisal

 

 

From: andrew@fubar.geek.n= z <andrew@fubar.geek.nz>
Date: Friday, 30 June 2023 at 16:26
To: Mahesh Vardhamanaiah <maheshmv@juniper.net>
Cc: Sha Faisal <sfaisal@juniper.net>, freebsd-arm@FreeBSD.org = <freebsd-arm@freebsd.org>, Steve Kiernan <stevek@juniper.net>, = Amit Verma <amitv@juniper.net>
Subject: Re: Kernel crash before login prompt

[External Email. Be= cautious of content]


On 2023-06-30 10:48, Mahesh Vardhamanaiah wrote:
> Hi Andrew,
>
> We are observing that self is getting -65536 at line 1329 in
> sched_pickcpu() before panic.

What is the disassembly around reading the cpuid? It looks like it is
getting 0xffff0000 when it should be zero.

>
> From the code flow
>
> sched_add [1](struct thread [2] *td [3], int flags [4])->
> sched_pickcpu()->PCPU_GET
>
> as below
>
> static int
>
>  1321 [5] sched_pickcpu [6](struct thread [2] *td [3], int flags = [4])
>
>  1322 [7] {
>
>  1323 [8]         struct = cpu_group [9] *cg [10], *ccg;
>
>  1324 [11]         struct= td_sched [12] *ts [13];
>
>  1325 [14]         struct= tdq [15] *tdq [15];
>
>  1326 [16]         cpuset= _t [17] *mask [18];
>
>  1327 [19]         int cp= u [20], pri, r [21], self [22], intr;
>
>  1328 [23]
>
>  1329 [24]         self [= 22] =3D PCPU_GET [25](cpuid [26]);
>
> PCPU_GET is defined differently in Freebsd14 compared to Freebsd12 but=
> I am  unable to dump the pcpup in db> prompt is it proper ? >
> Is it expected to be a global ?

You can print all pcpu structs with "show allpcpu".

Andrew

--_000_BYAPR05MB667729839AB0CF24294B14F5B72EABYAPR05MB6677namp_--