From e8f7fbc682782f9e35480fce37f3b715451c1f44 Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Thu, 9 May 2013 10:12:30 +0900 Subject: [PATCH] FIX Bug 1 - mckernel aborts due to out of memory access after several mcexec --- kernel/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/host.c b/kernel/host.c index 7ec4d70c..4e080bb0 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 = (rphys + sz - 1) >> PAGE_SHIFT - rphys >> PAGE_SHIFT + 1; + 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);