diff --git a/repos/dde_rump/include/util/allocator_fap.h b/repos/dde_rump/include/util/allocator_fap.h index ba559add5..3f75526a4 100644 --- a/repos/dde_rump/include/util/allocator_fap.h +++ b/repos/dde_rump/include/util/allocator_fap.h @@ -21,8 +21,8 @@ #include namespace Allocator { - template class Backend_alloc; - template class Fap; + template class Backend_alloc; + template class Fap; } @@ -48,7 +48,7 @@ namespace Allocator { /** * Back-end allocator for Genode's slab allocator */ - template + template class Backend_alloc : public Genode::Allocator, public Genode::Rm_connection, public Genode::Region_map_client @@ -56,7 +56,7 @@ namespace Allocator { private: enum { - BLOCK_SIZE = 1024 * 1024, /* 1 MB */ + BLOCK_SIZE = 2 * 1024 * 1024, /* 2 MB */ ELEMENTS = VM_SIZE / BLOCK_SIZE, /* MAX number of dataspaces in VM */ }; @@ -193,7 +193,7 @@ namespace Allocator { /** * Interface */ - template + template class Fap { private: diff --git a/repos/dde_rump/src/lib/rump/hypercall.cc b/repos/dde_rump/src/lib/rump/hypercall.cc index fef8a934c..b8e8e38c4 100644 --- a/repos/dde_rump/src/lib/rump/hypercall.cc +++ b/repos/dde_rump/src/lib/rump/hypercall.cc @@ -22,7 +22,10 @@ #include #include -enum { SUPPORTED_RUMP_VERSION = 17 }; +enum { + SUPPORTED_RUMP_VERSION = 17, + MAX_VIRTUAL_MEMORY = (sizeof(void *) == 4 ? 256UL : 4096UL) * 1024 * 1024 +}; static bool verbose = false; @@ -170,6 +173,7 @@ int rumpuser_getparam(const char *name, void *buf, size_t buflen) } rump_ram -= RESERVE_MEM; + rump_ram = Genode::min((unsigned long)MAX_VIRTUAL_MEMORY, rump_ram); /* convert to string */ Genode::snprintf((char *)buf, buflen, "%zu", rump_ram); @@ -233,7 +237,7 @@ struct Allocator_policy }; -typedef Allocator::Fap<128 * 1024 * 1024, Allocator_policy> Rump_alloc; +typedef Allocator::Fap Rump_alloc; static Genode::Lock & alloc_lock() {