p_top must be set in process.c as well for bank16k
authorBrett Gordon <beretta42@gmail.com>
Mon, 22 Jun 2015 13:41:04 +0000 (09:41 -0400)
committerAlan Cox <alan@linux.intel.com>
Tue, 23 Jun 2015 21:28:42 +0000 (22:28 +0100)
I'm not exactly sure, but I think I found a bug in the bank16k
implementation.  When ptab_alloc() calls pagemap_alloc(), p_top is not
set yet.  pagemap_alloc, then proceeds to assign only one bank to the
new processes.  Assuming normal copy forking, should p_top be set to
the parent's p_top *before* calling pagemap_alloc() ?

This fix seems to make my coco3 UDATA mods start working

Kernel/process.c

index b9a4670..0020d74 100644 (file)
@@ -272,6 +272,7 @@ ptptr ptab_alloc(void)
                                    && p->p_pid == nextpid)
                                        newp->p_pid = 0;        /* try again */
                }
+               newp->p_top = udata.u_top;
                if (pagemap_alloc(newp) == 0) {
                        newp->p_status = P_FORKING;
                        nproc++;