From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069102.outbound.protection.outlook.com [40.92.69.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5A8E121D1B291 for ; Fri, 21 Jul 2017 08:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=CGjmvUPnFSWGkIpiWoMdsr12jae95V06iF8IlYO2PdU=; b=jI+Sx1rcYFdJ6M0/p1LrCemCUfMm7a/3iMMSBEkaiWxK4HO3rUITeZYh4hitoZWpMMNIttxQTEiEDtn9dRTvXuPPH+OWva/0mGvmicoHj+5LgHMVwlqIXmFPzA3oufyQaCTzPG83FGwpIh/lE86ks8akGTpO7VveBLr+IGLH36+qnrMIBSI7MBHpPpnVLvpeP+ee0KA83yrI2BehkyaUNT/5GHzinmAH4MMj1W80s9hXHTsdbqgyNPFtZkVEVCh5eq+SwPRNXlhukz+/3Ufvkos90YCvD6rbpwmMqRrpz8++JfuWyvO3d63ygyIOAAryREMA+bxdqc2MY0KXT1l88g== Received: from AM5EUR02FT056.eop-EUR02.prod.protection.outlook.com (10.152.8.58) by AM5EUR02HT244.eop-EUR02.prod.protection.outlook.com (10.152.9.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1240.9; Fri, 21 Jul 2017 15:17:33 +0000 Received: from AM4PR06MB1491.eurprd06.prod.outlook.com (10.152.8.52) by AM5EUR02FT056.mail.protection.outlook.com (10.152.9.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.9 via Frontend Transport; Fri, 21 Jul 2017 15:17:33 +0000 Received: from AM4PR06MB1491.eurprd06.prod.outlook.com ([fe80::ad7e:bc05:6bd8:2470]) by AM4PR06MB1491.eurprd06.prod.outlook.com ([fe80::ad7e:bc05:6bd8:2470%13]) with mapi id 15.01.1261.024; Fri, 21 Jul 2017 15:17:32 +0000 From: Marvin H?user To: "edk2-devel@lists.01.org" CC: "iewen.yao@intel.com" , "giri.p.mudusuru@intel.com" , "michael.d.kinney@intel.com" , "kelly.steele@intel.com" Thread-Topic: [Suggestion/Bug] Extend the usage of 'shared' modules Thread-Index: AdMCNHVnO6ycikdnQAyxbjdfTvzxdQ== Date: Fri, 21 Jul 2017 15:17:32 +0000 Message-ID: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.01.org; dkim=none (message not signed) header.d=none;lists.01.org; dmarc=none action=none header.from=outlook.com; x-incomingtopheadermarker: OriginalChecksum:A337AC772AC1CABB48C5755F98B55916EFD44145DD1C6837C6130EB06DB52D5D; UpperCasedChecksum:331153518B1D18E5256653F7E778DB22EC241CCA21E64527CA75C8D93A339EC1; SizeAsReceived:7378; Count:43 x-tmn: [t8cP63o0zommkEQHrbvpemphNHt3i/V0k9wH9G+YtH0m/0hlAXT+h9hc2TKvxz/K] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5EUR02HT244; 7:BZwcmBInmQ66dDwS0vXU+InAwLaEmGkoXE9MUxnaH36VMi6CS8Gfpkj3Uq29O8UQ9HOPQggi4dXjozekBPaVMBMLCU+EMZe0dKZ6RxiQrxbBRwc1qnyudxo6FXwglwfMcDL7+olJ5sE+irJitIwCugTEgt0Jnjp30n1yvKpzjb+EERDhwM5CnYB1/F1MwJbYFL7aEarstuG/4Ht1U25yAuS5SudAOx/YuEjkzqFnY+V5G0z8UGQylve993Kf9z4qx0T/4z4Tsnwg9ar3f5B5ue6jz0hVCXbLeNxbvLut+n+MNNE7PfABSkporMWb6gVUHR7hv5jB8U4uO9v9WKBOuhHl/mdi0M3tgFAJc/CGcxmJabnD4wSmnPolN0ehPveC2OXg55Y1193nxR5PvTWYlZTRRJdC7YVtnG/AGMfwMCzspowqAUQ0NQmPfaj5+YU+x5V08w2cXcUqsMK+vFCwtzk/aaHuCrhow2xmyvc5428a1NhI3uzCcoQJDGYqL1ZqEJY63rAmEe9qgJLXKXUAKnIQabfcGC3WyYvUjwZ8KSOmBwtRN4lnNlZ639lM/Fmb2ibpSgZ6X8+CTxZ/HH+clIaw5xLqY3XiadPhu+l7Rd604FMbR4C/5fRl7CPXLolqzUZgGiPGI8UmBZlY9LAlII1v5F5tmc1pVjt70gUfA2E8mr9xf1MR6hi6GbmaDuR1tY8bTHo8d+r8dXbUR/Ac3nyn5tTZ/qiS4k3r39pK/HHIy/L06tJCFszdPjE+Woc73xpEDte+AzOU9HTG9NJOgA== x-incomingheadercount: 43 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:AM5EUR02HT244; H:AM4PR06MB1491.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: bc930094-e704-4585-e726-08d4d04b9c47 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322350)(1601125374)(1603101448)(1701031045)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM5EUR02HT244; x-ms-traffictypediagnostic: AM5EUR02HT244: x-exchange-antispam-report-test: UriScan:(166708455590820)(26388249023172)(21748063052155)(151999592597050); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031); SRVR:AM5EUR02HT244; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5EUR02HT244; x-forefront-prvs: 0375972289 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2017 15:17:32.8696 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT244 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: [Suggestion/Bug] Extend the usage of 'shared' modules X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jul 2017 15:15:45 -0000 Content-Language: de-DE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Dear developers, Dear KabylakeSiliconPkg devs: If you are not interested in the suggestion o= f generic, shared modules, please read my comment on 2) nevertheless, as it= contains a potential bug report. Sorry, but I could not verify this yet. I have been exploring the code of most of the Intel 'open platforms' lately= and noticed they shared a bunch of slightly different modules, which are d= iverse to fit the platform's requirements. One of them is PchSmmDispatcher/QNCSmmDispatcher. I'm not sure about non-In= tel platforms, though in my opinion, there should be a generic module in Md= eModulePkg, if it can be shared across brands, or one in In IntelSiliconPkg= , if it's useful for Intel platforms only. To see why I think a generic, sh= ared module that consumes a platform library would be hugely beneficial, pl= ease take a look at these lines: 1. https://github.com/tianocore/edk2-platforms/blob/devel-MinPlatform/Si= licon/Intel/KabylakeSiliconPkg/Pch/PchSmiDispatcher/Smm/PchSmmCore.c#L361 2. https://github.com/tianocore/edk2-platforms/blob/devel-MinPlatform/Si= licon/Intel/KabylakeSiliconPkg/Pch/PchSmiDispatcher/Smm/PchSmmCore.c#L890 3. https://github.com/tianocore/edk2/blob/master/QuarkSocPkg/QuarkNorthC= luster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c#L753 1) shows a hook to SmmReadyToLock, which I first and only saw in KabylakeSi= liconPkg. This addition has not been brought to the Quark platform, for exa= mple. With a shared module, all platforms that embed it would have profited= . 2) on the other hand shows KabylakeSiliconPkg's PchSmmDispatcher accessing = RecordInDb after the callback function has been executed, which QuarkSocPkg= 's QNCSmmDispatcher explicitely forbids in 3), as it might have been freed = by the call. I am not sure whether it was a bug in the Quark firmware that = has been fixed by the time the Kabylake code was written, though I don't be= lieve so, because the changes to the loop to process multiple SMI sources i= n one go is not present in the Kabylake code either. If there was a shared = module, the fix to Quark would have profited all other platforms. It's obvious to me that KabylakeSiliconPkg has a bunch of things that were = previously only distributed privately as part of the private Reference Code= . I think that keeping the RC as small as possible (the very best case woul= d be only platform library classes consumed by generic, open source modules= ) is a goal worth persuing, as more code can be shared and community-verifi= ed as part of EDK2. Thanks for your time! Regards, Marvin.