1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

Kernel: Actually zero-fill eagerly committed regions.

Previously, calling Region::commit() would make sure to allocate any missing
physical pages, but they would contain uninitialized data. This was very
obvious when allocating GraphicsBitmaps as they would have garbage pixels
rather than being filled with black.

The MM quickmap mechanism didn't work when operating on a non-active page
directory (which happens when we're in the middle of exec, for example.)
This patch changes quickmap to reside in the shared kernel page directory.

Also added some missing clobber lists to inline asm that I stumbled on.
This commit is contained in:
Andreas Kling 2019-01-31 03:57:06 +01:00
parent 6b88025dda
commit 0932efe72e
3 changed files with 47 additions and 28 deletions

View file

@ -217,7 +217,9 @@ public:
bool validate_user_read(const Process&, LinearAddress) const;
bool validate_user_write(const Process&, LinearAddress) const;
RetainPtr<PhysicalPage> allocate_physical_page();
enum class ShouldZeroFill { No, Yes };
RetainPtr<PhysicalPage> allocate_physical_page(ShouldZeroFill);
RetainPtr<PhysicalPage> allocate_supervisor_physical_page();
void remap_region(Process&, Region&);
@ -351,6 +353,7 @@ private:
HashTable<Region*> m_regions;
size_t m_ram_size { 0 };
bool m_quickmap_in_use { false };
};
struct ProcessPagingScope {