summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-28 13:19:02 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-28 13:26:35 +0200
commitb1f537b5e058512a263036b74d3b755301adaf96 (patch)
treeaffed955ed63f6418039130be91133d5cea55f88
parentdbf96c4953a2acf193c7804f3853eddd92a66f65 (diff)
linux block: allow loading data up to 4GiB limit
Linux drivers are only limited by the DMA32 constraint, not by the directmap constraint. But our segment order is currently set to DMA < DMA32 < DIRECTMAP < HIGHMEM (since that is what we will have in 64bit mode). In PAE mode this makes DMA32 limited to 800MiB. Ideally we'd have DMA < DIRECTMAP < DMA32 < HIGHMEM but that'd make the memory code more complex, and we are to remove the Linux drivers anyway. In the meanwhile, In non-PAE mode we can just use HIGHMEM which is already limited to 4GiB, that will do the work. * linux/dev/glue/block.c (VM_PAGE_LINUX): New macro. (device_read): Use VM_PAGE_LINUX instead of VM_PAGE_DMA32.
-rw-r--r--linux/dev/glue/block.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c
index 709a8572..6730c5ec 100644
--- a/linux/dev/glue/block.c
+++ b/linux/dev/glue/block.c
@@ -84,6 +84,13 @@
#include <linux/dev/glue/glue.h>
+#ifdef PAE
+#warning TODO: make DMA32 between DIRECTMAP and HIGHMEM
+#define VM_PAGE_LINUX VM_PAGE_DMA32
+#else
+#define VM_PAGE_LINUX VM_PAGE_HIGHMEM
+#endif
+
/* This task queue is not used in Mach: just for fixing undefined symbols. */
DECLARE_TASK_QUEUE (tq_disk);
@@ -1525,7 +1532,7 @@ device_read (void *d, ipc_port_t reply_port,
/* Allocate and map pages. */
while (alloc_offset < trunc_page (offset) + len)
{
- while ((m = vm_page_grab (VM_PAGE_DMA32)) == 0)
+ while ((m = vm_page_grab (VM_PAGE_LINUX)) == 0)
VM_PAGE_WAIT (0);
assert (! m->active && ! m->inactive);
m->busy = TRUE;