From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (APC01-TYZ-obe.outbound.protection.outlook.com [40.107.117.86]) by mx.groups.io with SMTP id smtpd.web10.36139.1683771780074438043 for ; Wed, 10 May 2023 19:23:00 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@insyde.com header.s=selector1 header.b=l2dU6uFz; spf=pass (domain: insyde.com, ip: 40.107.117.86, mailfrom: wendy.liao@insyde.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TZUkdYuOF/75T3J58rDziLw9GCxcotFt5R+rw4QsZNlIdIdpOVXKrn9x+MIW4zrO0udODD7W/frhJw+cC32Uo3ZktMELYttt+NdbwsH5F0AGc6zVLp9zyD53K8iKVmELjYrtJ+s+5tjFcz/30h2XAF5ufruGHAAk+a+M1Synf8fNciG7DjdMRdv3n889O/AP3o+zd1ptikc5iNulXLP8PE6NAx2qSJiXbEtiYSr4cPW4mKr/Ba/0uUJyarAz7FzkHeB1wkKBygmN0XqLk1HBbIJpnDK+/U+QvM9RrpVfKhYb4HRc82Oz+fr97/cT94nIOcudD1/2x7HPvELzbh/Tww== 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=R4E51wX6c2+0bCQe05TlpY0waO7FkKKncunU9EnG758=; b=gNfK2uCCXjy7YrNpwT346mO+H3+MCMFBRjA2uL3JzE9irToZSIfwK4VuiKUaTZIAQQHMnOADhNUlScNTMTrQYkeh/XeMDhZlgilxie8vY8HGu1VvAhKTjV7mh0Zk76H7aqig4WLy/9jbSnOweaBvW23lLZUl+NW7K/+L6PTa/vOlFm5dmuyE8a2Fd3UbZYUDh05FV04ThWJAYw6/5BaIyzm9L9cfCdzDHyxPaj3pQOehZZ5AF88AtGUzpuvwteCf4JBVOWRB8D67zUVbWNW19IGg2z9xhps0SBXmuRSSWbygfn4WIwRzlwOu2BTKVEzgkou/GCccLm8RjSF/MNy24A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=insyde.com; dmarc=pass action=none header.from=insyde.com; dkim=pass header.d=insyde.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=insyde.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R4E51wX6c2+0bCQe05TlpY0waO7FkKKncunU9EnG758=; b=l2dU6uFzN58BKUnasPL85cCurVSnQws2piIxDjT2MWA1KnZXWuRNj+nrPwJzz0BFZIXD6xBptYFAdyiB6iXzqmLiuc7igwjPTGDX5AJqCfrjGNydX+5wXDmIGc5iIVyjchdwTGUibWr2GI3Y9CRS24ABLdP5ouyp1hMtb20Na5STEfEH+Z5yFM383y/RRuFN1KpaBRq5UmPWOicMG+BrUi06d9vWGXSIAcfwJXw4iqceyiXGvuJaZPEapUWq+lApv1q1WVv5PiLgQA9pW8TYps42/g5kQWA8pWfRLES6TC3pgsmR+xNPeUUGqMhxSbLp8Qn4WasnDLyrM2Bc2qBn1A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=insyde.com; Received: from TY2PR02MB4446.apcprd02.prod.outlook.com (2603:1096:404:8008::11) by SEYPR02MB5487.apcprd02.prod.outlook.com (2603:1096:101:3f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.20; Thu, 11 May 2023 02:22:53 +0000 Received: from TY2PR02MB4446.apcprd02.prod.outlook.com ([fe80::dbd4:4017:1c57:23d7]) by TY2PR02MB4446.apcprd02.prod.outlook.com ([fe80::dbd4:4017:1c57:23d7%3]) with mapi id 15.20.6387.021; Thu, 11 May 2023 02:22:53 +0000 Message-ID: <50fc03ee-969b-49aa-3edd-e05c049c0b2e@insyde.com> Date: Thu, 11 May 2023 10:22:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: =?UTF-8?B?UmU6IOWbnuWkjTogW2VkazItZGV2ZWxdIFtQQVRDSF0gTWRlTW9kdWxlUGtnL0NvcmUvUGVpOiBzZXQgQXByaW9yaUNvdW50PTAgYmVmb3JlIHdhbGtpbmcgdGhyb3VnaCBuZXh0IEZW?= To: gaoliming , devel@edk2.groups.io CC: 'Leon Chen' , 'Tim Lewis' References: <009501d983a8$6295f740$27c1e5c0$@byosoft.com.cn> From: Wendy Liao In-Reply-To: <009501d983a8$6295f740$27c1e5c0$@byosoft.com.cn> X-ClientProxiedBy: SI1PR02CA0054.apcprd02.prod.outlook.com (2603:1096:4:1f5::13) To TY2PR02MB4446.apcprd02.prod.outlook.com (2603:1096:404:8008::11) Return-Path: wendy.liao@insyde.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR02MB4446:EE_|SEYPR02MB5487:EE_ X-MS-Office365-Filtering-Correlation-Id: df53659c-2c1c-4de5-f637-08db51c69fd3 X-LD-Processed: 8c8c18f6-76e9-4eeb-9238-a7b3da7871d8,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oe6dE4iB0hhTe6np0apN1TRdCttVyqzYVx3/svXsDDdcHTKXFxEXHQ8v1lvVF062cyVEoEttDakGB9HbPlrNidClLkbjzOFJ95we3nAcqrzRumgTV5UK+SniOXcZuEIWy5BIYfrLwDsdzEXiMJINfRe7rKCHteszc+Q4AvlKzIPvZ8YFJjjcMfydNn4ZJ/d9fOo8w0Nb0L2kKVpM+6pT6TIF8VGqEpo7Cnt9SSFCR4o2rf5OBF4vGwfLwdYDe7TxUYCkT5ZiY3EytSjXwL0TGwmyI8K2vLBrjL0HsttTJ+27Om+KuCZZvsArDBctAwOJyLGAi0S15NqlyUptnfzpHdOeLL/4RPSOe/lMx4JPOli5FWjR11ZWEYL7wFHp4qBdzONzsoS8a2rRidVWZfslAl895Bot2MWfH/mBlOafTEvrzsZl0nSYqXNUFWfcp4dL/aaGywZE/l4MRUBvmKGz0GrvNj+8WTGh9lx1MWEzoK7UyFryWdKpC9EHv3Ysg9g6VQo6dQ9HALZOaGHGxOU3bByzJ2SOVzS+Z1SLMgjTVBAzue+JVo38mUXyWrvV6+/BtXvw34rD+wC3/bNkctjSROHnXpg2LsG9lXgTyruYb3b2i9MZFmEeG20QQIfcKG+w3yHuTHU0x7evqdGRjnW/kD6M0KBxzTvDsFrosoTikhY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY2PR02MB4446.apcprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(396003)(366004)(376002)(136003)(451199021)(2616005)(186003)(6506007)(6512007)(478600001)(26005)(107886003)(31686004)(83380400001)(66899021)(966005)(6486002)(6666004)(8936002)(5660300002)(316002)(38100700002)(41300700001)(86362001)(4326008)(54906003)(66946007)(66476007)(36756003)(224303003)(66556008)(2906002)(44832011)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MK+xwDNtI79vGYYEYTGsPn75gAQworUN8WI0PGitWO6bvPoT2U8Dy6xYcNg9?= =?us-ascii?Q?cWeuolej6noDcLwXArkAXtMlC3kv434IhdZSSy1wPyFbrkA4qHXdEkRO7QtI?= =?us-ascii?Q?QN4gOirN/Soxvm/ddIZvwasMEOBn4G7IOf7NbiMw+8IlmcuzWm3PI8ut1Fbf?= =?us-ascii?Q?/LhuaulqdDu/9XR5DxZ3VtLE3j79VNOXC9226FfYlGhchBjssitttGtBVbDH?= =?us-ascii?Q?JAEpkxmh16UENVia2m60R0ZPMj5jh7c3mPmQfjHa21sdOf9bmNDalhbN8POE?= =?us-ascii?Q?QGtuGULum51NnuZcij7UQexyAwOEX4enZIDFjTj8329sa8unrnVrm0g9ShnF?= =?us-ascii?Q?PrSAapBpZj4ZzGZLwJ7q3Q/CF0Qut/u+zVGKEjo69NSiRucRDGy75O/ssz6+?= =?us-ascii?Q?GJUX7DU91GWnVnST1ucIi3vxbjLS26564aswe7iQzxnHuTTFpze/pUSIaAfW?= =?us-ascii?Q?eFUUKHQvJCxLBPH8CaYu3BE23e7I9Aheozk5ulGBH8qo8N32kh/T50hRHu3y?= =?us-ascii?Q?af7ZMf0cliYp69+xIR+dA/PrH7wIMdBO77Upc1HZCo7+IrBewd04Q24rQOyz?= =?us-ascii?Q?lx6VNhZqs7QfI4yvgz7gRMAbGx/qk6yWa+59f4uZgzh/Pr7BdUDIMehXMK4n?= =?us-ascii?Q?/wTAu/qYuLmkusgOZyYjh69cmiRvbZJp6zkJrYkXqkWPakfpG9Zkp1/73Whe?= =?us-ascii?Q?en2knDhDIyg3JPHG7vTsMW6LqYZRHoDVk+/18Q3C/sjb+nKDPTPkGZpDzRk7?= =?us-ascii?Q?PG85/mV0u0h6wVsmb5b+eWXkrx713ya4wiWK/4PU6/qipol2Kd9La4xczdfj?= =?us-ascii?Q?28CfjQ4xdMVLdZ3AsRfu+Zr3VSo+JYd7P70nZTkkJ78fPctX+WJqzbmjqU9C?= =?us-ascii?Q?TqAMY44y++qnkjKvhE043YZF+ckczKbpRuD1IbknC1Nt+8vRmw4Dv8MITSMq?= =?us-ascii?Q?A5GYThSlMBIXYMZlATBuziOmD5UTtTR94gQVEVYfRDeP7nSwPC/uadRp7+/D?= =?us-ascii?Q?KmkItpgLS+0CAtNgVxngUQXYcVtimXLh4LIqKAOkBSETnMdp1oU9qwgvQ8yi?= =?us-ascii?Q?spKaRA9QHqyeosd+L8q5BrFwHom/SRcGkKIz9+lKQTFvnWsDM+6gqF/I68eW?= =?us-ascii?Q?3lFxEl9tCfPJK7+4brcid0msIORVlyAL5bLd8awvIwWv4FwQnJTKTiEGWlzV?= =?us-ascii?Q?up370/JRmUqM5yBQpj1IJh0SaoOP+5CdP4TQvl9XmCZodgr4Eb0nk0e8TkV6?= =?us-ascii?Q?UCeXa1ivk2MJNzNVGcupToIrBu5w91KEGH5M+WGm4zZhKLJQWlA4AMantuJO?= =?us-ascii?Q?qp7L999r0zNd7Iiw9PIi8vMOLHAaAB1K1AVSxbHBs1N3fPCx4/T0XrDke14U?= =?us-ascii?Q?Mg4GyCZfLs/tdT5qjOQIXW3kidB+g/sFW33d0vfO5To89CZW+noAIRjrBd0n?= =?us-ascii?Q?p+RFEU+PvfEF51/kH19NUIIN/nt6xy9SLujRHsBZVKKqJJL40x8fzzKq7T+g?= =?us-ascii?Q?GbJO6wjNUgrAW6XF80yIpZIfTrY+chcFLBFM3P30KP9IwKtgGNxiS635rchv?= =?us-ascii?Q?T2Skf6FztERtCdYKkCwNsEZWs72P1altkQjYE2F1?= X-OriginatorOrg: insyde.com X-MS-Exchange-CrossTenant-Network-Message-Id: df53659c-2c1c-4de5-f637-08db51c69fd3 X-MS-Exchange-CrossTenant-AuthSource: TY2PR02MB4446.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 02:22:53.1770 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8c8c18f6-76e9-4eeb-9238-a7b3da7871d8 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w1EPUlxMbuYBKpVFKsSwTvmtCJ4d8RfzzGIZuKLopXTdsTiCwPLho5QduW4HCSgtZF1Aypo6pNUJVrLLmKyHaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR02MB5487 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi gaoliming, DiscoverPeimsAndOrderWithApriori () will not reset Private->AprioriCount=20 to Zero when CoreFileHandle->ScanFv =3D TRUE. DiscoverPeimsAndOrderWithApriori () { ... =C2=A0 if (CoreFileHandle->ScanFv) { =C2=A0=C2=A0=C2=A0 Private->CurrentFvFileHandles =3D CoreFileHandle->FvFil= eHandles; =C2=A0=C2=A0=C2=A0 return; =C2=A0 } ... } After go through all FV and the last FV has one or more Apriori Peim,=20 Private->AprioriCount will not be reset to 0 anymore. Scan loop 1 [FV1] Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D 0,= =20 CoreFileHandle->ScanFv =3D FALSE After DiscoverPeimsAndOrderWithApriori ()=C2=A0=C2=A0=C2=A0 : Private->Apri= oriCount =3D=20 2, CoreFileHandle->ScanFv =3D TRUE [FV2] Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D 2,= =20 CoreFileHandle->ScanFv =3D FALSE After DiscoverPeimsAndOrderWithApriori ()=C2=A0=C2=A0=C2=A0 : Private->Apri= oriCount =3D=20 0, CoreFileHandle->ScanFv =3D TRUE ... [FVn] Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D 0,= =20 CoreFileHandle->ScanFv =3D FALSE After DiscoverPeimsAndOrderWithApriori ()=C2=A0=C2=A0=C2=A0 : Private->Apri= oriCount =3D=20 1, CoreFileHandle->ScanFv =3D TRUE Scan loop 2 [FV1] Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D 1,= =20 CoreFileHandle->ScanFv =3D TRUE After DiscoverPeimsAndOrderWithApriori ()=C2=A0=C2=A0=C2=A0 : Private->Apri= oriCount =3D=20 1, CoreFileHandle->ScanFv =3D TRUE Best Regards, Wendy Liao Insyde Software Corp. Phone: +886-2-6608-3688 Ext.8731 gaoliming =E6=96=BC 2023/05/11 =E4=B8=8A=E5=8D=88 09:32 =E5=AF=AB=E9=81=93: > Wendy: > DiscoverPeimsAndOrderWithApriori () has the logic to reset Private->Ap= rioriCount as zero. > It will set the real AprioriCount for each FV when this FV first scans= , then dispatch the peims in the apriori list. > So, I don't think there is the issue here. Do you find the real functi= onality issue? > > Thanks > Liming >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- >> =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Wendy Liao >> via groups.io >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B45=E6=9C=8810=E6=97=A5= 14:23 >> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io >> =E6=8A=84=E9=80=81: Leon Chen ; Tim Lewis >> >> =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set Apri= oriCount=3D0 >> before walking through next FV >> >> >> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D4438 >> >> The main dispatch loop in PeiDispatcher() goes through each FV and >> calls DiscoverPeimsAndOrderWithApriori() to search Apriori file to >> reorder all PEIMs then do the PEIM dispatched. >> >> DiscoverPeimsAndOrderWithApriori() calculates Apriori file count for >> every FV once and set Private->AprioriCount, but Private->AprioriCount >> doesn't be set to 0 before dispatch loop walking through the next FV. >> >> It causes the peim which sort on less than Private->AprioriCount and >> depex is not satisfied would be dispatched when dispatch loop go through >> to a scaned FV, even the peim is not set in APRIORI file. >> >> Cc: Leon Chen >> Cc: Tim Lewis >> Reported-by: Esther Lee >> Signed-off-by: Wendy Liao >> >> --- >> MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >> b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >> index d8284f9f4f..5f32ebb560 100644 >> --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >> +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >> @@ -1630,6 +1630,7 @@ PeiDispatcher ( >> Private->CurrentFileHandle =3D NULL; >> Private->CurrentPeimCount =3D 0; >> Private->CurrentFvFileHandles =3D NULL; >> + Private->AprioriCount =3D 0; >> } >> >> // >> -- >> 2.29.2.windows.2 >> >> >> >> >>=20 >> > >