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

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open

SCM_RIGHTS #146

wants to merge 41 commits into from

Conversation

heatd
Copy link
Owner

@heatd heatd commented Dec 14, 2024

No description provided.

heatd added 30 commits November 30, 2024 21:14
Add Intel microcode loading as per the Intel SDM, plus a wbinvd tip from
Linux. We expect to get a intel-ucode.img in the Linux format (ASCII
cpio archive). Building an iso with intel-ucode is supported by passing
INTEL_UCODE=<path-to-intel-ucode.img> when doing make for your desired
iso target.

Tested on a KBL, Ivy Bridge.

Signed-off-by: Pedro Falcato <[email protected]>
Remove all INFO() usages, and improve the coding style just a little
bit.

Signed-off-by: Pedro Falcato <[email protected]>
Right now, we're doing very early init - then parsing boot modules -
and only then doing the microcode load for the BSP. This results in
having possibly stale cpuid info that doesn't correspond to the current
microcode. Fix that by reloading if cpu 0. This also handles re-running
jump labels and alternatives.

Signed-off-by: Pedro Falcato <[email protected]>
This msr stops us from seeing the whole cpuid for the CPU, in case we're
Windows NT 4. We're not Windows NT 4.

Signed-off-by: Pedro Falcato <[email protected]>
lock add on x86 has the exact full-serializing semantics we want for
smp_mb, while being ~4x as fast as mfence.

Signed-off-by: Pedro Falcato <[email protected]>
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]>
UTIME_NOW was taking its clock value from a different clock domain
(MONOTONIC) instead of REALTIME. For instance, UTIME_NOW after 30s of
boottime would set the inode timestamp(s) to 01-01-1970, 00:00:30. Fix
it. This fixes perl build problems.

Signed-off-by: Pedro Falcato <[email protected]>
We can't assert that a page isn't locked, because another thread can
validly grab the lock between the writepage's unlock and us checking.

Signed-off-by: Pedro Falcato <[email protected]>
Add basic SCM_RIGHTS support. Does not deal with reference cycles yet.

Signed-off-by: Pedro Falcato <[email protected]>
Simple SCM_RIGHTS tests.

Signed-off-by: Pedro Falcato <[email protected]>
Fix the hack for d_invalidate and implement something that looks/is
correct.

Signed-off-by: Pedro Falcato <[email protected]>
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]>
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