Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VFS dcache work (& misc) #124

Merged
merged 40 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ee168be
cpumask: Make cpumask.h C compatible
heatd Jul 14, 2024
77b3bc2
mm_address_space: Make the header C compatible
heatd Jul 14, 2024
11acdfa
amap: Remove bogus DCHECK in amap_free
heatd Jul 14, 2024
2476bea
filemap: Fix bogus SIGBUS check
heatd Jul 14, 2024
9e43fad
mm: Switch x86 to new, common page table code
heatd Jul 14, 2024
35a68c8
riscv64/fpu: Fix fpu cache reinitialization on SMP
heatd Jul 15, 2024
5d0d10f
tmpfs: Add an implementation of fsyncdata
heatd Jul 15, 2024
c90397d
mm: Switch riscv64 to the new page table code
heatd Jul 15, 2024
dfd4a48
slab: Add kmem_cache_alloc_bulk and free_bulk
heatd Jul 25, 2024
f7a867e
rcupdate: Make it usable from C
heatd Jul 25, 2024
bb3427e
pagealloc: Add GFP_NOWAIT
heatd Jul 25, 2024
bdc04ab
utils.h: Add improved versions of the C min/max macros
heatd Jul 25, 2024
c787f85
spinlock: Add linux compat macros and definitions
heatd Jul 25, 2024
bffa1f6
uapi/errno: Add MAX_ERRNO
heatd Jul 25, 2024
965d612
maple_tree: Add maple_tree
heatd Jul 25, 2024
f8ed637
vm: Move the VMA tree to the maple tree
heatd Jul 25, 2024
41f279e
slab: Properly align redzones when need be
heatd Jul 27, 2024
b22110a
loopback: Unref packetbufs after sending them down the stack
heatd Jul 27, 2024
af083b2
vm_obj: Tolerate page mapcount > 0 after unmapping
heatd Jul 27, 2024
3aee6ff
vm: Replace amaps with directly storing anon pages in page tables
heatd Jul 27, 2024
122acf5
vm: Refactor sys_mmap
heatd Jul 27, 2024
66c4ad7
vm: Refactor more stuff
heatd Jul 27, 2024
98dcfca
vm: Get rid of vma's vm_maptype
heatd Jul 27, 2024
442029f
vm: Add vma merging on mmap
heatd Jul 28, 2024
b7fcf38
x86/code_patch: Reset CR0.WP after patching .text
heatd Jul 20, 2024
af91eb5
dentry: Improve rename (and various other fixes)
heatd Jul 20, 2024
bcd64ad
usystem: Add rename-nlink-tests
heatd Jul 20, 2024
8bcdc9f
sched: Add sched tracepoints
heatd Jul 20, 2024
550d8b2
trace: Fix memory leak when symbolizing stacks
heatd Jul 20, 2024
8db0d6e
kernlog: Support dynamically setting the log level
heatd Jul 29, 2024
00fcaa8
cputime: Temporarily replace cputime accounting with sched tick checking
heatd Jul 29, 2024
3de8378
slab: Fix kmem_cache_free_bulk
heatd Jul 29, 2024
7c42d1e
bug: Add a native WARN_ON
heatd Jul 29, 2024
c5878f4
tmpfs: Fix compile error
heatd Jul 29, 2024
5992faa
ext2: Fix getdent file_type conversion
heatd Jul 29, 2024
f6940ff
vm: Fix maple tree bugs
heatd Jul 29, 2024
a18ea08
dup2: Fix bounds check on dup23
heatd Jul 29, 2024
5c6a97a
utimensat: Interpret NULL times as UTIME_NOW
heatd Jul 29, 2024
2d5dbb0
process: Perform slight reordering on process_exit to avoid UAFs
heatd Jul 29, 2024
4761cb2
maple_tree: Add test_maple_tree from Linux
heatd Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ else
# -Wno-missing-braces: Seems broken? At least it started spitting out weird ones for IPv6 code(IN6ADDR_ALL_NODES)
# in onyx/net/ipv6.h
CFLAGS:=$(CFLAGS) -Wno-null-pointer-arithmetic -Wno-unknown-attributes -Wno-error=unused-private-field \
-Wno-missing-braces -Wno-c99-designator -Wthread-safety
-Wno-missing-braces -Wno-c99-designator -Wthread-safety -Wno-thread-safety-precise
endif

# NOTE: I don't think pointer-overflow works with kernel pointers
Expand Down
20 changes: 1 addition & 19 deletions kernel/arch/arm64/mmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,6 @@ bool __paging_change_perms(struct mm_address_space *mm, void *addr, int prot)
return true;
}

bool paging_change_perms(void *addr, int prot)
{
struct mm_address_space *as = &kernel_address_space;
if ((unsigned long) addr < VM_HIGHER_HALF)
as = get_current_address_space();

return __paging_change_perms(as, addr, prot);
}

bool paging_write_protect(void *addr, struct mm_address_space *mm)
{
uint64_t *ptentry;
Expand Down Expand Up @@ -598,15 +589,6 @@ void paging_free_page_tables(struct mm_address_space *mm)
free_page(phys_to_page((unsigned long) mm->arch_mmu.top_pt));
}

unsigned long get_mapping_info(void *addr)
{
struct mm_address_space *as = &kernel_address_space;
if ((unsigned long) addr < VM_HIGHER_HALF)
as = get_current_address_space();

return __get_mapping_info(addr, as);
}

unsigned long __get_mapping_info(void *addr, struct mm_address_space *as)
{
unsigned long *ppt_entry;
Expand Down Expand Up @@ -1142,7 +1124,7 @@ static int arm64_mmu_fork(PML *parent_table, PML *child_table, unsigned int pt_l

if (pt_level == PT_LEVEL || is_huge_page)
{
const bool should_cow = old_region->vm_maptype == MAP_PRIVATE;
const bool should_cow = vma_private(old_region);
child_table->entries[i] = pt_entry | (should_cow ? ARM64_MMU_READ_ONLY : 0);
if (should_cow)
{
Expand Down
2 changes: 2 additions & 0 deletions kernel/arch/riscv64/fpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ static slab_cache *fpu_cache = nullptr;
*/
void fpu_init_cache()
{
if (fpu_cache)
return;
fpu_cache = kmem_cache_create("fpu-state", save_size, fpu_get_save_alignment(), 0, nullptr);
if (!fpu_cache)
panic("Out of memory allocating fpu state");
Expand Down
Loading
Loading