* [uml-devel] [PATCH v3] um: Print minimum physical memory requirement
@ 2015-04-03 14:51 Thomas Meyer
2015-04-04 6:50 ` Ron Yorston
2015-04-13 19:23 ` Richard Weinberger
0 siblings, 2 replies; 4+ messages in thread
From: Thomas Meyer @ 2015-04-03 14:51 UTC (permalink / raw)
To: user-mode-linux-devel
Print a more sensible message about the minimum physical memory
requirement.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 549ecf3..6f20626 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -57,22 +57,51 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
extern int __syscall_stub_start;
+/**
+ * setup_physmem() - Setup physical memory for UML
+ * @start: Start address of the physical kernel memory,
+ * i.e start address of the executable image.
+ * @reserve_end: end address of the physical kernel memory.
+ * @len: Length of total physical memory that should be mapped/made
+ * available, in bytes.
+ * @highmem: Number of highmem bytes that should be mapped/made available.
+ *
+ * Creates an unlinked temporary file of size (len + highmem) and memory maps
+ * it on the last executable image address (uml_reserved).
+ *
+ * The offset is needed as the length of the total physical memory
+ * (len + highmem) includes the size of the memory used be the executable image,
+ * but the mapped-to address is the last address of the executable image
+ * (uml_reserved == end address of executable image).
+ *
+ * The memory mapped memory of the temporary file is used as backing memory
+ * of all user space processes/kernel tasks.
+ */
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;
+ long map_size;
+ int err;
+
+ 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [uml-devel] [PATCH v3] um: Print minimum physical memory requirement
2015-04-03 14:51 [uml-devel] [PATCH v3] um: Print minimum physical memory requirement Thomas Meyer
@ 2015-04-04 6:50 ` Ron Yorston
2015-04-13 19:23 ` Richard Weinberger
1 sibling, 0 replies; 4+ messages in thread
From: Ron Yorston @ 2015-04-04 6:50 UTC (permalink / raw)
To: user-mode-linux-devel, thomas
Thomas Meyer wrote:
>+ printf("Too few physical memory! Needed=%d, given=%d\n",
I think 'Too little physical memory' would be more correct. Or maybe
'Insufficient physical memory'.
Ron
------------------------------------------------------------------------------
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [uml-devel] [PATCH v3] um: Print minimum physical memory requirement
2015-04-03 14:51 [uml-devel] [PATCH v3] um: Print minimum physical memory requirement Thomas Meyer
2015-04-04 6:50 ` Ron Yorston
@ 2015-04-13 19:23 ` Richard Weinberger
2015-04-13 20:37 ` Thomas Meyer
1 sibling, 1 reply; 4+ messages in thread
From: Richard Weinberger @ 2015-04-13 19:23 UTC (permalink / raw)
To: Thomas Meyer; +Cc: user-mode-linux-devel
On Fri, Apr 3, 2015 at 4:51 PM, Thomas Meyer <thomas@m3y3r.de> wrote:
> Print a more sensible message about the minimum physical memory
> requirement.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
All of your three patches are queued for 4.1! :-)
--
Thanks,
//richard
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [uml-devel] [PATCH v3] um: Print minimum physical memory requirement
2015-04-13 19:23 ` Richard Weinberger
@ 2015-04-13 20:37 ` Thomas Meyer
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Meyer @ 2015-04-13 20:37 UTC (permalink / raw)
To: Richard Weinberger; +Cc: user-mode-linux-devel
Thanks Richard :-)
With kind regards
Thomas
> Am 13.04.2015 um 21:23 schrieb Richard Weinberger <richard.weinberger@gmail.com>:
>
>> On Fri, Apr 3, 2015 at 4:51 PM, Thomas Meyer <thomas@m3y3r.de> wrote:
>> Print a more sensible message about the minimum physical memory
>> requirement.
>>
>> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
>
> All of your three patches are queued for 4.1! :-)
>
> --
> Thanks,
> //richard
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-13 20:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-03 14:51 [uml-devel] [PATCH v3] um: Print minimum physical memory requirement Thomas Meyer
2015-04-04 6:50 ` Ron Yorston
2015-04-13 19:23 ` Richard Weinberger
2015-04-13 20:37 ` Thomas Meyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox