From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.43596.1670318701505958400 for ; Tue, 06 Dec 2022 01:25:01 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=JJkEeLBb; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670318701; x=1701854701; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=pAR2cPgl2XufdTN2VqAHJSbUaa6dVvfbAddjWUTN+nI=; b=JJkEeLBbaZwvQUUdXvtdbkwcsHWdgwj/MiHv7jIyHZyvCJf/z+LUpWzH XvcdkwuTnHBkAoaLJVwOKbe9XaWN03PJcqVwQP6rkkYXpYIbFcFeGAJMq RtYfGTIoFyOHDTbmhQV/qu3+pkVQ5WBafhPCb3IK/WO+LLgi9YUh/eLlR QMb4Sev0KJ3HbG7e6ATs6PeD/WXwvbYyp3BCuVs3EktLlXyp20wtAanX/ UZ+h8QquV4LP9SjbUbS1ojlTEw5Kx2zh/BiWlKydiLTCoOh+ZoRMDjhnA dJ0+K4cm0I/YY3mz/ufYGFFISfylO40/MPkn0heF1xODMym5Wm1dGiRVy g==; X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="378742832" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="378742832" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 01:25:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="678684731" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="678684731" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga001.jf.intel.com with ESMTP; 06 Dec 2022 01:25:00 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 6 Dec 2022 01:25:00 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 6 Dec 2022 01:24:59 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Tue, 6 Dec 2022 01:24:59 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Tue, 6 Dec 2022 01:24:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gS4mc54hbiU1Q42m8DHNkPMSPI8RP1hJZb6+XlzWOfQXmOEjY1MTJPxzQpbnyEPNPrpxL8PXKISBrXJbIw50Nv42jdsPoq7kAyL2AsXGooFQPIX84n1/exwZAhaEy9qiTxOrS5jzjPmmTCbzUSin3svVB8+bDs4auNL/Z716590Jy34wOcM2ou8SenYyIeEb6kHt1duiGEV4Lz2d1XkuLYV8eQDm1SzFwxcRxoSN/qbHSP8Ri1U+yRpfa9Q/9+YziYX7QznCTK7tTEB7Sux0JEtoLvNtaZ5rx/GMcy1fFw6cjvaXwg5xEgQQLqUOL0GfK2rpONPsgA9C+6UqsgwU6A== 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=iv0Mp0zgPbwxMK3xZHyCNTD69+3s0UVFss85pFbg2Vc=; b=YQaf0vNAKdfVPxHRdwuZTH3UeOC/W5Abgizz543dnMhxlF/qeiPYtMxzGPYJyD3w5vciKGTJtqqXVQzq2XUpPl2w+63wKIKekEVMOOknHcR8Q/ZK9vxFcZdzReLOTdaJX0tXEoqZcbUduV+GdaXnh4ylFgkIDpUZ3faHtmD0zJQAThXo9v+cTy/J6saJX6CrNlC0zJ0V5IUsetgrQV4ivwY/nupgKlsgC1H8tSAjE7T9J6pSZ+8QaS5vTlVJ+L20CFt0o4nDv+2fZpg/YyiNChxERoKFf/DcPbWX6rAe8bWnXKxdk1gO3jr6moD+dWiTnio+zmi+K9uXrt29NjyHxQ== 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 Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by CY8PR11MB7393.namprd11.prod.outlook.com (2603:10b6:930:84::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Tue, 6 Dec 2022 09:24:54 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::69c8:2676:4674:1d2e]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::69c8:2676:4674:1d2e%12]) with mapi id 15.20.5880.014; Tue, 6 Dec 2022 09:24:54 +0000 From: "Ni, Ray" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: Andrew Fish Subject: Re: [PATCH 2/2] EmulatorPkg: Record Argc, Argv and Envp in EmuThunk Ppi Thread-Topic: [PATCH 2/2] EmulatorPkg: Record Argc, Argv and Envp in EmuThunk Ppi Thread-Index: AQHZCTVwOI8ERM2/RUS6210VpTBXS65gluRQ Date: Tue, 6 Dec 2022 09:24:53 +0000 Message-ID: References: <20221206054136.9963-1-zhiguang.liu@intel.com> In-Reply-To: <20221206054136.9963-1-zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MWHPR11MB1631:EE_|CY8PR11MB7393:EE_ x-ms-office365-filtering-correlation-id: d39ee493-88b1-4b64-91f8-08dad76bbbeb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RODTQpmZhjJ0PgLUVx6y0HUpdsbRQkGQTx5gLu3W4hfhPAyGxhzLshKqz4CwJ8LulhJu1Kqd4Qbxnsz8egOkiKxHUE3WYxsnWU4HTBVeou94E6bn52ybx3erxxckAVWV0s1HFPMXf7xUWEBjXNynnz6sGnsyWUIgKdnWkG/SM/ROrLg8qKYkA6BC3wWB0Eaw5bzcmlKfx52PsoMKRDuxSJaMhP8YjlulssIrQAVmzacBQWRmhRECv4hIjV1QKeuSGZpGGCD5TppFIDbHxagAjyVszDvVLpC3ZxuE9yXnZaWAQn8p4YgIra8o0Qqy7Mp4GvyoeSEk0g9Qwj59biF2P3X1T446Rjcokt3LIH1XdniKEryoUvvJuu3e/2QYj8s6NY45EybaAgyrFu89N/7m4ro0wfY5RcAgrPQfh0tqtXUkcxjIozy3QafO/0LXwDvNC9K1NVIIrgwPWnIQTUt78MqVg/n7eS93L5VjqKeB9Vs3hhegUk2Yz9bwSGVy+3cZ6gI2bE1Q2oMC1QvU4pVPeSdYQuR6PlrL1MsJI+g7yFPIf9+cn+NaFZx+N3VP1AMXNtEfy8eX55EOANQhtSd/k6GmsB60Wu7ay+HsNYiyxYDpWoi1RSmhZaTNHqzaYGKoHVz+zUWkg7HvG+QPLwXhhH+F/p/OB4c7XgkWcN0dge+dip0mN4cO37ZGCuSezKhohd+vRn55xVozUPlwbdkz8g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(346002)(39860400002)(136003)(366004)(396003)(451199015)(4326008)(110136005)(316002)(76116006)(66476007)(66556008)(66446008)(64756008)(8676002)(66946007)(86362001)(71200400001)(55016003)(41300700001)(5660300002)(52536014)(8936002)(53546011)(7696005)(9686003)(26005)(38070700005)(478600001)(6506007)(2906002)(83380400001)(82960400001)(33656002)(122000001)(186003)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xPGv2Bx/LuTiBsAGGLnAhv3O3ZibGjIIEfNNOfsY4dW5avcjMp7NyOOrQIOh?= =?us-ascii?Q?0VuEvxM9kCwszMgIMLHVElTneUmA9Jeyz0NqGA5tIoi1SOt3OtPvuygpcXqX?= =?us-ascii?Q?1bExRtoBWLQjbVzENgagWeMbzENSeETb4ja0adlf958SRxSz4Ku675gEoZUk?= =?us-ascii?Q?ZAxhdVbkSZI0NMovV/o30pqyo2EVxanx6kbdREuZuRLxb4ixkH/N1DMHwk5Y?= =?us-ascii?Q?dhjY6RHGz2Jh59uqhnE7ZYS7LT5PQi0ja6oYjg8ygciuUTe8xzAtcOPC7+LK?= =?us-ascii?Q?//Gujj0hzgjAYm7p5DKDgqZ2Srl6d4jwvRyr8FbUPbO3A+Z3cyfA2dSkGxJ5?= =?us-ascii?Q?yd2VCapI4QpdPl3/LsSz4wqISr7CQyeNGAs7fM75cL+LUgXmuzPZMSCh3cQL?= =?us-ascii?Q?JxAeLHVPYzJD8y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-ascii?Q?wEh1ittZTwt8ki3SH/krcnMFdel8xlUhQu5Auwuc7Z6EKDpHomAq1qfK3Jsc?= =?us-ascii?Q?aLgxz7FscDPcoiZ5uYwjuS+heDCBmakf6gD241zi9c8KtG9DPGug3TYIV1rr?= =?us-ascii?Q?UBVzCnL4NCkRxzXg57Pmj1GEiX3nnOYYaeBH+mtzhH2sC2gijP/qx146Hzw8?= =?us-ascii?Q?HqbMOoqrx6jzspH9PzpAP8/Z+4q95wPjeXDTUbDzq6/xC6PXk4melS4WR+pB?= =?us-ascii?Q?inWATjbnTnZ/5R2SDaE=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d39ee493-88b1-4b64-91f8-08dad76bbbeb X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2022 09:24:54.0128 (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: 1VVh/0cYyWVAzz7irtX2UOerYd8WNrsLrlVg5NS/XnNBUGh6B4jSUP3LL1fi/7NnS2uGbY44ThtV3t/htdtaXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7393 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Liu, Zhiguang > Sent: Tuesday, December 6, 2022 1:42 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Andrew Fish = ; > Ni, Ray > Subject: [PATCH 2/2] EmulatorPkg: Record Argc, Argv and Envp in EmuThunk > Ppi >=20 > Record Argc, Argv and Envp in EmuThunk Ppi so that other modules > can use these fields to change behavior depends on boot parameters > or environment. >=20 > Cc: Andrew Fish > Cc: Ray Ni > Signed-off-by: Zhiguang Liu > --- > EmulatorPkg/Include/Ppi/EmuThunk.h | 3 +++ > EmulatorPkg/Unix/Host/Host.c | 3 +++ > EmulatorPkg/Win/Host/WinHost.c | 3 +++ > 3 files changed, 9 insertions(+) >=20 > diff --git a/EmulatorPkg/Include/Ppi/EmuThunk.h > b/EmulatorPkg/Include/Ppi/EmuThunk.h > index cf29cf824c..c78ad692ed 100644 > --- a/EmulatorPkg/Include/Ppi/EmuThunk.h > +++ b/EmulatorPkg/Include/Ppi/EmuThunk.h > @@ -107,6 +107,9 @@ typedef struct { > EMU_PEI_AUTOSCAN MemoryAutoScan; > EMU_PEI_FD_INFORMATION FirmwareDevices; > EMU_PEI_THUNK_INTERFACE Thunk; > + INTN Argc; > + CHAR8 **Argv; > + CHAR8 **Envp; > UINTN PersistentMemorySize; > UINT8 PersistentMemory[0]; > } EMU_THUNK_PPI; > diff --git a/EmulatorPkg/Unix/Host/Host.c b/EmulatorPkg/Unix/Host/Host.c > index 8d0be5b54b..1f29dd00a3 100644 > --- a/EmulatorPkg/Unix/Host/Host.c > +++ b/EmulatorPkg/Unix/Host/Host.c > @@ -145,6 +145,9 @@ main ( > } >=20 > CopyMem (SecEmuThunkPpi, &mSecEmuThunkPpi, sizeof > (EMU_THUNK_PPI)); > + SecEmuThunkPpi->Argc =3D Argc; > + SecEmuThunkPpi->Argv =3D Argv; > + SecEmuThunkPpi->Envp =3D Envp; > SecEmuThunkPpi->PersistentMemorySize =3D FixedPcdGet32 > (PcdPersistentMemorySize); > AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEmuThunkPpiGuid, > SecEmuThunkPpi); >=20 > diff --git a/EmulatorPkg/Win/Host/WinHost.c > b/EmulatorPkg/Win/Host/WinHost.c > index 3b2fde297d..f639ba3b1b 100644 > --- a/EmulatorPkg/Win/Host/WinHost.c > +++ b/EmulatorPkg/Win/Host/WinHost.c > @@ -485,6 +485,9 @@ Returns: > } >=20 > CopyMem (SecEmuThunkPpi, &mSecEmuThunkPpi, sizeof > (EMU_THUNK_PPI)); > + SecEmuThunkPpi->Argc =3D Argc; > + SecEmuThunkPpi->Argv =3D Argv; > + SecEmuThunkPpi->Envp =3D Envp; > SecEmuThunkPpi->PersistentMemorySize =3D FixedPcdGet32 > (PcdPersistentMemorySize); > AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEmuThunkPpiGuid, > SecEmuThunkPpi); > AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEfiPeiReset2PpiGuid, > &mEmuReset2Ppi); > -- > 2.31.1.windows.1