mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernel: Don't truncate physical memory space PDE pointers
For some odd reason we used to return PhysicalPtr for a page_table_base result, but when setting it we accepted only a 32 bit value, so we truncated valid 64 bit addresses into 32 bit addresses by doing that. With this commit being applied, now PageDirectories can be located beyond the 4 GiB barrier. This was found by sin-ack, therefore he should be credited with this fix appropriately with Co-authored-by sign. Co-authored-by: sin-ack <sin-ack@users.noreply.github.com>
This commit is contained in:
parent
9cbae2b607
commit
f07e0180d6
Notes:
sideshowbarker
2024-07-17 06:09:05 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/f07e0180d6 Pull-request: https://github.com/SerenityOS/serenity/pull/15506
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ constexpr u32 DEVICE_MEMORY = (1 << 2);
|
|||
class PageDirectoryEntry {
|
||||
public:
|
||||
PhysicalPtr page_table_base() const { return PhysicalAddress::physical_page_base(m_raw); }
|
||||
void set_page_table_base(u32 value)
|
||||
void set_page_table_base(PhysicalPtr value)
|
||||
{
|
||||
m_raw &= 0xffff000000000fffULL;
|
||||
m_raw |= PhysicalAddress::physical_page_base(value);
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Kernel {
|
|||
class PageDirectoryEntry {
|
||||
public:
|
||||
PhysicalPtr page_table_base() const { return PhysicalAddress::physical_page_base(m_raw); }
|
||||
void set_page_table_base(u32 value)
|
||||
void set_page_table_base(PhysicalPtr value)
|
||||
{
|
||||
m_raw &= 0x8000000000000fffULL;
|
||||
m_raw |= PhysicalAddress::physical_page_base(value);
|
||||
|
|
Loading…
Reference in a new issue