Re: [PATCH] x86: add boundary check for 32bit res before expand e820 resource to alignment -v2

Ingo Molnar
2009-07-03T08:06:43Z

* Yinghai Lu <yinghai@kernel.org> wrote:

> +#define MAX_RESOURCE_SIZE ((resource_size_t)-1)

> + end = round_up(start, ram_alignment(start)) - 1;
> + if (end > MAX_RESOURCE_SIZE)
> + end = MAX_RESOURCE_SIZE;

As Andrew noted it, this should probably have a comment along the
lines of:

/*
* Clip entries that go beyond our maximum resource
* awareness limit to the max. If we accepted them
* blindly we'd get random rounding artifacts and a
* possibly messed up resource tree and boot
* failures:
*/
if (end > MAX_RESOURCE_SIZE)
end = MAX_RESOURCE_SIZE;

Ingo