Lean Sheng Tan submitted this change.

View Change



18 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: Nico Huber: Looks good to me, but someone else must approve build bot (Jenkins): Verified Lean Sheng Tan: Looks good to me, approved Shuo Liu: Looks good to me, but someone else must approve
device/Kconfig: Add an option to allocate above 4G by default

Historically resource allocation in coreboot was 32bit x86 thing. To
remain compatible with this behavior (e.g. to keep 32bit payloads
happy), resource allocation limits resources to 32 bits unless
explicitly overridden. However this behavior is not always appropriate:
e.g. on non x86 platforms the PCIe mem decode window could be above 4G.
Another case on x86 is where the decode window(s) below 4G are not
adequate for fitting all resources and the payload is 64bit
capable (e.g. Linux).

This adds a Kconfig flag to override the behavior to limit resources to
32bit by default and to allocate resources according to the real
hardware limits.

TEST=intel/archercity CRB

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I01218a8a3efc4a5f8ba344808949ca6b8898525f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78331
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
---
M src/device/Kconfig
M src/device/resource_allocator_v4.c
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/device/Kconfig b/src/device/Kconfig
index 83afa8c..374427a 100644
--- a/src/device/Kconfig
+++ b/src/device/Kconfig
@@ -1005,6 +1005,13 @@
undeclared resources. EDK2 is currently reported to also have
problems on some platforms, at least with Intel's IGD.

+config ALWAYS_ALLOW_ABOVE_4G_ALLOCATION
+ bool
+ default n if ARCH_X86
+ default y
+ help
+ Don't limit mem resources to 4G, but to their actual limit.
+
config XHCI_UTILS
def_bool n
help
diff --git a/src/device/resource_allocator_v4.c b/src/device/resource_allocator_v4.c
index 96d4488..73ec9c1 100644
--- a/src/device/resource_allocator_v4.c
+++ b/src/device/resource_allocator_v4.c
@@ -84,6 +84,9 @@

static resource_t effective_limit(const struct resource *const res)
{
+ if (CONFIG(ALWAYS_ALLOW_ABOVE_4G_ALLOCATION))
+ return res->limit;
+
/* Always allow bridge resources above 4G. */
if (res->flags & IORESOURCE_BRIDGE)
return res->limit;

To view, visit change 78331. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I01218a8a3efc4a5f8ba344808949ca6b8898525f
Gerrit-Change-Number: 78331
Gerrit-PatchSet: 20
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Chen, Gang C <gang.c.chen@intel.com>
Gerrit-Reviewer: Jincheng Li <jincheng.li@intel.com>
Gerrit-Reviewer: Lean Sheng Tan <sheng.tan@9elements.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Reviewer: Shuo Liu <shuo.liu@intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged