[PATCH 1/2] memtest: fix 4GB overflow fail
Sascha Hauer
s.hauer at pengutronix.de
Tue Jan 27 00:10:46 PST 2015
On Mon, Jan 26, 2015 at 02:09:03PM +0300, Dmitry Lavnikevich wrote:
> On 26/01/15 12:09, Sascha Hauer wrote:
> >(Adding Alexander Aring)
> >@@ -107,8 +106,8 @@ static int request_memtest_regions(struct list_head *list)
> > r = list_last_entry(&bank->res->children,
> > struct resource, sibling);
> > start = PAGE_ALIGN(r->end);
> still here we have overflow.
> Last region (stack) on 4GB systems ends on 0xfffffff7. So aligned
> up, start=0x00000000.
> After that
> >- end = PAGE_ALIGN_DOWN(bank->res->end) - 1;
> >- size = end - start + 1;
> >+ end = bank->res->end;
> >+ size = PAGE_ALIGN_DOWN(end - start + 1);
> > if (start < end) {
> This check detects that there are some space after last region
> (start=0x00000000) till end of bank (0xffffffff) and then
> > ret = alloc_memtest_region(list, start, size);
> > if (ret < 0)
> fails to allocate region from 0x00000000 for size 0x00000000.
Ok, so your original patch is still necessary. I applied both my patch
and yours to -next.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list