bank8k: allow for no zero base
authorAlan Cox <alan@linux.intel.com>
Tue, 8 Jan 2019 17:02:53 +0000 (17:02 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 8 Jan 2019 17:02:53 +0000 (17:02 +0000)
Tormod's patch worked by changing pagemap_realloc to pass top not size. In
fact we want to pass size so that

- We don't break any other banking code
- We can still sanely handle platforms with multiple processes per bank where
  pagemap_realloc has a real job. It's not quite that simple there are some
  other 32bit changes it would need, but lets not dig a hole to fall down

Kernel/bank8k.c

index e482b3e..9b291fc 100644 (file)
@@ -216,7 +216,7 @@ int pagemap_alloc(ptptr p)
 int pagemap_realloc(usize_t code, usize_t size, usize_t stack)
 {
        int8_t have = maps_needed(udata.u_top);
-       int8_t want = maps_needed(size);
+       int8_t want = maps_needed(size + MAPBASE);
        uint8_t *ptr = (uint8_t *)udata.u_page;
        int i;