[EXTERNAL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg/ReportStatusCodeRouter: Update RSC Data on reallocation

Bret Barkelew via groups.io bret.barkelew=microsoft.com at groups.io
Thu Apr 9 00:17:15 UTC 2020


Reviewed-by: Bret Barkelew <bret.barkelew at microsoft.com>

- Bret

________________________________
From: devel at edk2.groups.io <devel at edk2.groups.io> on behalf of Michael Kubacki via groups.io <michael.kubacki=outlook.com at groups.io>
Sent: Wednesday, April 8, 2020 5:04:47 PM
To: devel at edk2.groups.io <devel at edk2.groups.io>
Cc: Dandan Bi <dandan.bi at intel.com>; Hao A Wu <hao.a.wu at intel.com>; Jian J Wang <jian.j.wang at intel.com>; Kun Qin <Kun.Qin at microsoft.com>; Liming Gao <liming.gao at intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg/ReportStatusCodeRouter: Update RSC Data on reallocation

From: Michael Kubacki <michael.kubacki at microsoft.com>

REF:https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2670&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C2e4ff7c2044249c511d508d7dc19b4d6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637219875272310417&sdata=X3sHY%2FqCF8n17zMZ0FJMAluQODc%2F1gI9WRi%2BmBUfb5Q%3D&reserved=0

The RSC router data buffer may be reallocated when the buffer is nearing
exhaustion (7/8 portion of the buffer used).

While several pointers are updated to point to the newly allocated buffer,
the RscData is not updated. This commit updates the RSC data pointer
to the same offset in the reallocated data buffer.

Cc: Dandan Bi <dandan.bi at intel.com>
Cc: Hao A Wu <hao.a.wu at intel.com>
Cc: Jian J Wang <jian.j.wang at intel.com>
Cc: Kun Qin <Kun.Qin at microsoft.com>
Cc: Liming Gao <liming.gao at intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki at microsoft.com>
---
 MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
index 6ca7e180ebb3..82fa2e025466 100644
--- a/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
+++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.c
@@ -3,6 +3,7 @@
   and Status Code Runtime Protocol.

   Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -286,6 +287,7 @@ ReportDispatcher (
                       );
         if (NewBuffer != NULL) {
           CallbackEntry->EndPointer = (EFI_PHYSICAL_ADDRESS) (UINTN) NewBuffer + (CallbackEntry->EndPointer - CallbackEntry->StatusCodeDataBuffer);
+          RscData = (RSC_DATA_ENTRY *) (UINTN) ((UINTN) NewBuffer + ((UINTN) RscData - CallbackEntry->StatusCodeDataBuffer));
           CallbackEntry->StatusCodeDataBuffer = (EFI_PHYSICAL_ADDRESS) (UINTN) NewBuffer;
           CallbackEntry->BufferSize *= 2;
         }
--
2.16.3.windows.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57091): https://edk2.groups.io/g/devel/message/57091
Mute This Topic: https://groups.io/mt/72887264/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20200409/eb857895/attachment.htm>


More information about the edk2-devel-archive mailing list