linux-um archives
 help / color / mirror / Atom feed
From: wang lianwei <lianwei.wang@gmail.com>
To: jdike@addtoit.com, user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] The init_maps bug which cause mem map error
Date: Tue, 10 Jan 2006 22:14:16 +0800	[thread overview]
Message-ID: <39134b110601100614o14112d19r@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2006-01-10 14:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-10 14:14 wang lianwei [this message]
2006-01-10 23:39 ` [uml-devel] The init_maps bug which cause mem map error Blaisorblade
2006-01-11 16:21   ` Jeff Dike
2006-01-11 15:52     ` Blaisorblade
2006-01-12  7:57       ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39134b110601100614o14112d19r@mail.gmail.com \
    --to=lianwei.wang@gmail.com \
    --cc=jdike@addtoit.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox