From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0714.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::714]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1A8C81A1E83 for ; Mon, 3 Oct 2016 09:29:26 -0700 (PDT) Received: from CS1PR84MB0119.NAMPRD84.PROD.OUTLOOK.COM (10.162.189.22) by CS1PR84MB0118.NAMPRD84.PROD.OUTLOOK.COM (10.162.189.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Mon, 3 Oct 2016 16:29:23 +0000 Received: from CS1PR84MB0119.NAMPRD84.PROD.OUTLOOK.COM ([10.162.189.22]) by CS1PR84MB0119.NAMPRD84.PROD.OUTLOOK.COM ([10.162.189.22]) with mapi id 15.01.0649.021; Mon, 3 Oct 2016 16:29:23 +0000 From: "Shia, Cinnamon" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Shia, Cinnamon" Thread-Topic: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table header Thread-Index: AQHSHZFKdmCZm0r4J0+FfbyL5n6NJqCW6s4AgAAAguA= Date: Mon, 3 Oct 2016 16:29:23 +0000 Message-ID: References: <20161003161411.7696-1-cinnamon.shia@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=cinnamon.shia@hpe.com; x-originating-ip: [124.155.180.249] x-ms-office365-filtering-correlation-id: 88f74d8c-7b85-434d-339a-08d3ebaa6fab x-microsoft-exchange-diagnostics: 1; CS1PR84MB0118; 7:Jr8vEb1E0FxQ0E0ruwBVR1NM5uFNAVnWcd1Gb65pC6xc//xC2vm/v6nAifywkFmmbQMIJRs2ojnHFGKaYOp6O2dCsHZsDwJLuMhSXRDE4E65SxdscRn02rv5yaTZltU3UWf4USCY8fPq6hCr/KsSBr+qVWGrUPhm99K2oFEatml2f0c682nCN93ajCs3xYbu8F+22YJ6C+L4d4DVM6z6rTCdMp6wguxQ3CsWFSNeSLxqxT6U+Sl1oSgsvzlbxQMUGmLsssjeQlp2e7Ovi93j7KsQVDOu5ekDOrXXXpTUDfzZ6dUzQgY803YLLFhi9RsZV1UEKJYqxWj+8BPW079T+Q== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0118; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:CS1PR84MB0118; BCL:0; PCL:0; RULEID:; SRVR:CS1PR84MB0118; x-forefront-prvs: 008421A8FF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(13464003)(377454003)(189002)(199003)(586003)(74316002)(7846002)(92566002)(4326007)(2906002)(2900100001)(106356001)(3280700002)(99286002)(305945005)(2501003)(106116001)(105586002)(7736002)(66066001)(19580395003)(19580405001)(7696004)(3660700001)(77096005)(5660300001)(10400500002)(122556002)(81166006)(8676002)(81156014)(5002640100001)(15650500001)(5001770100001)(2950100002)(11100500001)(189998001)(33656002)(86362001)(68736007)(101416001)(9686002)(6116002)(3846002)(50986999)(97736004)(54356999)(8936002)(76176999)(87936001)(102836003); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR84MB0118; H:CS1PR84MB0119.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2016 16:29:23.6457 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0118 Subject: Re: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table header X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 16:29:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Oops. Will fix it in diff v2. Thanks, Cinnamon Shia -----Original Message----- From: Carsey, Jaben [mailto:jaben.carsey@intel.com]=20 Sent: Tuesday, October 4, 2016 12:27 AM To: Shia, Cinnamon ; edk2-devel@lists.01.org Cc: Ni, Ruiyu ; Carsey, Jaben Subject: RE: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table h= eader Why add a CpuBreakPoint()? > -----Original Message----- > From: Cinnamon Shia [mailto:cinnamon.shia@hpe.com] > Sent: Monday, October 03, 2016 9:14 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Ni, Ruiyu=20 > ; Cinnamon Shia > Subject: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table=20 > header > Importance: High >=20 > Update CRC32 in the EFI System Table header after shell changes the=20 > value of gST->ConsoleOutHandle and gST->ConOut >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Cinnamon Shia > --- > ShellPkg/Application/Shell/ConsoleLogger.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) >=20 > diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c > b/ShellPkg/Application/Shell/ConsoleLogger.c > index 9b64303..07b3f81 100644 > --- a/ShellPkg/Application/Shell/ConsoleLogger.c > +++ b/ShellPkg/Application/Shell/ConsoleLogger.c > @@ -3,6 +3,7 @@ >=20 > (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
> Copyright (c) 2009 - 2015, Intel Corporation. All rights=20 > reserved.
> + (C) Copyright 2016 Hewlett-Packard Development Company, L.P.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of=20 > the BSD License > which accompanies this distribution. The full text of the license=20 > may be found at @@ -91,6 +92,16 @@ ConsoleLoggerInstall( > gST->ConsoleOutHandle =3D gImageHandle; > gST->ConOut =3D &(*ConsoleInfo)->OurConOut; >=20 > + // > + // Update the CRC32 in the EFI System Table header // =20 > + CpuBreakpoint(); > + gST->Hdr.CRC32 =3D 0; > + gBS->CalculateCrc32 ( > + (UINT8 *)&gST->Hdr, > + gST->Hdr.HeaderSize, > + &gST->Hdr.CRC32 > + ); > return (Status); > } >=20 > @@ -126,6 +137,16 @@ ConsoleLoggerUninstall( > gST->ConsoleOutHandle =3D ConsoleInfo->OldConHandle; > gST->ConOut =3D ConsoleInfo->OldConOut; >=20 > + // > + // Update the CRC32 in the EFI System Table header // > + gST->Hdr.CRC32 =3D 0; > + gBS->CalculateCrc32 ( > + (UINT8 *)&gST->Hdr, > + gST->Hdr.HeaderSize, > + &gST->Hdr.CRC32 > + ); > + > return (gBS->UninstallProtocolInterface(gImageHandle, > &gEfiSimpleTextOutProtocolGuid, (VOID*)&ConsoleInfo->OurConOut)); } >=20 > -- > 2.10.0.windows.1