Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41443 )
Change subject: device: Add support for resource allocator v4 ......................................................................
Patch Set 7: Code-Review+1
(1 comment)
Looks good to me, I'll try to read through everything again after some sleep :)
https://review.coreboot.org/c/coreboot/+/41443/6/src/device/resource_allocat... File src/device/resource_allocator_v4.c:
https://review.coreboot.org/c/coreboot/+/41443/6/src/device/resource_allocat... PS6, Line 272: mark_resource_invalid(resource);
IORESOURCE_ASSIGNED: Resource is allocated space by the allocator. If allocation fails, IORESOURCE_ASSIGNED will not be set and all resource attributes(base, limit, size) will be left untouched.
That's a bit too tight, IMHO. For instance the old allocator changed `base` already in the first pass (and I think this could actually be useful, e.g. to optimize the second largest-resource run away). Let's just say, if IORESOURCE_ASSIGNED is set, `base` is valid? And not make assumptions when it's unset.