From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90F3621A143F5 for ; Mon, 11 Sep 2017 12:32:27 -0700 (PDT) Received: from G4W9119.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.210.20.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id BC8369C; Mon, 11 Sep 2017 19:35:22 +0000 (UTC) Received: from G9W8456.americas.hpqcorp.net (2002:10d8:a15f::10d8:a15f) by G4W9119.americas.hpqcorp.net (2002:10d2:14d6::10d2:14d6) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Mon, 11 Sep 2017 19:35:22 +0000 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (15.241.52.13) by G9W8456.americas.hpqcorp.net (16.216.161.95) with Microsoft SMTP Server (TLS) id 15.0.1178.4 via Frontend Transport; Mon, 11 Sep 2017 19:35:22 +0000 Received: from CS1PR84MB0151.NAMPRD84.PROD.OUTLOOK.COM (10.162.189.30) by CS1PR84MB0008.NAMPRD84.PROD.OUTLOOK.COM (10.162.189.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9; Mon, 11 Sep 2017 19:35:20 +0000 Received: from CS1PR84MB0151.NAMPRD84.PROD.OUTLOOK.COM ([10.162.189.30]) by CS1PR84MB0151.NAMPRD84.PROD.OUTLOOK.COM ([10.162.189.30]) with mapi id 15.20.0035.021; Mon, 11 Sep 2017 19:35:20 +0000 From: "Palmer, Thomas" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" , "edk2-lists@mc2research.org" CC: "edk2-lists@mc2research.org" , "Shifflett, Joseph" Thread-Topic: [PATCH 1/1] StdLib/EfiSocketLib: Fix ABI mismatch for 2 event functions Thread-Index: AQHTEijzmnPFCZFwb0urW/kAglizVqJ+ND+AgDIRQoA= Date: Mon, 11 Sep 2017 19:35:20 +0000 Message-ID: References: <1502404487-12865-1-git-send-email-thomas.palmer@hpe.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=thomas.palmer@hpe.com; x-originating-ip: [15.203.233.85] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CS1PR84MB0008; 6:jaL1hVC7FbtbH5nY0O1j942Fag9gYQs4XzWDVOXtf5R1y1JcktprszwQ0Ivdc5XyH/heYM7rATz1zJk3Gypml0TRiiqNV5eGjBChMM/JneYMPUY8d+XwOBh4li9siH0YT+5Xc83Pth3YO4axyJ8Ue1icRpSrqAVMvi/uXcFhntfOSu8NrX+iCGOzfK2PYell7OgJJp0toy/f9cU2lFfGn0WZJiHiO+3Yu+GRG8UOhxsTk7FZXjoE048fMtfqzvhXOwIZW9LfYH/Lk7G4pyl6fEtr6a+rQQNTK7aB9mrIni7MOwPeDFgu2bmpt9L0Uotq2ax2NePgDaGZhhhBMyEeLg==; 5:guwB6xie4GZeTK/q4YyNSLrw3SN2E0HSm2WGF4YefbR1wixQ3HwsGvHPwSZ/UsiWwX3d6cnQl4DKBCqiFhOta8J4/WXDWqbGEhgmYV1+3CjwJ1SMpjBV8moqspyW8dvdFKOC7SrAiXZSPZOpNUY6lA==; 24:gf+wCg+YJ7Q/axbmJ5IC+LbSKYg+PRTXqQBxULe+WRgFMb7cCUv2By1cQvfatJ3APx9evGav2DG+49+P7G7bMpRqTV8oXZl14M2O+wbrJsk=; 7:0u/Fy8+zCsz0b3MZi6W41SPk37yVC+u8VvfdU3M0O3wh//Vh4qISgsUPzGjGkJS76B2Th6HH0XmgxqH1Q55DcUnIqTRxinV1W2wcEGeRmFVp3Q2LKHrUcheKr/yLxJtmySG1xv6Lfveun8t140w49sZQP9MTmcVTwndha/thgadncaKqKTWK8OglRe9yyetgavc5rGS2TXI3ib+H1WpaO3/SpHv9NsnN0k40PIQwPog= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(199003)(13464003)(377454003)(189002)(106356001)(53936002)(55016002)(6246003)(105586002)(9686003)(53546010)(54906002)(2501003)(4326008)(2900100001)(25786009)(66066001)(101416001)(14454004)(189998001)(3846002)(86362001)(2950100002)(102836003)(229853002)(97736004)(6116002)(2201001)(76176999)(7736002)(305945005)(50986999)(54356999)(74316002)(3660700001)(6436002)(8936002)(68736007)(77096006)(81156014)(478600001)(8676002)(81166006)(3280700002)(7696004)(2906002)(33656002)(5660300001)(6506006)(19627235001); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR84MB0008; H:CS1PR84MB0151.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: 61cec9dc-c590-4e58-37c3-08d4f94c3ced x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CS1PR84MB0008; x-ms-traffictypediagnostic: CS1PR84MB0008: x-exchange-antispam-report-test: UriScan:(227479698468861)(162533806227266)(228905959029699); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CS1PR84MB0008; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CS1PR84MB0008; x-forefront-prvs: 04270EF89C received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Sep 2017 19:35:20.0623 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0008 X-OriginatorOrg: hpe.com Subject: Re: [PATCH 1/1] StdLib/EfiSocketLib: Fix ABI mismatch for 2 event functions 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: Mon, 11 Sep 2017 19:32:27 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Daryl?=20 I haven't seen a comment on this patch since 8/10 Regards, Thomas Palmer "I have only made this letter longer because I have not had the time to mak= e it shorter" - Blaise Pascal -----Original Message----- From: Carsey, Jaben [mailto:jaben.carsey@intel.com]=20 Sent: Thursday, August 10, 2017 5:59 PM To: Palmer, Thomas ; edk2-devel@lists.01.org Cc: edk2-lists@mc2research.org; Shifflett, Joseph Subject: RE: [PATCH 1/1] StdLib/EfiSocketLib: Fix ABI mismatch for 2 event = functions Looks good to me. Daryl? > -----Original Message----- > From: Thomas Palmer [mailto:thomas.palmer@hpe.com] > Sent: Thursday, August 10, 2017 3:35 PM > To: edk2-devel@lists.01.org > Cc: edk2-lists@mc2research.org; Carsey, Jaben=20 > ; joseph.shifflett@hpe.com; Thomas Palmer=20 > > Subject: [PATCH 1/1] StdLib/EfiSocketLib: Fix ABI mismatch for 2 event=20 > functions > Importance: High >=20 > The gBS->CreateEvent expects a EFI_EVENT_NOTIFY function as the third=20 > argument. The EFIAPI token is an important component of that=20 > prototype. Its absence can cause unexpected issues on DEBUG systems=20 > built with GCC due to ABI mismatches. >=20 > Both EslTcp4ConnectComplete and EslTcp6ConnectComplete did not have=20 > the EFIAPI token required of a EFI_EVENT_NOTIFY function. GCC did not=20 > catch this because of the explicit EFI_EVENT_NOTIFY cast. By removing=20 > the cast, a build error ensues. >=20 > This patch removes the cast and updates both functions to comply with=20 > EFI_EVENT_NOTIFY. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Thomas Palmer > --- > StdLib/EfiSocketLib/Tcp4.c | 8 ++++++-- StdLib/EfiSocketLib/Tcp6.c |=20 > 8 ++++++-- > 2 files changed, 12 insertions(+), 4 deletions(-) >=20 > diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c=20 > index 68477fba6e70..8125a8d4f5ad 100644 > --- a/StdLib/EfiSocketLib/Tcp4.c > +++ b/StdLib/EfiSocketLib/Tcp4.c > @@ -2,6 +2,7 @@ > Implement the TCP4 driver support for the socket layer. >=20 > Copyright (c) 2011 - 2015, Intel Corporation. All rights=20 > reserved.
> + (C) Copyright 2017 Hewlett Packard Enterprise Development LP
> This program and the accompanying materials are licensed and made=20 > available > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at @@=20 > -192,9 +193,10 @@ EslTcp4Accept ( >=20 > **/ > VOID > +EFIAPI > EslTcp4ConnectComplete ( > IN EFI_EVENT Event, > - IN ESL_PORT * pPort > + IN VOID *Context > ) > { > BOOLEAN bRemoveFirstPort; > @@ -203,12 +205,14 @@ EslTcp4ConnectComplete ( > ESL_SOCKET * pSocket; > ESL_TCP4_CONTEXT * pTcp4; > EFI_STATUS Status; > + ESL_PORT * pPort; >=20 > DBG_ENTER ( ); >=20 > // > // Locate the TCP context > // > + pPort =3D Context; > pSocket =3D pPort->pSocket; > pTcp4 =3D &pPort->Context.Tcp4; >=20 > @@ -1288,7 +1292,7 @@ EslTcp4PortAllocate ( > // > Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, > TPL_SOCKETS, > - (EFI_EVENT_NOTIFY)EslTcp4ConnectComplet= e, > + EslTcp4ConnectComplete, > pPort, > &pTcp4->ConnectToken.CompletionToken.Ev= ent); > if ( EFI_ERROR ( Status )) { > diff --git a/StdLib/EfiSocketLib/Tcp6.c b/StdLib/EfiSocketLib/Tcp6.c=20 > index 0f6d2d6ac93c..9f9c00f6dc57 100644 > --- a/StdLib/EfiSocketLib/Tcp6.c > +++ b/StdLib/EfiSocketLib/Tcp6.c > @@ -2,6 +2,7 @@ > Implement the TCP6 driver support for the socket layer. >=20 > Copyright (c) 2011 - 2014, Intel Corporation. All rights=20 > reserved.
> + (C) Copyright 2017 Hewlett Packard Enterprise Development LP
> This program and the accompanying materials are licensed and made=20 > available > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at @@=20 > -186,9 +187,10 @@ EslTcp6Accept ( >=20 > **/ > VOID > +EFIAPI > EslTcp6ConnectComplete ( > IN EFI_EVENT Event, > - IN ESL_PORT * pPort > + IN VOID *Context > ) > { > BOOLEAN bRemoveFirstPort; > @@ -197,12 +199,14 @@ EslTcp6ConnectComplete ( > ESL_SOCKET * pSocket; > ESL_TCP6_CONTEXT * pTcp6; > EFI_STATUS Status; > + ESL_PORT * pPort; >=20 > DBG_ENTER ( ); >=20 > // > // Locate the TCP context > // > + pPort =3D Context; > pSocket =3D pPort->pSocket; > pTcp6 =3D &pPort->Context.Tcp6; >=20 > @@ -1339,7 +1343,7 @@ EslTcp6PortAllocate ( > // > Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, > TPL_SOCKETS, > - (EFI_EVENT_NOTIFY)EslTcp6ConnectComplet= e, > + EslTcp6ConnectComplete, > pPort, > &pTcp6->ConnectToken.CompletionToken.Ev= ent); > if ( EFI_ERROR ( Status )) { > -- > 2.7.4