Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41466 )
Change subject: device: Enable resource allocation above 4G boundary with allocator v4 ......................................................................
Patch Set 4:
Patch Set 4:
So, what was I'm going to say. No matter if we handle above 4G as an opt-in or an opt-out, I would prefer us to find a solution that doesn't need a quirk (yet another flag). Allocating top-down and using the `.limit` as opt-out could provide that, IMO.
In my opinion, it's better to have an explicit flag than reusing the limit field for this. Limit field for discoverable resources of a device gets set based on the driver for that device. Example: PCI driver using its own mechanism sets the limit for the resources. Now, this driver can be common and used by all device resources that are discoverable by PCI specification.
In this case, we will have a mix of resource that will have limits set to either below or above 4G. If we were to reuse the limit field for deciding whether to allocate above or below 4G, then every device will need its own driver that can do the post-processing after pci read resource is done to set the limit correctly. Yes, we can enable helpers to always limit below 4G unless a device driver requires it. But, I don't like the idea of changing the limits from what they really are as advertised by the devices going into the allocator(i.e. before doing the allocation).
Instead having a separate flag makes it pretty clear what the device really provided as its requirement and what the device driver wants and the allocator can take action based on that.