summaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64/cpu.h
AgeCommit message (Collapse)Author
42 hourskernel/amd64: Introduce flexible IPI managementIan Moffett
This commit greatly improves the handling of how inter-processor interrupts are allocated and managed. Previously Hyra used handlers at fixed interrupt vectors for IPIs, however, that is very rigid and not very scalable at all. With the new IPI framework, one may allocate IPIs by calling 'md_ipi_alloc()' and initializing the handler field. To send an IPI to a specific processor, one can use cpu_ipi_send() and pass the specific CPU structure as well as the IPI identifier. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-25kernel/amd64: Keep track of which cores are onlineIan Moffett
Give each core a bit that indicates whether the core is online or halted. We also provide a cpu_halt() which marks the core as offline. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-17kernel: sched: Add support for CPU pinningIan Moffett
This commit introduces support for pinning processes to specific cores which can be useful for things like, keeping core-specific workthreads running on their respective processors as well as mitigating very specific cases of false-sharing and performance degradation caused by a thread jumping between cores which requires cache-line entries to be thrashed around between them. Threads pinned to a specific core will always see their cached data in the same L1, L2, etc. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-16kernel: accnt: Keep track of per-cpu statsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-13kernel/amd64: Get CPU family + modelIan Moffett
The CPU family ID and model number are sometimes useful in order to detect the presence of certain CPU features as well as detecting CPU specific quirks. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-05kernel/amd64: cpu: Support SMEPIan Moffett
Some CPUs support Supervisor Memory Execution Protection that prevent ring 3 code from being executed in a ring 0 context. Enable this on CPUs that support it. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-05kernel/amd64: Add 'feat' field in cpu_infoIan Moffett
Keep track of per-cpu features by using a 'feat' field which contains the results of various CPUIDs. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/amd64: Add support for TLB shootdownsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-01kernel/amd64: mp: Keep track of CPUs by indexIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-16kernel: Add cpu_halt_others() and harden panic()Ian Moffett
Ensure interrupts are disabled at the start of panic() to prevent any interrupts from further degrading the state of the system. Also adds a newline before "panic: " to clean up the logs. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-04-17kernel/amd64: cpu: Add IRQ maskIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-02-16project: Update copyright date to 2025Ian Moffett
Was supposed to happen on Jan 1, sorry! Happy late new year! Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-10kernel/amd64: reboot: Halt all with REBOOT_HALTIan Moffett
This commit changes how reboot() handles REBOOT_HALT. Now instead of one core being halted, all cores will be halted through an IPI to a halt vector. Signed-off-by: Ian Moffett <ian@osmora.org>
2024-07-02kernel/amd64: Handle the user GS segment registerIan Moffett
This commit introduces usage of swapgs to switch out the GS register with the user GS register. An md_td_kick() function is also introduced to start up user threads. The this_cpu() function uses the GS register to read the current CPU structure using a new "self" field. Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-20kernel/amd64: intr: Add splraise/splx supportIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-08kernel/amd64: Prepare for schedulerIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-08kernel/amd64: Pass CPU info to cpu_startup()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-06kernel/amd64: tss: Add support for TSSIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-06kernel/amd64: lapic: Add support for LAPIC timerIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-05kernel/amd64: Add initial LAPIC codeIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-04project: Initial commitIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>