2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2018-10-17 23:13:55 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2021-05-16 02:36:52 -07:00
|
|
|
#include <AK/Concepts.h>
|
2019-05-28 11:53:16 +02:00
|
|
|
#include <AK/HashTable.h>
|
2021-07-12 22:52:17 +02:00
|
|
|
#include <AK/NonnullOwnPtrVector.h>
|
2019-06-27 13:34:28 +02:00
|
|
|
#include <AK/NonnullRefPtrVector.h>
|
2019-11-29 16:15:30 +01:00
|
|
|
#include <AK/String.h>
|
2021-06-21 17:34:09 +02:00
|
|
|
#include <Kernel/Arch/x86/PageFault.h>
|
2021-07-11 11:49:16 +02:00
|
|
|
#include <Kernel/Arch/x86/TrapFrame.h>
|
2020-02-16 01:50:16 +01:00
|
|
|
#include <Kernel/Forward.h>
|
2021-08-22 01:37:17 +02:00
|
|
|
#include <Kernel/Locking/Spinlock.h>
|
2021-08-06 10:45:34 +02:00
|
|
|
#include <Kernel/Memory/AllocationStrategy.h>
|
|
|
|
|
#include <Kernel/Memory/PhysicalPage.h>
|
|
|
|
|
#include <Kernel/Memory/PhysicalRegion.h>
|
|
|
|
|
#include <Kernel/Memory/Region.h>
|
|
|
|
|
#include <Kernel/Memory/VMObject.h>
|
2018-10-18 13:05:00 +02:00
|
|
|
|
2021-08-06 13:49:36 +02:00
|
|
|
namespace Kernel::Memory {
|
2020-02-16 01:27:42 +01:00
|
|
|
|
2021-02-14 09:57:19 +01:00
|
|
|
constexpr bool page_round_up_would_wrap(FlatPtr x)
|
|
|
|
|
{
|
2021-06-28 18:58:23 +02:00
|
|
|
return x > (explode_byte(0xFF) & ~0xFFF);
|
2021-02-14 09:57:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr FlatPtr page_round_up(FlatPtr x)
|
|
|
|
|
{
|
|
|
|
|
FlatPtr rounded = (((FlatPtr)(x)) + PAGE_SIZE - 1) & (~(PAGE_SIZE - 1));
|
2021-06-28 18:58:23 +02:00
|
|
|
// Rounding up >0xfffff000 wraps back to 0. That's never what we want.
|
2021-02-23 20:42:32 +01:00
|
|
|
VERIFY(x == 0 || rounded != 0);
|
2021-02-14 09:57:19 +01:00
|
|
|
return rounded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr FlatPtr page_round_down(FlatPtr x)
|
|
|
|
|
{
|
|
|
|
|
return ((FlatPtr)(x)) & ~(PAGE_SIZE - 1);
|
|
|
|
|
}
|
2019-01-13 00:27:25 +01:00
|
|
|
|
2021-06-17 13:05:37 +02:00
|
|
|
inline FlatPtr virtual_to_low_physical(FlatPtr virtual_)
|
2020-01-17 19:59:20 +01:00
|
|
|
{
|
2021-07-22 13:05:04 +02:00
|
|
|
return virtual_ - physical_to_virtual_offset;
|
2020-01-17 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
2021-08-06 23:42:53 +02:00
|
|
|
enum class UsedMemoryRangeType {
|
2021-01-19 19:13:03 +01:00
|
|
|
LowMemory = 0,
|
2021-07-18 19:39:33 +02:00
|
|
|
Prekernel,
|
2021-01-19 19:13:03 +01:00
|
|
|
Kernel,
|
|
|
|
|
BootModule,
|
2021-07-07 19:50:05 -06:00
|
|
|
PhysicalPages,
|
2021-01-19 19:13:03 +01:00
|
|
|
};
|
|
|
|
|
|
2021-08-06 23:42:53 +02:00
|
|
|
static constexpr StringView UserMemoryRangeTypeNames[] {
|
2021-01-19 19:13:03 +01:00
|
|
|
"Low memory",
|
2021-07-18 19:39:33 +02:00
|
|
|
"Prekernel",
|
2021-01-19 19:13:03 +01:00
|
|
|
"Kernel",
|
|
|
|
|
"Boot module",
|
2021-07-07 19:50:05 -06:00
|
|
|
"Physical Pages"
|
2021-01-19 19:13:03 +01:00
|
|
|
};
|
|
|
|
|
|
2021-08-06 23:42:53 +02:00
|
|
|
struct UsedMemoryRange {
|
|
|
|
|
UsedMemoryRangeType type {};
|
2021-01-19 19:13:03 +01:00
|
|
|
PhysicalAddress start;
|
|
|
|
|
PhysicalAddress end;
|
|
|
|
|
};
|
|
|
|
|
|
2021-08-06 23:42:53 +02:00
|
|
|
struct ContiguousReservedMemoryRange {
|
2021-01-29 14:03:25 +02:00
|
|
|
PhysicalAddress start;
|
2021-07-06 21:35:15 -06:00
|
|
|
PhysicalSize length {};
|
2021-01-29 14:03:25 +02:00
|
|
|
};
|
|
|
|
|
|
2021-08-06 23:42:53 +02:00
|
|
|
enum class PhysicalMemoryRangeType {
|
2021-01-29 14:03:25 +02:00
|
|
|
Usable = 0,
|
|
|
|
|
Reserved,
|
|
|
|
|
ACPI_Reclaimable,
|
|
|
|
|
ACPI_NVS,
|
|
|
|
|
BadMemory,
|
2021-02-11 22:02:39 +01:00
|
|
|
Unknown,
|
2021-01-29 14:03:25 +02:00
|
|
|
};
|
|
|
|
|
|
2021-08-06 23:42:53 +02:00
|
|
|
struct PhysicalMemoryRange {
|
|
|
|
|
PhysicalMemoryRangeType type { PhysicalMemoryRangeType::Unknown };
|
2021-01-29 14:03:25 +02:00
|
|
|
PhysicalAddress start;
|
2021-07-06 21:35:15 -06:00
|
|
|
PhysicalSize length {};
|
2021-01-29 14:03:25 +02:00
|
|
|
};
|
|
|
|
|
|
2021-08-06 13:49:36 +02:00
|
|
|
#define MM Kernel::Memory::MemoryManager::the()
|
2018-10-27 14:56:52 +02:00
|
|
|
|
2020-06-28 16:04:35 -06:00
|
|
|
struct MemoryManagerData {
|
2021-07-27 14:30:26 +02:00
|
|
|
static ProcessorSpecificDataID processor_specific_data_id() { return ProcessorSpecificDataID::MemoryManager; }
|
|
|
|
|
|
2021-09-05 10:02:03 -07:00
|
|
|
Spinlock m_quickmap_in_use;
|
2020-07-03 05:19:50 -06:00
|
|
|
u32 m_quickmap_prev_flags;
|
2020-10-31 17:19:50 -06:00
|
|
|
|
|
|
|
|
PhysicalAddress m_last_quickmap_pd;
|
|
|
|
|
PhysicalAddress m_last_quickmap_pt;
|
2020-06-28 16:04:35 -06:00
|
|
|
};
|
|
|
|
|
|
2021-08-22 01:37:17 +02:00
|
|
|
extern RecursiveSpinlock s_mm_lock;
|
2020-07-06 07:27:22 -06:00
|
|
|
|
2021-08-04 22:49:13 +02:00
|
|
|
// This class represents a set of committed physical pages.
|
|
|
|
|
// When you ask MemoryManager to commit pages for you, you get one of these in return.
|
|
|
|
|
// You can allocate pages from it via `take_one()`
|
|
|
|
|
// It will uncommit any (unallocated) remaining pages when destroyed.
|
|
|
|
|
class CommittedPhysicalPageSet {
|
|
|
|
|
AK_MAKE_NONCOPYABLE(CommittedPhysicalPageSet);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CommittedPhysicalPageSet(Badge<MemoryManager>, size_t page_count)
|
|
|
|
|
: m_page_count(page_count)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommittedPhysicalPageSet(CommittedPhysicalPageSet&& other)
|
|
|
|
|
: m_page_count(exchange(other.m_page_count, 0))
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~CommittedPhysicalPageSet();
|
|
|
|
|
|
|
|
|
|
bool is_empty() const { return m_page_count == 0; }
|
|
|
|
|
size_t page_count() const { return m_page_count; }
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] NonnullRefPtr<PhysicalPage> take_one();
|
2021-08-05 17:14:13 +02:00
|
|
|
void uncommit_one();
|
2021-08-04 22:49:13 +02:00
|
|
|
|
|
|
|
|
void operator=(CommittedPhysicalPageSet&&) = delete;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
size_t m_page_count { 0 };
|
|
|
|
|
};
|
|
|
|
|
|
2018-10-17 23:13:55 +02:00
|
|
|
class MemoryManager {
|
2018-10-31 23:19:15 +01:00
|
|
|
AK_MAKE_ETERNAL
|
2021-07-13 23:21:22 +02:00
|
|
|
friend class PageDirectory;
|
2020-09-05 15:52:14 -06:00
|
|
|
friend class AnonymousVMObject;
|
2018-11-08 14:35:30 +01:00
|
|
|
friend class Region;
|
2018-11-08 21:20:09 +01:00
|
|
|
friend class VMObject;
|
2019-05-28 11:53:16 +02:00
|
|
|
|
2018-10-17 23:13:55 +02:00
|
|
|
public:
|
2019-07-16 13:44:41 +02:00
|
|
|
static MemoryManager& the();
|
2020-08-29 16:41:30 -06:00
|
|
|
static bool is_initialized();
|
2018-10-17 23:13:55 +02:00
|
|
|
|
2020-06-28 16:04:35 -06:00
|
|
|
static void initialize(u32 cpu);
|
2020-09-18 09:49:51 +02:00
|
|
|
|
2020-06-28 16:04:35 -06:00
|
|
|
static inline MemoryManagerData& get_data()
|
|
|
|
|
{
|
2021-07-27 14:30:26 +02:00
|
|
|
return ProcessorSpecific<MemoryManagerData>::get();
|
2020-06-28 16:04:35 -06:00
|
|
|
}
|
2018-10-18 13:05:00 +02:00
|
|
|
|
2021-07-14 13:31:21 +02:00
|
|
|
PageFaultResponse handle_page_fault(PageFault const&);
|
2018-10-18 13:05:00 +02:00
|
|
|
|
2021-03-11 13:03:40 +01:00
|
|
|
void set_page_writable_direct(VirtualAddress, bool);
|
|
|
|
|
|
2021-02-14 17:35:07 +01:00
|
|
|
void protect_readonly_after_init_memory();
|
2021-07-16 09:50:34 +02:00
|
|
|
void unmap_text_after_init();
|
|
|
|
|
void unmap_ksyms_after_init();
|
2021-02-14 17:35:07 +01:00
|
|
|
|
2021-02-08 15:45:40 +01:00
|
|
|
static void enter_process_paging_scope(Process&);
|
2021-08-06 13:57:39 +02:00
|
|
|
static void enter_space(AddressSpace&);
|
2018-11-01 09:01:51 +01:00
|
|
|
|
2021-08-06 13:57:39 +02:00
|
|
|
bool validate_user_stack_no_lock(AddressSpace&, VirtualAddress) const;
|
|
|
|
|
bool validate_user_stack(AddressSpace&, VirtualAddress) const;
|
2020-02-21 13:05:39 +01:00
|
|
|
|
2019-06-07 17:13:23 +02:00
|
|
|
enum class ShouldZeroFill {
|
2019-05-28 11:53:16 +02:00
|
|
|
No,
|
|
|
|
|
Yes
|
|
|
|
|
};
|
2019-01-31 03:57:06 +01:00
|
|
|
|
2021-09-05 21:54:12 +02:00
|
|
|
KResultOr<CommittedPhysicalPageSet> commit_user_physical_pages(size_t page_count);
|
2021-08-04 22:49:13 +02:00
|
|
|
void uncommit_user_physical_pages(Badge<CommittedPhysicalPageSet>, size_t page_count);
|
|
|
|
|
|
2021-08-05 20:58:09 +03:00
|
|
|
NonnullRefPtr<PhysicalPage> allocate_committed_user_physical_page(Badge<CommittedPhysicalPageSet>, ShouldZeroFill = ShouldZeroFill::Yes);
|
2020-09-01 13:40:34 -06:00
|
|
|
RefPtr<PhysicalPage> allocate_user_physical_page(ShouldZeroFill = ShouldZeroFill::Yes, bool* did_purge = nullptr);
|
2019-06-21 18:37:47 +02:00
|
|
|
RefPtr<PhysicalPage> allocate_supervisor_physical_page();
|
2021-07-13 16:10:48 +02:00
|
|
|
NonnullRefPtrVector<PhysicalPage> allocate_contiguous_supervisor_physical_pages(size_t size);
|
2021-07-11 23:12:32 +02:00
|
|
|
void deallocate_physical_page(PhysicalAddress);
|
2018-11-05 10:23:00 +01:00
|
|
|
|
2021-09-06 01:36:14 +02:00
|
|
|
KResultOr<NonnullOwnPtr<Region>> allocate_contiguous_kernel_region(size_t, StringView name, Region::Access access, Region::Cacheable = Region::Cacheable::Yes);
|
|
|
|
|
KResultOr<NonnullOwnPtr<Region>> allocate_kernel_region(size_t, StringView name, Region::Access access, AllocationStrategy strategy = AllocationStrategy::Reserve, Region::Cacheable = Region::Cacheable::Yes);
|
|
|
|
|
KResultOr<NonnullOwnPtr<Region>> allocate_kernel_region(PhysicalAddress, size_t, StringView name, Region::Access access, Region::Cacheable = Region::Cacheable::Yes);
|
|
|
|
|
KResultOr<NonnullOwnPtr<Region>> allocate_kernel_region_with_vmobject(VMObject&, size_t, StringView name, Region::Access access, Region::Cacheable = Region::Cacheable::Yes);
|
|
|
|
|
KResultOr<NonnullOwnPtr<Region>> allocate_kernel_region_with_vmobject(VirtualRange const&, VMObject&, StringView name, Region::Access access, Region::Cacheable = Region::Cacheable::Yes);
|
2019-05-14 11:51:00 +02:00
|
|
|
|
2021-07-06 21:35:15 -06:00
|
|
|
struct SystemMemoryInfo {
|
|
|
|
|
PhysicalSize user_physical_pages { 0 };
|
|
|
|
|
PhysicalSize user_physical_pages_used { 0 };
|
|
|
|
|
PhysicalSize user_physical_pages_committed { 0 };
|
|
|
|
|
PhysicalSize user_physical_pages_uncommitted { 0 };
|
|
|
|
|
PhysicalSize super_physical_pages { 0 };
|
|
|
|
|
PhysicalSize super_physical_pages_used { 0 };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SystemMemoryInfo get_system_memory_info()
|
|
|
|
|
{
|
2021-08-22 01:49:22 +02:00
|
|
|
SpinlockLocker lock(s_mm_lock);
|
2021-07-06 21:35:15 -06:00
|
|
|
return m_system_memory_info;
|
|
|
|
|
}
|
2019-06-11 21:13:02 +10:00
|
|
|
|
2021-05-16 02:36:52 -07:00
|
|
|
template<IteratorFunction<VMObject&> Callback>
|
2019-08-08 10:43:44 +02:00
|
|
|
static void for_each_vmobject(Callback callback)
|
|
|
|
|
{
|
2021-08-16 22:54:25 +02:00
|
|
|
VMObject::all_instances().with([&](auto& list) {
|
|
|
|
|
for (auto& vmobject : list) {
|
|
|
|
|
if (callback(vmobject) == IterationDecision::Break)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
});
|
2019-08-08 10:43:44 +02:00
|
|
|
}
|
|
|
|
|
|
2021-05-16 02:36:52 -07:00
|
|
|
template<VoidFunction<VMObject&> Callback>
|
|
|
|
|
static void for_each_vmobject(Callback callback)
|
|
|
|
|
{
|
2021-08-16 22:54:25 +02:00
|
|
|
VMObject::all_instances().with([&](auto& list) {
|
|
|
|
|
for (auto& vmobject : list) {
|
|
|
|
|
callback(vmobject);
|
|
|
|
|
}
|
|
|
|
|
});
|
2021-05-16 02:36:52 -07:00
|
|
|
}
|
|
|
|
|
|
2021-08-06 13:57:39 +02:00
|
|
|
static Region* find_user_region_from_vaddr(AddressSpace&, VirtualAddress);
|
|
|
|
|
static Region* find_user_region_from_vaddr_no_lock(AddressSpace&, VirtualAddress);
|
|
|
|
|
static void validate_syscall_preconditions(AddressSpace&, RegisterState const&);
|
2019-11-29 16:15:30 +01:00
|
|
|
|
2020-01-18 08:34:28 +01:00
|
|
|
void dump_kernel_regions();
|
|
|
|
|
|
2020-02-15 13:12:02 +01:00
|
|
|
PhysicalPage& shared_zero_page() { return *m_shared_zero_page; }
|
2020-09-04 21:12:25 -06:00
|
|
|
PhysicalPage& lazy_committed_page() { return *m_lazy_committed_page; }
|
2020-02-15 13:12:02 +01:00
|
|
|
|
2020-06-01 22:55:09 -06:00
|
|
|
PageDirectory& kernel_page_directory() { return *m_kernel_page_directory; }
|
|
|
|
|
|
2021-08-06 23:42:53 +02:00
|
|
|
Vector<UsedMemoryRange> const& used_memory_ranges() { return m_used_memory_ranges; }
|
2021-08-06 13:54:48 +02:00
|
|
|
bool is_allowed_to_mmap_to_userspace(PhysicalAddress, VirtualRange const&) const;
|
2021-01-19 19:13:03 +01:00
|
|
|
|
2021-07-07 19:50:05 -06:00
|
|
|
PhysicalPageEntry& get_physical_page_entry(PhysicalAddress);
|
|
|
|
|
PhysicalAddress get_physical_address(PhysicalPage const&);
|
|
|
|
|
|
2018-10-17 23:13:55 +02:00
|
|
|
private:
|
2020-08-22 17:53:34 +02:00
|
|
|
MemoryManager();
|
2018-10-17 23:13:55 +02:00
|
|
|
~MemoryManager();
|
|
|
|
|
|
2021-07-07 19:50:05 -06:00
|
|
|
void initialize_physical_pages();
|
2021-01-29 14:03:25 +02:00
|
|
|
void register_reserved_ranges();
|
|
|
|
|
|
2018-11-08 22:24:02 +01:00
|
|
|
void register_region(Region&);
|
|
|
|
|
void unregister_region(Region&);
|
2018-11-08 21:20:09 +01:00
|
|
|
|
2020-01-17 22:07:20 +01:00
|
|
|
void protect_kernel_image();
|
2020-01-17 21:03:52 +01:00
|
|
|
void parse_memory_map();
|
2020-07-06 07:27:22 -06:00
|
|
|
static void flush_tlb_local(VirtualAddress, size_t page_count = 1);
|
2021-07-14 13:31:21 +02:00
|
|
|
static void flush_tlb(PageDirectory const*, VirtualAddress, size_t page_count = 1);
|
2018-10-17 23:13:55 +02:00
|
|
|
|
2019-08-06 10:31:20 +02:00
|
|
|
static Region* kernel_region_from_vaddr(VirtualAddress);
|
|
|
|
|
|
2020-07-30 23:52:28 +02:00
|
|
|
static Region* find_region_from_vaddr(VirtualAddress);
|
2019-08-06 11:19:16 +02:00
|
|
|
|
2020-09-04 21:12:25 -06:00
|
|
|
RefPtr<PhysicalPage> find_free_user_physical_page(bool);
|
2021-07-07 19:50:05 -06:00
|
|
|
|
|
|
|
|
ALWAYS_INLINE u8* quickmap_page(PhysicalPage& page)
|
|
|
|
|
{
|
|
|
|
|
return quickmap_page(page.paddr());
|
|
|
|
|
}
|
|
|
|
|
u8* quickmap_page(PhysicalAddress const&);
|
2018-11-05 13:48:07 +01:00
|
|
|
void unquickmap_page();
|
|
|
|
|
|
2020-01-17 19:59:20 +01:00
|
|
|
PageDirectoryEntry* quickmap_pd(PageDirectory&, size_t pdpt_index);
|
|
|
|
|
PageTableEntry* quickmap_pt(PhysicalAddress);
|
|
|
|
|
|
2020-10-31 17:19:18 -06:00
|
|
|
PageTableEntry* pte(PageDirectory&, VirtualAddress);
|
2020-09-01 16:10:54 -06:00
|
|
|
PageTableEntry* ensure_pte(PageDirectory&, VirtualAddress);
|
2020-08-27 21:29:17 -06:00
|
|
|
void release_pte(PageDirectory&, VirtualAddress, bool);
|
2018-10-17 23:13:55 +02:00
|
|
|
|
2019-06-21 18:37:47 +02:00
|
|
|
RefPtr<PageDirectory> m_kernel_page_directory;
|
2018-10-18 13:05:00 +02:00
|
|
|
|
2020-02-15 13:12:02 +01:00
|
|
|
RefPtr<PhysicalPage> m_shared_zero_page;
|
2020-09-04 21:12:25 -06:00
|
|
|
RefPtr<PhysicalPage> m_lazy_committed_page;
|
2020-02-15 13:12:02 +01:00
|
|
|
|
2021-07-06 21:35:15 -06:00
|
|
|
SystemMemoryInfo m_system_memory_info;
|
2019-06-11 21:13:02 +10:00
|
|
|
|
2021-07-12 22:52:17 +02:00
|
|
|
NonnullOwnPtrVector<PhysicalRegion> m_user_physical_regions;
|
2021-08-04 20:29:02 +03:00
|
|
|
OwnPtr<PhysicalRegion> m_super_physical_region;
|
2021-07-12 22:52:17 +02:00
|
|
|
OwnPtr<PhysicalRegion> m_physical_pages_region;
|
2021-07-07 19:50:05 -06:00
|
|
|
PhysicalPageEntry* m_physical_page_entries { nullptr };
|
|
|
|
|
size_t m_physical_page_entries_count { 0 };
|
2018-11-08 21:20:09 +01:00
|
|
|
|
2021-07-23 02:40:16 +02:00
|
|
|
Region::ListInMemoryManager m_kernel_regions;
|
2021-08-06 23:42:53 +02:00
|
|
|
Vector<UsedMemoryRange> m_used_memory_ranges;
|
|
|
|
|
Vector<PhysicalMemoryRange> m_physical_memory_ranges;
|
|
|
|
|
Vector<ContiguousReservedMemoryRange> m_reserved_memory_ranges;
|
2018-10-17 23:13:55 +02:00
|
|
|
};
|
2018-11-01 11:44:21 +01:00
|
|
|
|
2020-01-02 20:49:21 +01:00
|
|
|
inline bool is_user_address(VirtualAddress vaddr)
|
|
|
|
|
{
|
2021-07-06 20:25:22 -06:00
|
|
|
return vaddr.get() < USER_RANGE_CEILING;
|
2020-01-02 20:49:21 +01:00
|
|
|
}
|
2020-01-19 09:14:14 +01:00
|
|
|
|
|
|
|
|
inline bool is_user_range(VirtualAddress vaddr, size_t size)
|
|
|
|
|
{
|
|
|
|
|
if (vaddr.offset(size) < vaddr)
|
|
|
|
|
return false;
|
|
|
|
|
return is_user_address(vaddr) && is_user_address(vaddr.offset(size));
|
|
|
|
|
}
|
2020-02-15 13:12:02 +01:00
|
|
|
|
2021-08-06 13:54:48 +02:00
|
|
|
inline bool is_user_range(VirtualRange const& range)
|
2021-02-13 00:47:47 +01:00
|
|
|
{
|
|
|
|
|
return is_user_range(range.base(), range.size());
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 13:12:02 +01:00
|
|
|
inline bool PhysicalPage::is_shared_zero_page() const
|
|
|
|
|
{
|
|
|
|
|
return this == &MM.shared_zero_page();
|
|
|
|
|
}
|
2020-02-16 01:27:42 +01:00
|
|
|
|
2020-09-04 21:12:25 -06:00
|
|
|
inline bool PhysicalPage::is_lazy_committed_page() const
|
|
|
|
|
{
|
|
|
|
|
return this == &MM.lazy_committed_page();
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-16 01:27:42 +01:00
|
|
|
}
|