um: Print minimum physical memory requirement
PATCH v2 1/1 um: Print minimum physical memory requirement
Print a more sensible message about the minimum physical memory requirement.
---
arch/um/kernel/physmem.c +14 -6
@@ -61,18 +61,26 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, unsigned long len, unsigned long long highmem) {unsigned long reserve = reserve_end - start; -int pfn =PFN_UP (__pa (reserve_end)); -int delta = (len - reserve) >>PAGE_SHIFT ; -int err, offset, bootmap_size; +unsigned long pfn =PFN_UP (__pa (reserve_end)); +unsigned long delta = (len - reserve) >>PAGE_SHIFT ; +unsigned long offset, bootmap_size; +int err, map_size; + + offset = uml_reserved - uml_physmem; + map_size = len - offset; +if (map_size <=0 ) { +printf ("Too few physical memory! Needed=%d, given=%d\n" , + offset, len); +exit (1 ); + } physmem_fd =create_mem_file (len + highmem); - offset = uml_reserved - uml_physmem; err =os_map_memory ((void *) uml_reserved, physmem_fd, offset, - len - offset,1 ,1 ,1 ); + map_size,1 ,1 ,1 );if (err <0 ) {printf ("setup_physmem - mapping %ld bytes of memory at 0x%p " -"failed - errno = %d\n" , len - offset, +"failed - errno = %d\n" , map_size, (void *) uml_reserved, err);exit (1 ); }
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
arch/um/kernel/physmem.c void __init setup_physmem(unsigned long start, unsigned long reserve_end, · line 67
Quoted 13 lines · Thomas Meyer
arch/um/kernel/physmem.c +4
-3@@ -61,18 +61,26 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, unsigned long len, unsigned long long highmem) {unsigned long reserve = reserve_end - start; -int pfn =PFN_UP (__pa (reserve_end)); -int delta = (len - reserve) >>PAGE_SHIFT ; -int err, offset, bootmap_size; +unsigned long pfn =PFN_UP (__pa (reserve_end)); +unsigned long delta = (len - reserve) >>PAGE_SHIFT ; +unsigned long offset, bootmap_size; +int err, map_size;
map_size should be unsigned long.
Quoted 3 lines
arch/um/kernel/physmem.c +3
-0+ + offset = uml_reserved - uml_physmem; + map_size = len - offset;
Signature · 10 lines
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus TorvaldsAm Freitag, den 03.04.2015, 15:17 +0200 schrieb Geert Uytterhoeven:
Quoted 8 lines · Thomas Meyer
Quoted 7 lines
arch/um/kernel/physmem.c +0
-1@@ -61,18 +61,26 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, unsigned long len, unsigned long long highmem) {unsigned long reserve = reserve_end - start; -int pfn =PFN_UP (__pa (reserve_end));
Quoted 8 lines
arch/um/kernel/physmem.c void __init setup_physmem(unsigned long start, unsigned long reserve_end, · line 67
Quoted 6 lines
arch/um/kernel/physmem.c +4
-2-int delta = (len - reserve) >>PAGE_SHIFT ; -int err, offset, bootmap_size; +unsigned long pfn =PFN_UP (__pa (reserve_end)); +unsigned long delta = (len - reserve) >>PAGE_SHIFT ; +unsigned long offset, bootmap_size; +int err, map_size;
map_sizeshould be unsigned long.
No, this can actually get negative as the memory size needed by the executable file (linux) can be bigger then the physical memory assigned to the kernel via "mem=xxx" command line!
Quoted 8 lines
Quoted 4 lines
arch/um/kernel/physmem.c +3
-0+ + offset = uml_reserved - uml_physmem; + map_size = len - offset;
Quoted 18 lines · Thomas Meyer
Am Freitag, den 03.04.2015, 15:17 +0200 schrieb Geert Uytterhoeven:
Quoted 8 lines · Thomas Meyer
Quoted 7 lines
arch/um/kernel/physmem.c +0
-1@@ -61,18 +61,26 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, unsigned long len, unsigned long long highmem) {unsigned long reserve = reserve_end - start; -int pfn =PFN_UP (__pa (reserve_end));Quoted 8 lines
arch/um/kernel/physmem.c void __init setup_physmem(unsigned long start, unsigned long reserve_end, · line 67
Quoted 6 lines
arch/um/kernel/physmem.c +4
-2-int delta = (len - reserve) >>PAGE_SHIFT ; -int err, offset, bootmap_size; +unsigned long pfn =PFN_UP (__pa (reserve_end)); +unsigned long delta = (len - reserve) >>PAGE_SHIFT ; +unsigned long offset, bootmap_size; +int err, map_size;
map_sizeshould be unsigned long.
Quoted 3 lines
No, this can actually get negative as the memory size needed by the executable file (linux) can be bigger then the physical memory assigned to the kernel via "mem=xxx" command line!
In that case it should be (signed) long.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds