From b56c090678f79a5fe49bceb5e274291a803d7177 Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Thu, 2 May 2013 11:00:30 +0900 Subject: [PATCH] FIX Bug 1 - mckernel aborts due to out of memory access after several mcexec invocations --- kernel/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/host.c b/kernel/host.c index b0514123..7ec4d70c 100644 --- a/kernel/host.c +++ b/kernel/host.c @@ -49,7 +49,7 @@ static void process_msg_prepare_process(unsigned long rphys) sz = sizeof(struct program_load_desc) + sizeof(struct program_image_section) * 16; - npages = (sz + PAGE_SIZE - 1) >> PAGE_SHIFT; + npages = (rphys + sz - 1) >> PAGE_SHIFT - rphys >> PAGE_SHIFT + 1; phys = ihk_mc_map_memory(NULL, rphys, sz); p = ihk_mc_map_virtual(phys, npages, PTATTR_WRITABLE);