From 8415866c0371eae16e3c1221720efaa6c3cec3e2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 14 Feb 2021 01:25:22 +0100 Subject: Kernel: Remove user/kernel flags from Region Now that we no longer need to support the signal trampolines being user-accessible inside the kernel memory range, we can get rid of the "kernel" and "user-accessible" flags on Region and simply use the address of the region to determine whether it's kernel or user. This also tightens the page table mapping code, since it can now set user-accessibility based solely on the virtual address of a page. --- Kernel/VM/Space.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Kernel/VM/Space.cpp') diff --git a/Kernel/VM/Space.cpp b/Kernel/VM/Space.cpp index 9bb77f9173..5cb7e28d2e 100644 --- a/Kernel/VM/Space.cpp +++ b/Kernel/VM/Space.cpp @@ -66,7 +66,7 @@ Optional Space::allocate_range(VirtualAddress vaddr, size_t size, size_t Region& Space::allocate_split_region(const Region& source_region, const Range& range, size_t offset_in_vmobject) { auto& region = add_region(Region::create_user_accessible( - m_process, range, source_region.vmobject(), offset_in_vmobject, source_region.name(), source_region.access(), source_region.is_cacheable(), source_region.is_shared())); + m_process, range, source_region.vmobject(), offset_in_vmobject, source_region.name(), source_region.access(), source_region.is_cacheable() ? Region::Cacheable::Yes : Region::Cacheable::No, source_region.is_shared())); region.set_syscall_region(source_region.is_syscall_region()); region.set_mmap(source_region.is_mmap()); region.set_stack(source_region.is_stack()); @@ -84,7 +84,7 @@ KResultOr Space::allocate_region(const Range& range, const String& name auto vmobject = AnonymousVMObject::create_with_size(range.size(), strategy); if (!vmobject) return ENOMEM; - auto region = Region::create_user_accessible(m_process, range, vmobject.release_nonnull(), 0, name, prot_to_region_access_flags(prot), true, false); + auto region = Region::create_user_accessible(m_process, range, vmobject.release_nonnull(), 0, name, prot_to_region_access_flags(prot), Region::Cacheable::Yes, false); if (!region->map(page_directory())) return ENOMEM; return &add_region(move(region)); @@ -107,7 +107,7 @@ KResultOr Space::allocate_region_with_vmobject(const Range& range, Nonn return EINVAL; } offset_in_vmobject &= PAGE_MASK; - auto& region = add_region(Region::create_user_accessible(m_process, range, move(vmobject), offset_in_vmobject, name, prot_to_region_access_flags(prot), true, shared)); + auto& region = add_region(Region::create_user_accessible(m_process, range, move(vmobject), offset_in_vmobject, name, prot_to_region_access_flags(prot), Region::Cacheable::Yes, shared)); if (!region.map(page_directory())) { // FIXME: What is an appropriate error code here, really? return ENOMEM; -- cgit v1.2.3