1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:15:07 +00:00

Kernel: Use PAE to allow accessing all physical memory beyond 4GB

We already use PAE for the NX bit, but this changes the PhysicalAddress
structure to be able to hold 64 bit physical addresses. This allows us
to use all the available physical memory.
This commit is contained in:
Tom 2021-07-06 21:35:15 -06:00 committed by Andreas Kling
parent 658b41a06c
commit ad5d9d648b
7 changed files with 87 additions and 86 deletions

View file

@ -375,26 +375,18 @@ private:
kmalloc_stats stats;
get_kmalloc_stats(stats);
ScopedSpinLock mm_lock(s_mm_lock);
auto user_physical_pages_total = MM.user_physical_pages();
auto user_physical_pages_used = MM.user_physical_pages_used();
auto user_physical_pages_committed = MM.user_physical_pages_committed();
auto user_physical_pages_uncommitted = MM.user_physical_pages_uncommitted();
auto super_physical_total = MM.super_physical_pages();
auto super_physical_used = MM.super_physical_pages_used();
mm_lock.unlock();
auto system_memory = MemoryManager::the().get_system_memory_info();
JsonObjectSerializer<KBufferBuilder> json { builder };
json.add("kmalloc_allocated", stats.bytes_allocated);
json.add("kmalloc_available", stats.bytes_free);
json.add("kmalloc_eternal_allocated", stats.bytes_eternal);
json.add("user_physical_allocated", user_physical_pages_used);
json.add("user_physical_available", user_physical_pages_total - user_physical_pages_used);
json.add("user_physical_committed", user_physical_pages_committed);
json.add("user_physical_uncommitted", user_physical_pages_uncommitted);
json.add("super_physical_allocated", super_physical_used);
json.add("super_physical_available", super_physical_total - super_physical_used);
json.add("user_physical_allocated", system_memory.user_physical_pages_used);
json.add("user_physical_available", system_memory.user_physical_pages - system_memory.user_physical_pages_used);
json.add("user_physical_committed", system_memory.user_physical_pages_committed);
json.add("user_physical_uncommitted", system_memory.user_physical_pages_uncommitted);
json.add("super_physical_allocated", system_memory.super_physical_pages_used);
json.add("super_physical_available", system_memory.super_physical_pages - system_memory.super_physical_pages_used);
json.add("kmalloc_call_count", stats.kmalloc_call_count);
json.add("kfree_call_count", stats.kfree_call_count);
slab_alloc_stats([&json](size_t slab_size, size_t num_allocated, size_t num_free) {