[coreboot] [PATCH]The resource allocator does not like zero-sized fixed resources

Myles Watson mylesgw at gmail.com
Wed Aug 19 19:08:56 CEST 2009

> Am 19.08.2009 18:18, schrieb Myles Watson:
> > The problem is that they have bogus limits, not that they have no
> > size.
> A zero-sized resource with proper limits still fails. See:
> /* Is it already outside the limits? */
> if (res->size && (((res->base + res->size -1) < lim->base) || (res->base
>  > lim->limit)))
>      continue;
You're right.  It's obvious that I haven't been thinking about this much
lately.  So we can commit your patch that ignores fixed resources of size 0.

The example you gave in src/devices/pci_device.c was for the old way of
specifying PCI ROM locations.  Now that CBFS is going mainstream, that
should disappear.  If it doesn't, I think it should have a size.  Even 1
would work, since no Option ROM can be smaller than that.

What other fixed resources have 0 size, especially on Kontron?  I'd like to
fix the root cause.

> A resource with size == 0 is never "outside the limits". The code after
> these lines assumes that any resource that passes this test is inside
> the limits.
> >   Even if you commit this fix, you should fix the incorrect
> > limits.  They are two different problems.
> >
> A fixed resource is supposed to have base+size=limit, with base and size
> of the right alignment and granularity, right?
No.  limit = architectural limit. 0xffff or 0xffffffff usually.


More information about the coreboot mailing list