All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] The init_maps bug which cause mem map error
@ 2006-01-10 14:14 wang lianwei
  2006-01-10 23:39 ` Blaisorblade
  0 siblings, 1 reply; 5+ messages in thread
From: wang lianwei @ 2006-01-10 14:14 UTC (permalink / raw)
  To: jdike, user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

 There is a bug In file
    linux/arch/um/kernel/physmem.c  init_mem() functions:

*int* *init_maps*(*unsigned* *long* physmem, *unsigned* *long* iomem,
*unsigned* *long* highmem)
{
	*struct* page *p, *map;
	*unsigned* *long* phys_len, phys_pages, highmem_len, highmem_pages;
	*unsigned* *long* iomem_len, iomem_pages, total_len, total_pages;
	*int* i;

	phys_pages = physmem >> PAGE_SHIFT;
	phys_len = phys_pages * *sizeof*(*struct* page);

	iomem_pages = iomem >> PAGE_SHIFT;
	iomem_len = iomem_pages * *sizeof*(*struct* page);

	highmem_pages = highmem >> PAGE_SHIFT;
	highmem_len = highmem_pages * *sizeof*(*struct* page);

	total_pages = phys_pages + iomem_pages + highmem_pages;
	total_len = phys_len + iomem_pages + highmem_len;

	*if*(kmalloc_ok){
		map = kmalloc(total_len, GFP_KERNEL);
		*if*(map == NULL)
			map = vmalloc(total_len);
	}
	*else* map = alloc_bootmem_low_pages(total_len);

	*if*(map == NULL)
		*return*(-ENOMEM);

	*for*(i = 0; i < total_pages; i++){
		p = &map[i];
		set_page_count(p, 0);
		SetPageReserved(p);
		INIT_LIST_HEAD(&p->list);
	}

	mem_map = map;
	max_mapnr = total_pages;
	*return*(0);
}

this line should be

total_len = phys_len + iomem_len + highmem_len;


 <http://cvs.sourceforge.net/viewcvs.py/user-mode-linux/linux/#dirlist>

[-- Attachment #2: Type: text/html, Size: 2672 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-01-12  7:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-10 14:14 [uml-devel] The init_maps bug which cause mem map error wang lianwei
2006-01-10 23:39 ` Blaisorblade
2006-01-11 16:21   ` Jeff Dike
2006-01-11 15:52     ` Blaisorblade
2006-01-12  7:57       ` Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.