From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.68.19; helo=eur02-he1-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-oln040092068019.outbound.protection.outlook.com [40.92.68.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B25AE203B8596 for ; Tue, 8 May 2018 16:57:33 -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=M+ce1d6nJfFzm3pDHydD3NNidrZfK2wVmdJtNrh6TiE=; b=RpBrmQP7oQiQx4XWUtyJx8rbPUY88jlLMckKCy4plIPd87j0a46CfHSJNysyMUbfJ6GnAYi+oFb7xzscN1bH2LZee8bwzpfnDlmYqtVWIBTV93pe8GyrnIyPLs6pCmAS0PbVM7Qiq6154ylQveV1VV862+Bba5zhAMtkQFIupjCheP1HN508mJ6rtkLDkdbCb2rpWSO4M4GGnCl4wlfAvdyyfQQ51eJuqMi/BjLL5MqL9JAhLOdHr6U6nF5eKQ17pKhOWkWVat7UHu3mY/InMIV/pAEssfLBKlFnusZoUbALoG1IEgWSyT+gr+pSq5eyzUHPRuFyV4UCqwXokpYZcg== Received: from AM5EUR02FT004.eop-EUR02.prod.protection.outlook.com (10.152.8.52) by AM5EUR02HT097.eop-EUR02.prod.protection.outlook.com (10.152.9.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.735.16; Tue, 8 May 2018 23:57:30 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com (10.152.8.57) by AM5EUR02FT004.mail.protection.outlook.com (10.152.8.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.735.16 via Frontend Transport; Tue, 8 May 2018 23:57:30 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7c79:584b:2e12:783e]) by VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7c79:584b:2e12:783e%17]) with mapi id 15.20.0755.012; Tue, 8 May 2018 23:57:30 +0000 From: =?iso-8859-1?Q?Marvin_H=E4user?= To: "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "liming.gao@intel.com" Thread-Topic: [PATCH] MdePkg/BaseLib: Globally include ChkStk.c Thread-Index: AdPnJWlKcshriHOETXuZ755wb8JLiwAAiYkAAAAKWvA= Date: Tue, 8 May 2018 23:57:30 +0000 Message-ID: References: <74D8A39837DF1E4DA445A8C0B3885C503AB98291@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503AB98291@shsmsx102.ccr.corp.intel.com> Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:DE7F36D1B4589C18D9179089E94280E3450865A6807CC2C115CF72EBFF7FB643; UpperCasedChecksum:4E207047090E9A435B2DBBA0C4693C0E8D57151E96C323EE410C778C25D6B1EB; SizeAsReceived:7262; Count:46 x-tmn: [IuRsENyvT0irkffYFWfrW8tSayKxBs4X] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5EUR02HT097; 7:rGThq91V+1DUnXA9A6f1kpfsMttORka5dN6TkAwY6pgD0nq+A/nwTgJ9nobG3UN7Khu1DwzkOiSQeHMlrYTBkw1d8h2EtRrKmHXGpLNY5d0KkBEMDs4hws1+izbzeWh9aK8zy9ADZkv7ozalPgP9LPHxQ7xWx6EqS3Cs4HwYLudC+l3di452mZa83wgieyGGUVgXotlFCyhCfVdKrE+lvvFnNmee6HmKmW98BRff9or7lJsRWoMLKecOulOCZXrM x-incomingheadercount: 46 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125420)(1701031045); SRVR:AM5EUR02HT097; x-ms-traffictypediagnostic: AM5EUR02HT097: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:AM5EUR02HT097; BCL:0; PCL:0; RULEID:; SRVR:AM5EUR02HT097; x-forefront-prvs: 0666E15D35 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(13464003)(189003)(199004)(59450400001)(106356001)(6916009)(105586002)(1720100001)(8936002)(26005)(81156014)(2351001)(6346003)(87572001)(53546011)(14454004)(68736007)(25786009)(102836004)(8676002)(54906003)(7696005)(229853002)(20460500001)(305945005)(76176011)(3280700002)(99286004)(33656002)(82202002)(6436002)(446003)(426003)(11346002)(476003)(3660700001)(486006)(86362001)(5250100002)(55016002)(2501003)(6306002)(72206003)(97736004)(966005)(5640700003)(2900100001)(5660300001)(104016004)(4326008)(6246003)(45080400002)(53376002)(74316002)(19627235001); DIR:OUT; SFP:1901; SCL:1; SRVR:AM5EUR02HT097; H:VI1PR0801MB1790.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:; received-spf: None (protection.outlook.com: outlook.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Marvin.Haeuser@outlook.com; x-microsoft-antispam-message-info: I9UbIUtqo5/g+0C1r8XOelxdK+pqUEV6JH6McBy+/whfiNm3treHsYesGkziYWy135P7W9lzM1uziVBwRa8ITd0xZ+xuM5eWYiXIIfPj6AiUw5KDc84KcqANsmWqhSaYQ1gxQkSBhgsj0jxGp1JWOG2PorhQaB4fwwtRkuJYWIHxWUEMVqNeHiGV2+jJdnyA MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 702647ae-428e-4902-2f5b-08d5b53f75ba X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-Network-Message-Id: 702647ae-428e-4902-2f5b-08d5b53f75ba X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2018 23:57:30.4246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT097 Subject: Re: [PATCH] MdePkg/BaseLib: Globally include ChkStk.c X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2018 23:57:34 -0000 Content-Language: de-DE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey Yao, As far as I am aware, all __chkstk does is access the stack in 4 KB interva= ls from the current location to the maximum requested location to eventuall= y hit the Windows Guard Page, which then triggers the stack increase. Because I do not know of any equivalent concept in edk2 and the intrinsic w= as already disabled for GCC, I supposed it was a good idea to do so globall= y. Are the potential issues I am not aware of? Thanks, Marvin. > -----Original Message----- > From: Yao, Jiewen > Sent: Wednesday, May 9, 2018 1:52 AM > To: Marvin.Haeuser@outlook.com; edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: RE: [PATCH] MdePkg/BaseLib: Globally include ChkStk.c >=20 > HI Marvin > Would you mind to share the information on how you test this update? >=20 >=20 > Per my experience, chkstk not only does the check but also does the real > work to allocate more stack. >=20 > /Gs can be used to indicate the size (/Gs[num] control stack checking cal= ls) >=20 > We use /Gs32768 by default, see tools_def.txt. >=20 > Usually, we just increase this value to override the default one, if we h= it this > issue. >=20 > Thank you > Yao Jiewen >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Marvin H?user > > Sent: Tuesday, May 8, 2018 4:37 PM > > To: edk2-devel@lists.01.org > > Cc: Gao, Liming > > Subject: Re: [edk2] [PATCH] MdePkg/BaseLib: Globally include ChkStk.c > > > > Hey Liming, > > > > According to the MSDN documentation, the call will be inserted for a > > stack usage past a defined threshold - 4 KB for IA32, 8 KB for X64 (sou= rce: > > https://msdn.microsoft.com/en-us/library/ms648426(v=3Dvs.85).aspx). > > > > Thanks, > > Marvin > > > > > -----Urspr=FCngliche Nachricht----- > > > Von: Gao, Liming > > > Gesendet: Montag, 7. Mai 2018 14:16 > > > An: Marvin.Haeuser@outlook.com; edk2-devel@lists.01.org > > > Cc: Kinney, Michael D > > > Betreff: RE: [PATCH] MdePkg/BaseLib: Globally include ChkStk.c > > > > > > Marvin: > > > In VS compiler, what case will trig this intrinsic function? > > > > > > Thanks > > > Liming > > > > -----Original Message----- > > > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On > > > > Behalf Of Marvin H?user > > > > Sent: Saturday, May 5, 2018 10:25 PM > > > > To: edk2-devel@lists.01.org > > > > Cc: Kinney, Michael D ; Gao, Liming > > > > > > > > Subject: [edk2] [PATCH] MdePkg/BaseLib: Globally include ChkStk.c > > > > > > > > Initially added for GCC build support, this patch includes the > > > > function for all compilers and all architectures. This is done as > > > > huge variables on the stack may cause the generation of calls to > > > > this intrinsic function for Microsoft compilers, even for the IA32 > > > > architecture, too. > > > > > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > > Signed-off-by: Marvin Haeuser > > > > --- > > > > MdePkg/Library/BaseLib/{ChkStkGcc.c =3D> ChkStk.c} | 48 > > > > ++++++++++------ > > > ---- > > > > MdePkg/Library/BaseLib/BaseLib.inf | 4 +- > > > > 2 files changed, 26 insertions(+), 26 deletions(-) > > > > > > > > diff --git a/MdePkg/Library/BaseLib/ChkStkGcc.c > > > > b/MdePkg/Library/BaseLib/ChkStk.c similarity index 74% rename from > > > > MdePkg/Library/BaseLib/ChkStkGcc.c > > > > rename to MdePkg/Library/BaseLib/ChkStk.c index > > > > ecba3853b159..59e6d73f9331 100644 > > > > --- a/MdePkg/Library/BaseLib/ChkStkGcc.c > > > > +++ b/MdePkg/Library/BaseLib/ChkStk.c > > > > @@ -1,24 +1,24 @@ > > > > -/** @file > > > > - Provides hack function for passng GCC build. > > > > - > > > > - Copyright (c) 2006 - 2008, Intel Corporation. All rights > > > > reserved.
> > > > - This program and the accompanying materials > > > > - are licensed and made available under the terms and conditions > > > > of the BSD License > > > > - which accompanies this distribution. The full text of the > > > > license may be found at > > > > - http://opensource.org/licenses/bsd-license.php. > > > > - > > > > - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS > IS" > > > > BASIS, > > > > - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > > EXPRESS OR IMPLIED. > > > > - > > > > -**/ > > > > - > > > > -#include "BaseLibInternals.h" > > > > - > > > > -/** > > > > - Hack function for passing GCC build. > > > > -**/ > > > > -VOID > > > > -__chkstk() > > > > -{ > > > > -} > > > > - > > > > +/** @file > > > > + Provides hack function for passing build. > > > > + > > > > + Copyright (c) 2006 - 2018, Intel Corporation. All rights > > > > + reserved.
This program and the accompanying materials are > > > > + licensed and made available under the terms and conditions of > > > > + the BSD License which accompanies this distribution. The full > > > > + text of the license may be found at > > > > + http://opensource.org/licenses/bsd- > > > license.php. > > > > + > > > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS > IS" > > > > + BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, > > > EITHER EXPRESS OR IMPLIED. > > > > + > > > > +**/ > > > > + > > > > +#include "BaseLibInternals.h" > > > > + > > > > +/** > > > > + Hack function for passing build. > > > > +**/ > > > > +VOID > > > > +__chkstk() > > > > +{ > > > > +} > > > > + > > > > diff --git a/MdePkg/Library/BaseLib/BaseLib.inf > > > > b/MdePkg/Library/BaseLib/BaseLib.inf > > > > index 5fbbd02a94b6..d23a6db2581a 100644 > > > > --- a/MdePkg/Library/BaseLib/BaseLib.inf > > > > +++ b/MdePkg/Library/BaseLib/BaseLib.inf > > > > @@ -1,7 +1,7 @@ > > > > ## @file > > > > # Base Library implementation. > > > > # > > > > -# Copyright (c) 2007 - 2016, Intel Corporation. All rights > > > > reserved.
> > > > +# Copyright (c) 2007 - 2018, Intel Corporation. All rights > > > > +reserved.
> > > > # Portions copyright (c) 2008 - 2009, Apple Inc. All rights > > > > reserved.
# Portions copyright (c) 2011 - 2013, ARM Ltd. All > > > > rights reserved.
# @@ -64,6 +64,7 @@ [Sources] > > > > SafeString.c > > > > String.c > > > > FilePaths.c > > > > + ChkStk.c > > > > BaseLibInternals.h > > > > > > > > [Sources.Ia32] > > > > @@ -781,7 +782,6 @@ [Sources.X64] > > > > X64/DisableCache.S | GCC > > > > X64/RdRand.nasm| GCC > > > > X64/RdRand.S | GCC > > > > - ChkStkGcc.c | GCC > > > > > > > > [Sources.IPF] > > > > Ipf/AccessGp.s > > > > -- > > > > 2.17.0.windows.1 > > > > > > > > _______________________________________________ > > > > edk2-devel mailing list > > > > edk2-devel@lists.01.org > > > > https://lists.01.org/mailman/listinfo/edk2-devel > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel