From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web08.6.1626147846633513140 for ; Mon, 12 Jul 2021 20:44:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=TGz/PeyB; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10043"; a="190471365" X-IronPort-AV: E=Sophos;i="5.84,235,1620716400"; d="scan'208";a="190471365" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 20:44:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,235,1620716400"; d="scan'208";a="412812968" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga003.jf.intel.com with ESMTP; 12 Jul 2021 20:44:03 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 12 Jul 2021 20:44:03 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Mon, 12 Jul 2021 20:44:03 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Mon, 12 Jul 2021 20:44:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TVQ/mVMvAI3anrCCBfyutU4ZZ3Id++gQGypQdv4rdfN6fwtlgtta93KAzApbcxjq40VGw01bLkUBd4s/XW8W9frKfYgKJeDKVDooPvnKyKhP3mj/7X70Jwy61eNjCWcndiNqNVeO+9FLWsnevOGpOYgwuJuKnMrtq23GfmaRG+fmo3V8vjYUYpZ9FnkucVB+IYf3dyve/otDdc/kmYTkiNC8WRQRXZmJUS5YO8J1zzMjRCRhhLL50lZdVmeUzWGo4P+eTqdUJZA4g5mMEu5mi8sEflaAfVVjfvrn/+Kk5ZqkMzgz4vyeQo99cIf4EkdJpgM5u7rQ5MFte+2HJc9dzw== 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-SenderADCheck; bh=VORHb0tKX/kudnU90H3Pr2IZpCncgiUClrM1oHRsfTY=; b=f9uRUF5ZHKCFJGy620HKeaM9RiZaCmiCNGlwIV2cIBf4f2YPojm1oMMvrmQ5wAB9BP5ogs99UC4DcEEqGf6EzFwOtweVTKtCvSl9pQ3MSHxHK/HMHx4Co4JVfQTPUuPZ4v4u6vWg81f2ZPI8S8uK9FJBRF5g6tLW04juJM0BhQEwxiHvS6cJLKJEh7MRv9/wkvpB4ATNvbERJk7h7k1aiJBCQ1zlClNpcM8Z0mc3UqBsj4fmd91dleYGd62P3nTQXjhkmLHCLKrJFQEl1ktO1yUkcKVnmdNgtKVTRvb1qeairzJlvgcArqJ0FCH6UKf+BG/zWD1xFmLv5r2T239RGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VORHb0tKX/kudnU90H3Pr2IZpCncgiUClrM1oHRsfTY=; b=TGz/PeyBJmbuks9NGTdv3+npDHqo79wtQuAYF8lsCsaB72KvYDmNNWqqgtKzLX7OGf6ytlvJ7QUseROzRl0Pd4mofOBV1fEn2XQjCNOK5OXr2XqKOJmkfbwJzUxwAJqxmG3miCDfjlABO7BIK1WPJRxIRoyORoR3nTMMie24PgM= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB1955.namprd11.prod.outlook.com (2603:10b6:404:100::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Tue, 13 Jul 2021 03:44:02 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d%5]) with mapi id 15.20.4308.027; Tue, 13 Jul 2021 03:44:02 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "daniel.schaefer@hpe.com" CC: Trammell Hudson , "Wang, Jian J" , "Ni, Ray" , "Gao, Zhichao" Subject: Re: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol Thread-Topic: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol Thread-Index: AQHXd4PucFVAYTDvyU+YrkPiZkuTb6tAQk+w Date: Tue, 13 Jul 2021 03:44:01 +0000 Message-ID: References: <20210713010931.445739-1-daniel.schaefer@hpe.com> <20210713010931.445739-2-daniel.schaefer@hpe.com> In-Reply-To: <20210713010931.445739-2-daniel.schaefer@hpe.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4d23db3a-c1bc-45a1-9eaa-08d945b07492 x-ms-traffictypediagnostic: BN6PR11MB1955: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: piba/XTkW47C/AgDSscDxJiekX0OWGI3NhQU7N0XUq/OF1XkgphBJOnXfzwy3QGVM87QVIBiLVBQx1mLV1pjgAf2oRDTED2qbOQHQB8/P1ov9ttfkzcB+SSnW6ovZdQ/Kaiq/buYxXCCrZdmLKiIO0NcZqv4NVKFgp57t7zeYwOVKPo3JnKA5nF86nlppC6F0nf9ZapukqZ9WoBvyRF/ghL5fIlFEVBs7Ne1mN9h7HtPMT+T1/nN16loCqqlhQi0rMl13k6UVengoLBqVf9x+c3HuTegkh3CKoPsYICNKYYCEeWF4IdeWVgE8ymQOuEXFbvXhwRD1aeMhhTfWAAvJistnL5IQQlKrEiQb4o2sMOKAFnXZkkfZlp7ThUGBH+QwHelFvntyjXL/9fuDrfN8upwMV0pbjcxbcTRUjzDCFH+H3KNHguLdl1out0FnCEsODcAT7y+c7zIrbeKA49uhAAzDkgWadnRaGLTdti9PnpF1ePu8M8BDLa4hctcDYu1JzTgr8GM7Kzz1wviw9MBw5QwzcItV+6q3pgSv6zaYMo9MNCTnxB4FiIadxzmj0M30+ACEBnCQVhxu6NwpcQFs4uvtRYjiMCTjslfjmg1RYJBcmFWyKsHSdiPukoKmyGFEIs30PoGPsQZRESQ45Q+ySRWGdXkgeYKmR01EVE/g5FVaCH/1pBi2r46K4cMPKdiDSkPW/UBmpQDYMGOBBtRX9RYOOI+WRppyQUWA2fw4ZR+6f8lf+LXMLSd5OVYa6rYCV+iXj7dQAJ7EGdMpgEnPw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(376002)(346002)(366004)(39860400002)(54906003)(66946007)(9686003)(110136005)(53546011)(6506007)(76116006)(478600001)(966005)(38100700002)(33656002)(83380400001)(7696005)(107886003)(52536014)(26005)(86362001)(66476007)(66556008)(66446008)(4326008)(5660300002)(8676002)(64756008)(8936002)(55016002)(316002)(71200400001)(122000001)(2906002)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HCFsPPo2EeDazCo7w7yn7jbJUO4RflP/KC2eAEvuJOUffTV1p94Zz+tAbGjX?= =?us-ascii?Q?m4bTi5Goqd7NOWm7paB3U2/haH3uNA44Q3RxivTT0V8Isp272/Fy3QnuoBBN?= =?us-ascii?Q?FEH7y0bk26BaU574b2qDSBDKD0Idd58LEZi23ZxL4I40lVBMjrIazlYNjXlh?= =?us-ascii?Q?LQKVNFn5XX4keS6pzusVW33VXVtmJ8BnTPJJtSeorfQtIUZMBWVT4Mafahb+?= =?us-ascii?Q?1m+ew4PJHWUKYvJ9lmSIXvMOWeh2Msn91KbEOYrotFXR8iXabxkKTENEJEu9?= =?us-ascii?Q?gjhhW6TwpXTwusd3BR7xC7Vg6+Sg18/SlxmzTWQWYvDjmMLbMJYIC5DLdOev?= =?us-ascii?Q?DCi46asGW0k/mctFaLX9eu5pczQwp3syZHTGLAWopFEnIWeReuGvon4WtIEZ?= =?us-ascii?Q?AWya/dc2s5U37O7YUUMj2IMvhj+8AMOTzVOoiPUuM2caG9HpTjpk86+D+ZWr?= =?us-ascii?Q?QQv8oesg5uHEdoKzxt3WpYX0Shb9KWHCSLT/tBkYF2l3LQWPhc4oJ8sinmz0?= =?us-ascii?Q?sfRTCv81h6eg05oT5W3JhuUfC69yXNaX0zAhiCpJ328raY/+pNyoqe6uvh+y?= =?us-ascii?Q?IvU+DXS1S/mXPapYPQnJDOBX+7i48CPVlVqNeWc6F3BpkJgyjMNMwmASmZQ2?= =?us-ascii?Q?FIWpAF+MSFxjNfJo9PsxHwuCgkzJQ9CJFQo/G2x3JjABcv7CqOuSW/HDMd/w?= =?us-ascii?Q?nKonGskywcHstmJ1/6nfzMvPVi1hxLWbSpiX4pLLTUk8JDnYooA0CecgxKJW?= =?us-ascii?Q?g1DeHb6G3ttR7gv976hL9H1TULyx1RW5rZPuiCNF7pbZgacGdA+Uy1zUHfjP?= =?us-ascii?Q?7grnOy8C8NNv50tHO9VAN/tDZTnKK6V3hA0sEt4MjhRNc8FGi8nmPjZaTBxq?= =?us-ascii?Q?2QrxJa/OCSGSAkVOQ8ulm8TDX9COmrD+PpLK6+c832N0awad5DUR77Gs6KSZ?= =?us-ascii?Q?xgqv0PIXKtkhGU5xXdbNcS1OMnfmq7EU1Ik6niCTZYXJq5ANcTkr9QxeSwrB?= =?us-ascii?Q?5XE4t0gampKYvnsyVxqq8bdGDqmgS2bhaKDOCz72B7rZzTeSU8tYwNYJSpmD?= =?us-ascii?Q?ycvEWlrTr0vKF07HeFHWFyz63beNsxBjxfU4nHOo5tm273hQWj1nG0OOi8uW?= =?us-ascii?Q?pRY9GUEajGPIxwVePx0dkyF6vA3oorkfyvALM87PscD6adH/JfzjA9J8bJE7?= =?us-ascii?Q?Ugj9rlQJ2L5N/+cQtvo/byTZXsmOIeDFN6pksciI6dw9r1/LtlsWkTifgVBQ?= =?us-ascii?Q?bYA6BuYvHeSIzAxphCNKnwMrE6r5rJ5t+WEoZ5jbVFn7Dr3W0VoqfGum+iIp?= =?us-ascii?Q?XvetbZykPHw0ojrvFpNY2yrI?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d23db3a-c1bc-45a1-9eaa-08d945b07492 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2021 03:44:01.6675 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PEUKAMYAWEB0Bdvw+Kj3WgkOM/xXq/h9fLpUqlRJBYHvvhpzZwkH1vWV50GecB+5z7M2MFOfQWp04Uaf2VF0Fg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1955 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Daniel > Schaefer > Sent: Tuesday, July 13, 2021 9:10 AM > To: devel@edk2.groups.io > Cc: Trammell Hudson ; Daniel Schaefer > ; Wang, Jian J ; Wu, > Hao A ; Ni, Ray ; Gao, Zhichao > > Subject: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head be= fore > registering RAM disk protocol >=20 > From: Trammell Hudson >=20 > This patch initializes the linked list RegisteredRamDisks in > RamDiskDxeEntryPoint before the registration of gEfiRamDiskProtocolGuid > with InstallMultipleProtocolInterfaces, allowing ramdisks to be created = via a > callback installed with RegisterProtocolNotify as soon as the protocol i= s > registered. >=20 > Without this, calling RamDisk->Register() in the callback causes a crash= : >=20 > ASSERT [RamDiskDxe] MdePkg/Library/BaseLib/LinkedList.c(75): List- > >ForwardLink !=3D ((void *) 0) >=20 > Signed-off-by: Trammell Hudson > Cc: Daniel Schaefer > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Zhichao Gao Thanks a lot for the fix. Reviewed-by: Hao A Wu I will modify the subject a little bit when merging: MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protoco= l Best Regards, Hao Wu >=20 > --- > MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11 ++++++- > ---- > 1 file changed, 6 insertions(+), 5 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c > b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c > index fcbf4f117dc6..13e2aed87cef 100644 > --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c > +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c > @@ -154,6 +154,12 @@ RamDiskDxeEntryPoint ( > goto ErrorExit; > } >=20 > + // > + // Initialize the list of registered RAM disks maintained by the > + driver // before installing the protocol // InitializeListHead > + (&RegisteredRamDisks); > + > // > // Install the EFI_RAM_DISK_PROTOCOL and RAM disk private data onto a > // new handle > @@ -170,11 +176,6 @@ RamDiskDxeEntryPoint ( > goto ErrorExit; > } >=20 > - // > - // Initialize the list of registered RAM disks maintained by the driv= er > - // > - InitializeListHead (&RegisteredRamDisks); > - > Status =3D EfiCreateEventReadyToBootEx ( > TPL_CALLBACK, > RamDiskAcpiCheck, > -- > 2.31.1 >=20 >=20 >=20 >=20 >=20