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

SCM_RIGHTS #146

Merged
merged 55 commits into from
Jan 31, 2025
Merged

SCM_RIGHTS #146

merged 55 commits into from
Jan 31, 2025

Conversation

heatd
Copy link
Owner

@heatd heatd commented Dec 14, 2024

No description provided.

@heatd heatd force-pushed the pedro/scm_rights branch 8 times, most recently from c539e0e to 3d95c3c Compare January 25, 2025 10:30
heatd added 21 commits January 31, 2025 21:42
This is nicer and safer.

Signed-off-by: Pedro Falcato <[email protected]>
Certain systems give you LAPIC structures with id 255. This is supposed
to be interpreted as "does not exist" and skipped. While we're at it,
check if we indeed can online the CPU (the firmware wasn't marked it
unonlineable).

Signed-off-by: Pedro Falcato <[email protected]>
We were doing map[] when we really can't do so, because of
descriptor_size != sizeof(EFI_MEMORY_DESCRIPTOR). Such is life.

Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Fix setgroups crashes when clearing it, in case c->groups is NULL (we
don't have supplemental groups).

Signed-off-by: Pedro Falcato <[email protected]>
MSI seems to be broken and untested. Don't enable it, for now.

Signed-off-by: Pedro Falcato <[email protected]>
This should catch bad callers.

Signed-off-by: Pedro Falcato <[email protected]>
Still a work in progress, but already much better than the old one.

Signed-off-by: Pedro Falcato <[email protected]>
This patch adds MSI-X support and revamps IRQ allocation APIs for PCI
drivers. New drivers should use pci_alloc_irqs + pci_install_irq.

Signed-off-by: Pedro Falcato <[email protected]>
And while we're at it, revamp log messages with dev_*() helpers.

Signed-off-by: Pedro Falcato <[email protected]>
This stops us from missing interrupts when multiple IRQ handlers are
installed on a single edge-triggered irq line.

Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Move a bunch of file_ops into inode_operations (new) and vm_obj_ops.
This is merely the first step for unscrewing a bunch of problems with
file_ops and making writing filesystems/fds easier and more ergonomic.

Signed-off-by: Pedro Falcato <[email protected]>
After d_path started requiring a valid mount pointer, un_get_name
started crashing the kernel. Add a few wrappers for it, and make AF_UNIX
DTRT.

Signed-off-by: Pedro Falcato <[email protected]>
Add getaffinity and setaffinity syscalls. They're still stubbed and we
don't actually properly support affinity yet. However, it's good enough
for _SC_NPROCESSORS_{ONLN,CONF}.

Signed-off-by: Pedro Falcato <[email protected]>
Normally, signal pending would mean we have a proper signal waiting for
us. However, stuff like group stop and group exit set signal pending
while not having a proper signal number or signal struct. This made
sigtimedwait crash if the process exited mid-timedwait.

Signed-off-by: Pedro Falcato <[email protected]>
Stopping on inode = 0 is wrong, because this is simply an ignored entry,
not the end of the list. This repro'd in directories we were simply not
able to delete, because they looked empty from getdirent's PoV, but not
from elsewhere (open and ext2_dir_empty did the right thing). Fix it.

Signed-off-by: Pedro Falcato <[email protected]>
heatd added 28 commits January 31, 2025 21:42
Make them take better types (i.e don't take struct file in stat).

Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Also add a d_path_under_root that returns NULL when the path is not
under the current root. Unused, For Now(tm).

Signed-off-by: Pedro Falcato <[email protected]>
Small helpers for getdirent implementations to use.

Signed-off-by: Pedro Falcato <[email protected]>
sched_lock wasn't safe when thread migration was involved, which ended
up causing havoc and crashes.

Fixes: 66b6df9 ("sched: Add thread migration")
Signed-off-by: Pedro Falcato <[email protected]>
We can actually madvise parts of a vma, so detect whether this is the
first VMA we're looking at.
Fixes tlb_flush1.

Signed-off-by: Pedro Falcato <[email protected]>
Use maple trees with RCU support, and improve lots of stuff. TTYs now
hold pid references directly.

Signed-off-by: Pedro Falcato <[email protected]>
mm_address_space now has two decoupled refcounts, as with Linux.
active_mm is used to delay TLB flushing when switching to kernel
threads. They keep a ref (mm_count) which holds the top level
pgd (any kernel mappings) and the mm_address_space in place.
User-level mappings are wiped out when mm_users = 0. Also make vm.cpp ->
vm.c

Signed-off-by: Pedro Falcato <[email protected]>
We passed in a wrong number and thus were screwing up fd passing.

Signed-off-by: Pedro Falcato <[email protected]>
This fixes fstat breakage.

Fixes: dc767a8 ("vfs: Change inode_operations->stat and ->link's
prototypes")
Signed-off-by: Pedro Falcato <[email protected]>
get_user32 needs to be done under the futex hashtable spinlocks. This
means we can't actually take a page fault here. Use the new
pagefault_disable() and _enable() mechanisms to silently handle -EFAULT
there, and retry in that case (with a page fault that may in fact
sleep).

Signed-off-by: Pedro Falcato <[email protected]>
Fix SACK option parsing (we were rejecting options with 2 length). Also
add more loss recovery mechanisms. This greatly increases our bandwidth
when loss is present.

Signed-off-by: Pedro Falcato <[email protected]>
Add a simple procfs (right now with only static files).

Signed-off-by: Pedro Falcato <[email protected]>
Add a linux-style /proc/slabinfo.

Signed-off-by: Pedro Falcato <[email protected]>
Fixes a new build failure:

grub-mkrescue: error: xorriso not found.

Signed-off-by: Pedro Falcato <[email protected]>
This fixes madvise breakage on riscv64.

Signed-off-by: Pedro Falcato <[email protected]>
The copy_addr_to_sockaddr function was completely busted, didn't fill in
the sockaddr nor use the 'addr' parameter (which we need to use,
obviously). Fix it.

Signed-off-by: Pedro Falcato <[email protected]>
kmem_pointer_to_slab_maybe uses get_mapping_info, which has weird
semantics for huge pages. Add a special case for pointers inside
PHYS_BASE.

Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
This fixes UBSAN reports and bad behavior from zero-sized vectors.

Signed-off-by: Pedro Falcato <[email protected]>
Add per-socket send buffer limits. Also significantly improve segment
sending and fix some latent TCP/IP bugs while we're at it. This patch
doesn't yet introduce this functionality for UDP or UNIX sockets.

Signed-off-by: Pedro Falcato <[email protected]>
Add receive buffer accounting and wire it up with the TCP receive window
and the individual NIC drivers allocating packetbufs.

Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
We were not doing send window accounting correctly, which resulted in us
sending more data than the remote host could handle. This is wrong and
against RFC9293. Fix it by taking end seqs and snd_una + snd_wnd into
consideration.

Signed-off-by: Pedro Falcato <[email protected]>
We can't adjust snd_next in tcp_sendmsg, because then ACKs will result
in weird segments with sequence numbers that would indicate a gap in
data. Instead of that, adjust snd_next in tcp_output.

Signed-off-by: Pedro Falcato <[email protected]>
Correct UNIX behavior requires a SIGPIPE when the connection is broken
(i.e we can't send or they won't listen). Add a nice common helper while
we're at it.

Signed-off-by: Pedro Falcato <[email protected]>
@heatd heatd merged commit b272844 into master Jan 31, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant