core: don't use frame 0 for managing_system pd

When a PD owns the right to ask for a RAM dataspace's `dma_addr` it is
concurrently constrained to use allocations of a specific physical RAM area.
This commit further limits this area by removing RAM page frame zero.
Otherwise the return value of `dma_addr` for such a dataspace would be
erroneously interpreted as a fault, because zero is currently the error
return value of `dma_addr`.

Fix genodelabs/genode#4428
This commit is contained in:
Stefan Kalkowski 2022-02-16 11:33:51 +01:00 committed by Norman Feske
parent 429d078de7
commit 494f881f27

View File

@ -47,7 +47,11 @@ class Genode::Pd_root : public Genode::Root_component<Genode::Pd_session_compone
if (_managing_system(args) == Pd_session_component::Managing_system::DENIED) if (_managing_system(args) == Pd_session_component::Managing_system::DENIED)
return Ram_dataspace_factory::any_phys_range(); return Ram_dataspace_factory::any_phys_range();
addr_t const start = 0; /*
* Leave out first page because currently return value zero
* for dma_addr is recognized as a fault
*/
addr_t const start = 0x1000;
addr_t const end = (sizeof(long) == 4) /* 32bit arch ? */ addr_t const end = (sizeof(long) == 4) /* 32bit arch ? */
? 0xbfffffffUL : 0xffffffffUL; ? 0xbfffffffUL : 0xffffffffUL;