From nobody Fri Jun 30 11:15:28 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 4Qst673smyz4kVns for ; Fri, 30 Jun 2023 11:15:43 +0000 (UTC) (envelope-from sfaisal@juniper.net) Received: from mx0a-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 4Qst665J9Tz3vQb for ; Fri, 30 Jun 2023 11:15:42 +0000 (UTC) (envelope-from sfaisal@juniper.net) Authentication-Results: mx1.freebsd.org; none Received: from pps.filterd (m0108159.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35U9j4Vp006227; Fri, 30 Jun 2023 04:15:41 -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=Toq5PV2fl9HmmUWdfUJhtIdy2BJpXTWoFybGj38zfO4=; b=IozHtSVawDsQDvzupZEzKrmveVibuRI2Tm8fKgmiyLXjKhyhCA372+i37LGTYviDsBrb /8pkQTyVAVfOmhpCbCFqSde0dRuqFVoh2S5sQTgmXM4/qTMBnyrB6dWF6B2q4HZMp4tp lQ4SERL3JYWiHYnlv1hVxSma7sLs3N94RVa10gauQxGS0y1oVXdp5hwvceJIvIXGu1yW zCo++AvDujaXMZFSjsdnr+LB+Jl2pAX38I5pmmH4GFrM/a6hjgx2Nnc1+dnBb5+W1Ycq 7XwLJtYs+V/wdde5M95SSPyRNxq6ikxtCegGlXXx1MlAK0fQNEtgace4IZ9lOMOO9iyV MA== Received: from mw2pr02cu001.outbound.protection.outlook.com (mail-westus2azlp17012026.outbound.protection.outlook.com [40.93.10.26]) by mx0a-00273201.pphosted.com (PPS) with ESMTPS id 3rhvpg04ut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 04:15:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dvlous/Da1T7hzl4X8D7LCarx/qghgBkNfbHdbgpLhz2OhNbVDsAXB/D0+dkDMBbWKLwA8dwaSdlTqFURdooH3gXGeqVs6SWwZJUbzcFGGNwnzcnBp7eNYONQCAHjRmaNZyoOiAjEEwerFhyzAgAF2lqJgFx2xtFV8ptKNnm48SXrUSpn+4Zrxo4267u1KH4oUY5d3JFvixFbMxdlYOlkeR2H+O7Ap5snFvh9pplJrwCSjjprqrNmczJO1JYCK+4XeQZhaIfCAPZjJ9KzWZP7PHpNBlQCntf5TJXnMtQOQIkOhWrwgKp7/YALPsextQRz3vkvyIKHi6NqJWoCM8/Qg== 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=Toq5PV2fl9HmmUWdfUJhtIdy2BJpXTWoFybGj38zfO4=; b=euWhHuDHXxem39W68K2reXp3PHZzRnpkPuHUhK5tyaabejiBc1fJqcBXESEtDagF+fgduaYkP5l1VKp2/m6B+96yBlRzJJZtfnxQ/odMQDCpwL644uANWNQevbOQV7bN4NsCSYpZBRWxmyVK92mIWIkQss7xGXqXwOoEjgoq2M+e9+lcy3iJ+kcHvXoHi49QV1QMbtpCzP6Z7xhrJlIlOrS6InS0a0mBuL8UISeU4dUlP/nSPaogcrsoKIXPrskiTfNwFgfEUZt21fsKbYZQcrJBM0V68zgR9sy6H5OGkeSwtGoDRkEjk+dQPEzHeFc8vacqvb0yfq78wL1AaO9JWA== 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=Toq5PV2fl9HmmUWdfUJhtIdy2BJpXTWoFybGj38zfO4=; b=ALz2Jlmqq0JMWjbUCLa/Sn1FDHxQHb2GhkvKveE90DqtGQCVcOKD1N/jJxcM40wSZ7Xkf7PzatY16IRDf+K5oy+rnsTv6zJzyC7g4V8mZWlkLyYHcUaQ7ah62K1FCkwB5CMAfaGUBeTc8nMHJU9f+0LtOLNIVPLnD5lIX+iSj20= Received: from BYAPR05MB6677.namprd05.prod.outlook.com (2603:10b6:a03:ec::28) by IA1PR05MB9792.namprd05.prod.outlook.com (2603:10b6:208:3f1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Fri, 30 Jun 2023 11:15:29 +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.6521.026; Fri, 30 Jun 2023 11:15:28 +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/gIAABIjO Date: Fri, 30 Jun 2023 11:15:28 +0000 Message-ID: References: <6537067F-670A-4B52-87FA-FF2DBAD68120@fubar.geek.nz> <1327534fa4a1da584a3a38b194999595@fubar.geek.nz> <2bf93ae22548705e689e0bdd47f9d7db@fubar.geek.nz> In-Reply-To: <2bf93ae22548705e689e0bdd47f9d7db@fubar.geek.nz> 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_|IA1PR05MB9792:EE_ x-ms-office365-filtering-correlation-id: 7fd64c03-861d-48aa-3878-08db795b4f4a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EIbsyMNFiPSFwFsDnQffFsG+1HHoqOEvW8KyrJW+SBJ+xZkeivtwYVWPHV9Mj9wMNc2pVUothv9Yp7w/IUp9F5efFTDEigKAGTF89e1/3ebsk7UdbquagwY5AO4rg+vzs+e7cHaNA0GNFL3aS/RxXNsDhtkT4TOiK9pWjN1dm+Wvm3z1MQLEm2KvoqIxRc2UIv+rl6CZTPUgl8TJljKb7lqrnea0/1MeKVJ+t/G0NDrzLLFnMvA1DRU/GBFW8GspbzlnfiiojOuUVCiSxdpLsyHwhcBsyPrFjCx3iv3as3dLpwB9jHOqVvKV+CN+5+cfFOwCGp7O0lVnEStwPD5Pzot3zJ/TLE1XdN6eHE50H/kJL0RiPBQcG2bz2Im6K7yqdCDwoSoba362/dN+NvvUu5u637LvZFhgbnrD/Cum9Jp6Id/l7sYSPqzhac9PFSQ0wDQ/9F371SJPYvYXVtQOjzhvsj8dN7I8mlQZmk7TaTr2Nuxdg5lgyC02v+aNnenWlOLnVamNTBzAde8/pgeny5v/isi0JEwIfXWuLIbO61loc734fVnd6bpt1Mii9jkdaH5x5Ny+bDo/yXwFDB+bu27wQYnEv5MCCbIfQxjellUamAlCQsqNoeWDeWkU9lq4SudDznzRtimDMPcL+1dB0pNg4fGZzX1H5+hIOHN9on4= 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)(396003)(376002)(346002)(366004)(136003)(39860400002)(451199021)(52536014)(86362001)(107886003)(54906003)(71200400001)(9326002)(8936002)(8676002)(5660300002)(110136005)(26005)(9686003)(6506007)(53546011)(33656002)(7696005)(478600001)(66946007)(66556008)(66476007)(66446008)(64756008)(6636002)(4326008)(41300700001)(76116006)(316002)(91956017)(186003)(38070700005)(2906002)(83380400001)(55016003)(122000001)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gZYD5lppc1KNhv0Zx/1oF+6EwOakRDdAyfdlK5sBm1+u/GBVKnUqDHJ8czdL?= =?us-ascii?Q?3cRPZ6ERAl+mZ41WzeeirMZ8Af3wdY6hFTMmtVx9HXXc2XDUqPY3/lK8IdG1?= =?us-ascii?Q?A97wFjLzJVpvlqSKV7W4lHdgvNneAVUen2ww2/UNQFPzEY24Cd+y9qGG+eh1?= =?us-ascii?Q?dNLDK1A4jutvacjnyDXMvhjEcb38fPz5zPcpUbuGb+OonFUlO6xTwo1vIxxs?= =?us-ascii?Q?1Y9Sk+c+JlcXUhJ3q7q9iRr/hU7HC7wGXrp5mRmBOqHbOC5VuO2uIQMfBC/n?= =?us-ascii?Q?3ozEyrrcf+Reruq3rjX5hshJqC/DvHGXCql4LKWcmFQtCwixGz5lv1s91Xrp?= =?us-ascii?Q?48i7V/aTL4r0Fd/nBezfgcBNjKA7VKQCzV2GPcMB9k8zRynLXzrcyCfeC4rs?= =?us-ascii?Q?6ckEcDPwtBh9Ry0QyEg5vIlAcWJJcGCMv4y2r/neW6ZBpdKMbM4ykWShxrdb?= =?us-ascii?Q?4eUj+NXlPm+DttqBpG1Ds0q7BOvxNORRwP/LsJjUzs1Sxt3TKVLOCh04Acag?= =?us-ascii?Q?Nxr3COz+szHKKbAtPWrveNs8x7Uq3RvmBhhJ5VA+ge9ari9d5huoXK102r6N?= =?us-ascii?Q?WUCK7ihCw439ekGkgAta7lR8SdJiQBZmJGCLqVJ0HbvMNZ0lj1J5KWY9+NDv?= =?us-ascii?Q?kosRefSCU4v+hNBGAUVoAdrijPyRjiuKYbgWM3ggeI3GIS4RLRhvy+5Q/Gdl?= =?us-ascii?Q?89hC36m8UpmVEv23WCPfkIFlIBuadixYTkSVhdqWn2CQxv2dv6DU/sN6seWr?= =?us-ascii?Q?+56Iu2eeMyvy4JubN4Cch7RIvMCfimddcX8pLJENYKXViL5LjlywJJJCgxzo?= =?us-ascii?Q?8NvYPOfncuPT1XniNuxh9GpjhJQscWTV6Yv5gpRp5txdjkcYT2mnxhpjwBNJ?= =?us-ascii?Q?a0qxjfasK54C0jy2Khx0nx7MIGEXvQ4+87pMUzMRpIXsGZbfbmnvdpyRScLj?= =?us-ascii?Q?IRegc+FUOqXDm+ZzzSBeLkwKi8hXuxM4Cw0L3wTWNfcBCOBdl8cK/Nbtkorh?= =?us-ascii?Q?53i8z2H/vTswfWa5s2BCpq7KTbE2Lw7n89EQ/RWF91frV8CZvcRrrRZujKOD?= =?us-ascii?Q?uDqwRABKEwvmrS/VW/OfOn31aVXqzxGfgZ0SJYeIcOQkOg5jDeleYofjbLIc?= =?us-ascii?Q?fFWHlT9yifZHHwXoh/IjFnMSlyjtWNXwLdk7myTlqr7Seg1pWl4uIs1xbbU9?= =?us-ascii?Q?H0eCUQ/Af9WypxFdUEG3RM8y/r4mKBHCDOOCuCLmbNiEMut4KWbU+/VG4hYV?= =?us-ascii?Q?cDFcmFPlgAt7kG76aTgomS7Ijy59MhmRIRyoobZbT7dlHn7CMMSY1Zu4GN6I?= =?us-ascii?Q?2yVgUveJ6cOG7AGwHC3YF9hldMHra4pHxblb4AbU7JqREbAGKzptCg5L+Let?= =?us-ascii?Q?c+KUEqRynzNiRoGF1bJiPDvVgbI1Y/jOZABoDW+GIooqSQJaoMRayC6977Mt?= =?us-ascii?Q?tWvJZbc0w2EptJZf4vDxR8pzPuD1lP86rlYOIn4CtYPvtI7Wi3u1LDEXQVeV?= =?us-ascii?Q?noSXAMnEVxN9tPiY6VntC29mFQ5x+ofuRn3ewG7HqNvT6U8Iu6RU9e8nAqTi?= =?us-ascii?Q?Ro21F3a4jXmsG6aCOFN9B0w9rdpfIGcHWo8CqpsR5ZtF9OR9D7OrRnKqtT/w?= =?us-ascii?Q?dQ=3D=3D?= Content-Type: multipart/alternative; boundary="_000_BYAPR05MB6677D1BF2C336E91D1DAFEABB72AABYAPR05MB6677namp_" 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: 7fd64c03-861d-48aa-3878-08db795b4f4a X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jun 2023 11:15:28.1730 (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: Sx4ytN4oNF2J6FHivOz1DMz7R+11pHQIqtGc21pSEayZsHM831Q6vX1KxqZ6j2Y2oL8iITI6WLlWMNRGhKSkrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR05MB9792 X-Proofpoint-GUID: FsECvivzMwSDtUqcuW3dlUbMx8ZCMdaQ X-Proofpoint-ORIG-GUID: FsECvivzMwSDtUqcuW3dlUbMx8ZCMdaQ 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-06-30_05,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 spamscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 impostorscore=0 phishscore=0 adultscore=0 mlxscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=905 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300095 X-Rspamd-Queue-Id: 4Qst665J9Tz3vQb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:26211, ipnet:208.84.65.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --_000_BYAPR05MB6677D1BF2C336E91D1DAFEABB72AABYAPR05MB6677namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 Juniper Business Use Only 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_BYAPR05MB6677D1BF2C336E91D1DAFEABB72AABYAPR05MB6677namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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

 

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<= /o:p>

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

 

 

 

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

 

 


Juniper Business Use Only

From:
andrew@fubar.= geek.nz <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_BYAPR05MB6677D1BF2C336E91D1DAFEABB72AABYAPR05MB6677namp_--