kernel: default flexible memory to 448 MiB and charge loaded modules' segments to it

This commit is contained in:
Claxten
2026-10-26 15:38:20 +01:00
committed by nmzik
parent 2483573651
commit 0a140911ad
5 changed files with 84 additions and 3 deletions
+4
View File
@@ -21,6 +21,7 @@ struct EntryParams {
};
class Elf64;
struct Elf64_Phdr;
struct Elf64_Sym;
struct Elf64_Rela;
class RuntimeLinker;
@@ -128,6 +129,7 @@ struct Program {
uint64_t base_size = 0;
uint64_t base_size_aligned = 0;
uint64_t mapped_size = 0;
uint64_t flexible_size = 0;
uint64_t instruction_trampoline_size = 0;
std::unique_ptr<SymbolDatabase> export_symbols;
std::unique_ptr<SymbolDatabase> import_symbols;
@@ -203,6 +205,8 @@ private:
application_heap_posix_memalign_func_t m_application_heap_posix_memalign = nullptr;
};
uint64_t CalcFlexibleMemorySize(const Elf64_Phdr* phdr, uint16_t phnum);
#if defined(KYTY_VIRTUAL_MEMORY_ALLOCATION_TESTS)
bool TestMainEntryUsesGuestStack();
bool TestModuleRelocationUsesWritableHostMapping();