summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2021-01-13 09:54:53 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-19 18:23:28 +0000
commit6e5586863148773c15399ead249711143a74d2d0 (patch)
tree6f329eb09c6c0b7feff2626039632ca3d11684d4 /ArmVirtPkg
parentd3f3c942013a6f1c6bde7ba6ca41ca97bab51663 (diff)
downloadedk2-6e5586863148773c15399ead249711143a74d2d0.tar.gz
edk2-6e5586863148773c15399ead249711143a74d2d0.tar.bz2
edk2-6e5586863148773c15399ead249711143a74d2d0.zip
ArmVirtPkg: disable list length checks in NOOPT and DEBUG builds
In NOOPT and DEBUG builds, if "PcdMaximumLinkedListLength" is nonzero, then several LIST_ENTRY *node* APIs in BaseLib compare the *full* list length against the PCD. This turns the time complexity of node-level APIs from constant to linear, and that of full-list manipulations from linear to quadratic. (See some example OVMF numbers in the previous patch.) Checking list lengths against an arbitrary maximum -- default value, and current ArmVirtPkg setting: 1,000,000 -- seems useless even in NOOPT and DEBUG builds, while the cost is significant; so set the PCD to 0. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Julien Grall <julien@xen.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3152 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Message-Id: <20210113085453.10168-11-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'ArmVirtPkg')
-rw-r--r--ArmVirtPkg/ArmVirt.dsc.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 9ec9293047..d9abadbe70 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -290,7 +290,7 @@
[PcdsFixedAtBuild.common]
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|0
gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout|10000000
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320