Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
a7dea2c
locking: move the locks into kernel/locking
d-tatianin Oct 6, 2026
9257bb8
everywhere: move implementation detail headers into detail/
d-tatianin Oct 20, 2026
ab9871a
scripts: add a lint check for private/ includes in public headers
d-tatianin Oct 26, 2026
a3aced3
scripts: add a lint check for statement expression macros
d-tatianin Nov 5, 2026
dd06d8c
scripts: add a lint check for semicolons in definition macros
d-tatianin Nov 12, 2026
9828b93
io: drop the empty private/arch/io.h
d-tatianin Oct 20, 2026
0fa34f4
io: move struct io_window into detail/io.h
d-tatianin Oct 21, 2026
e6d0bbb
spinlock: move struct spinlock into detail/spinlock.h
d-tatianin Oct 21, 2026
715bde9
mutex: move struct mutex into detail/mutex.h
d-tatianin Oct 21, 2026
29964d2
locking: define spin_lock_init() and mutex_init() via *_INIT()
d-tatianin Oct 21, 2026
87849fc
log_ring: add a forward declaration of struct log_ring
d-tatianin Oct 21, 2026
2923280
abortable_instructions: move the interface into private/arch
d-tatianin Oct 21, 2026
10bf071
unwind: stop eh_consume() shadowing the caller's ret
d-tatianin Oct 18, 2026
88a7fbc
time: stop shadowing cycles in time_keeper_set_counter_device()
d-tatianin Oct 18, 2026
9e7255f
seq: make SEQLOCK_INIT() compile
d-tatianin Oct 18, 2026
d32ecf6
time: don't drop the nanosecond fraction on every keeper tick
d-tatianin Oct 18, 2026
68d363f
build: enable -Wshadow
d-tatianin Oct 18, 2026
180148f
everywhere: rename the IRQ flag helpers to local_irq_*()
d-tatianin Oct 16, 2026
2fa34dd
tests: share the emulated interrupt state between files
d-tatianin Oct 6, 2026
013d6de
kernel: add local_irq_{enable,disable}()
d-tatianin Oct 16, 2026
7dc6583
panic: disable interrupts when panicking
d-tatianin Oct 3, 2026
6f1cb74
arch/x86_64: move the MSR numbers into msr_definitions.h
d-tatianin Oct 21, 2026
38ae03a
arch/x86_64: make per-cpu usable as early as possible
d-tatianin Oct 3, 2026
556f456
tests: add spinlock tests
d-tatianin Oct 6, 2026
bcaeae7
arch/x86_64: make this_cpu_add() and this_cpu_sub() interrupt safe
d-tatianin Oct 3, 2026
2bbf9e7
smp: add for_each_present_cpu()
d-tatianin Oct 21, 2026
3375763
common/bit: add BIT_FIND_FIRST_SET()
d-tatianin Oct 21, 2026
f5c3ad7
types: add cpu_t
d-tatianin Oct 21, 2026
dc9538d
arch/x86_64: add apic_id_t
d-tatianin Oct 21, 2026
6fdd212
arch/x86_64: initialize the x2APIC ops in declaration order
d-tatianin Oct 21, 2026
50cd0ad
arch/x86_64: fix the boot CPU's APIC ID in xAPIC mode
d-tatianin Oct 21, 2026
4774590
arch/x86_64: use BIT_FIELD_MAKE() for the xAPIC ICR destination
d-tatianin Oct 21, 2026
21f766a
sched: introduce struct task and current
d-tatianin Oct 4, 2026
a7380da
kernel: introduce the preempt count
d-tatianin Oct 3, 2026
9b7e1fc
spinlock: disable preemption while a lock is held
d-tatianin Oct 3, 2026
ce8be72
log: flush the console one record at a time
d-tatianin Oct 3, 2026
e8c4681
per_cpu: add this_cpu_xchg() and this_cpu_cmpxchg()
d-tatianin Oct 3, 2026
87335be
build: generate asm offsets from C
d-tatianin Oct 22, 2026
4e16535
arch/x86_64: generate the register offsets
d-tatianin Oct 22, 2026
495fa98
ubsan: move the recursion guard into struct task
d-tatianin Oct 4, 2026
a078735
kernel: introduce arch_switch_to()
d-tatianin Oct 4, 2026
b7a0b57
linker: add helpers to declare linker symbols and take their addresses
d-tatianin Oct 4, 2026
a97c915
linker: add for_each_section_array_item()
d-tatianin Nov 8, 2026
81d5d8f
linker: make SECTION_ARRAY_SIZE() a size_t
d-tatianin Nov 10, 2026
a3c0090
tests: drop macOS unit-testing support
d-tatianin Oct 4, 2026
5bec144
sched: introduce runqueues and scheduling classes
d-tatianin Oct 4, 2026
317ca42
common/minmax: add within_bounds() and within_bounds_inclusive()
d-tatianin Oct 23, 2026
49c0031
everywhere: use within_bounds() for open-coded range checks
d-tatianin Oct 23, 2026
9b5dd64
symbols: regenerate the symbol tables when the generator changes
d-tatianin Oct 24, 2026
de93983
scripts: drop the forwarding constructors of the symbol classes
d-tatianin Oct 25, 2026
7bedb1d
symbols: rename the code lookup to symbol_lookup_code_by_address()
d-tatianin Oct 23, 2026
8503ae2
symbols: anchor symbol addresses to the start of text
d-tatianin Oct 24, 2026
336ea22
scripts: match the current kallsyms format in the Linux mode
d-tatianin Oct 24, 2026
6254364
symbols: add symbol sizes to the symbol table
d-tatianin Oct 24, 2026
75c376c
symbols: return the symbol size from symbol_lookup_code_by_address()
d-tatianin Oct 24, 2026
bb0e19c
common/format: print symbol sizes in %pSM and %pRSM
d-tatianin Oct 23, 2026
874e770
symbols: add data symbols to the symbol table
d-tatianin Oct 23, 2026
d3d5184
symbols: add symbol_lookup_data_by_address()
d-tatianin Oct 24, 2026
10d5494
symbols: return the name from the lookups as a struct string
d-tatianin Nov 8, 2026
82cf198
common/attributes: support restrict for C++
d-tatianin Nov 8, 2026
6f23ba8
common/string_container: add str_printf()
d-tatianin Nov 8, 2026
2e598e1
io: let virt_to_phys() take a const pointer
d-tatianin Oct 24, 2026
e94f273
memory: add mem_describe()
d-tatianin Oct 23, 2026
d42fc35
memory: describe kernel heap objects
d-tatianin Oct 23, 2026
bff5a16
symbols: describe kernel image addresses
d-tatianin Oct 23, 2026
a2f2f1c
per_cpu: describe per-CPU variables
d-tatianin Oct 23, 2026
263b453
symbols: zero the offset and size when a lookup finds nothing
d-tatianin Nov 11, 2026
51724d6
common/format: add %pMEM
d-tatianin Oct 23, 2026
76b98c9
refcount: add refcount32 and refcount64
d-tatianin Oct 4, 2026
f3514bd
memory: use refcount32 for refcounted pages
d-tatianin Oct 4, 2026
5ca384a
sched: introduce task allocation and kernel stacks
d-tatianin Oct 4, 2026
7d786a9
sched: introduce schedule() and context switching
d-tatianin Oct 4, 2026
2478925
sched: introduce wake_up_task()
d-tatianin Oct 4, 2026
eb233af
per_cpu: add this_cpu_and() and this_cpu_or()
d-tatianin Oct 4, 2026
47b79a0
sched: introduce need_resched and wakeup preemption
d-tatianin Oct 4, 2026
1b6afd4
sched: allow preemption on return from an interrupt
d-tatianin Oct 4, 2026
a59ce43
kthread: introduce kthread_create() and kthread_run()
d-tatianin Oct 4, 2026
c7fd27d
kthread: add kthread_exit()
d-tatianin Oct 4, 2026
5a93c55
sched: make the boot thread the idle task
d-tatianin Oct 4, 2026
f900c31
sched: add might_sleep()
d-tatianin Oct 4, 2026
dfb665a
sched: introduce wait queues
d-tatianin Oct 4, 2026
d349b43
sched: introduce completions
d-tatianin Oct 4, 2026
6254ddc
kthread: introduce kthread_stop() and kthread_should_stop()
d-tatianin Oct 4, 2026
5068890
seq: introduce seq_t
d-tatianin Oct 4, 2026
7839ebd
seq: introduce struct seqcount_latch
d-tatianin Oct 4, 2026
0c186a3
time: don't make ns_since_boot() wait for an update in progress
d-tatianin Oct 4, 2026
b576823
time: add frequency_to_human()
d-tatianin Oct 4, 2026
49c0cb2
time: add duration_to_human()
d-tatianin Oct 4, 2026
c1d083a
time: add unit conversion helpers
d-tatianin Nov 10, 2026
b17c79d
common/attributes: add MUST_CHECK
d-tatianin Nov 4, 2026
57b7491
common: add check_{add,sub,mul}_overflow()
d-tatianin Nov 4, 2026
216147f
memory/boot_alloc: catch every overflow of the allocation size
d-tatianin Nov 4, 2026
66c7dc7
memory: use check_add_overflow() for open-coded overflow checks
d-tatianin Nov 4, 2026
b80216e
time: add ns_from_now()
d-tatianin Nov 5, 2026
ac3e1ff
time: introduce the per-CPU timer queue
d-tatianin Oct 4, 2026
61a61f3
common/minmax: add CLAMP()
d-tatianin Oct 4, 2026
e1e8e05
common/overflow: add saturating_sub()
d-tatianin Nov 5, 2026
06f2253
time: introduce timer event devices
d-tatianin Oct 4, 2026
0309657
time: add timer_arm_with_slack()
d-tatianin Oct 4, 2026
bda095c
time: add timer_advance()
d-tatianin Nov 4, 2026
0001ab5
time: back off when the timer interrupt cannot keep up
d-tatianin Oct 4, 2026
9347ad6
arch/x86_64: introduce the LAPIC timer event device
d-tatianin Oct 4, 2026
806adc8
arch/x86_64: add tsc_frequency()
d-tatianin Oct 4, 2026
aeb65da
arch/x86_64: add the microcode revision to x86_cpu_info
d-tatianin Oct 4, 2026
7cb260b
arch/x86_64: add Intel CPU model names
d-tatianin Nov 4, 2026
93cd542
arch/x86_64: add cpu_match()
d-tatianin Nov 4, 2026
6a0bc55
arch/x86_64: use TSC deadline mode for the LAPIC timer when available
d-tatianin Oct 4, 2026
3486b3a
time: add a timer that ticks the time keeper
d-tatianin Oct 4, 2026
0975a4d
sched: introduce schedule_until() and sleep_ns()
d-tatianin Oct 4, 2026
1cd85de
sched: add wait_event_timeout()
d-tatianin Oct 4, 2026
d1de3ce
sched: add wait_for_completion_timeout()
d-tatianin Oct 4, 2026
c5ad366
sched: add the switch_in and switch_out class operations
d-tatianin Oct 4, 2026
1c995a1
time: add timer_arm_lazy()
d-tatianin Oct 4, 2026
d6ce897
sched: add a per-runqueue slice timer
d-tatianin Oct 4, 2026
457ecd2
common/list: add list_is_singular()
d-tatianin Nov 5, 2026
3939ac3
common/list: add list_is_first()
d-tatianin Nov 6, 2026
041da36
sched: make round-robin preemptive via a slice timer
d-tatianin Oct 4, 2026
d619da8
common/atomic: add atomic_cmpxchg_{relaxed,acquire,release}()
d-tatianin Nov 5, 2026
540d240
mutex: implement for real
d-tatianin Oct 4, 2026
8ab03ef
mutex: hand the lock off to a waiter that lost it
d-tatianin Oct 4, 2026
8391401
build: define ULTRA_MODULE_NAME for every kernel source
d-tatianin Oct 6, 2026
e2d9320
tests/test_harness: count printed messages
d-tatianin Oct 6, 2026
fb9cd6a
param: don't warn for unknown dotted keys
d-tatianin Oct 6, 2026
d0fc24b
common/string_container: parenthesize MAKE_STR()
d-tatianin Nov 5, 2026
50dc345
param: move the command line parsing API into private/param.h
d-tatianin Nov 5, 2026
1ad90ce
param: move the macro internals into detail/param.h
d-tatianin Nov 5, 2026
b804a62
param: add module parameters
d-tatianin Oct 6, 2026
4284576
build: add --cmdline for extra kernel arguments
d-tatianin Oct 6, 2026
44879b7
sched: add sched_nr_switches()
d-tatianin Oct 4, 2026
1d34faf
demo: add a fireworks scheduler stress demo
d-tatianin Oct 4, 2026
be2efeb
kthread: add kthread_wait_for_exit()
d-tatianin Nov 8, 2026
d7e07e2
common/helpers: add CLASSIFY_TYPE()
d-tatianin Nov 10, 2026
c30dbd0
ktest: introduce the in-kernel test runner
d-tatianin Oct 6, 2026
67b14c4
kthread: add kthread_wait_for_exit_timeout()
d-tatianin Nov 8, 2026
7bfcc40
ktest: add per-case timeouts
d-tatianin Oct 6, 2026
f6a4c16
ktest: allow selecting suites and cases with ktest.run=
d-tatianin Oct 6, 2026
079d07f
ktest: add KTEST_RUN_THREADS()
d-tatianin Oct 6, 2026
38cdf0d
scripts/baremetal_ci: add criteria for judging a ktest run
d-tatianin Oct 6, 2026
1593b5f
build: let qemu_watch() stop at a pattern
d-tatianin Oct 6, 2026
fbb9fc0
build: retry failed downloads of the hyper binaries
d-tatianin Nov 11, 2026
b3b2355
build: add --boot-test to boot the kernel and report the verdict
d-tatianin Nov 11, 2026
d8efcd0
build: add --ktest to run the in-kernel tests and report the verdict
d-tatianin Nov 11, 2026
adcd4f2
build: add --optimization-level and --lto to override the config
d-tatianin Nov 10, 2026
613a27e
ci: build the GCC toolchain in a job of its own
d-tatianin Nov 8, 2026
ab19244
ci: run the in-kernel tests
d-tatianin Oct 6, 2026
a990f32
ci: boot every kernel that the build job builds
d-tatianin Nov 11, 2026
2d78bca
ci: lint every config preset
d-tatianin Nov 10, 2026
162c973
sched: add the scheduler integration tests
d-tatianin Oct 6, 2026
e34ac9b
time: add the timer and clock integration tests
d-tatianin Oct 6, 2026
d80d16a
mutex: add the mutex integration tests
d-tatianin Oct 6, 2026
35e4c8e
common/string_container: add str_ends_with()
d-tatianin Nov 8, 2026
857b886
memory: add the mem_describe() integration tests
d-tatianin Oct 23, 2026
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
46 changes: 46 additions & 0 deletions .github/actions/toolchain/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Platform toolchain
description: Build the platform toolchain, with GCC cached between runs

inputs:
arch:
description: The architecture to build for
required: true
toolchain:
description: gcc or clang
required: true
lookup-only:
description: Don't restore a cached toolchain, only build a missing one
default: "false"

runs:
using: composite
steps:
- if: ${{ inputs.toolchain == 'gcc' }}
id: version
name: Get the toolchain version
shell: bash
run: |
python3 -c 'import scripts.build_utils.toolchain_builder as tb
print(f"key=gcc-{tb.GCC_VERSION}-binutils-{tb.BINUTILS_VERSION}")' \
>> "$GITHUB_OUTPUT"

- if: ${{ inputs.toolchain == 'gcc' }}
id: cache
name: Restore the toolchain cache
uses: actions/cache/restore@v4.2.2
with:
path: "${{ github.workspace }}/toolchain/tools-${{ inputs.toolchain }}-${{ inputs.arch }}"
key: "${{ runner.os }}-${{ runner.arch }}-${{ inputs.arch }}-${{ steps.version.outputs.key }}"
lookup-only: ${{ inputs.lookup-only }}

- if: ${{ inputs.lookup-only != 'true' || steps.cache.outputs.cache-hit != 'true' }}
name: Build the platform toolchain
shell: bash
run: "${{ github.workspace }}/build.py --arch ${{ inputs.arch }} --toolchain ${{ inputs.toolchain }} --no-tune-native --toolchain-only"

- if: ${{ inputs.toolchain == 'gcc' && steps.cache.outputs.cache-hit != 'true' }}
name: Save the toolchain cache
uses: actions/cache/save@v4.2.2
with:
path: "${{ github.workspace }}/toolchain/tools-${{ inputs.toolchain }}-${{ inputs.arch }}"
key: ${{ steps.cache.outputs.cache-primary-key }}
99 changes: 69 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,30 @@ jobs:
- name: Build the platform toolchain
run: "${{ github.workspace }}/build.py --toolchain clang --toolchain-only"

- name: Check the coding conventions
run: "${{ github.workspace }}/build.py --toolchain clang --lint"
- name: Check the coding conventions of every preset
run: |
for preset in configs/*.config; do
"${{ github.workspace }}/build.py" --toolchain clang \
--config "$(basename "$preset" .config)" --lint
done

toolchain:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true

build:
- name: Build the GCC toolchain unless it is cached
uses: ./.github/actions/toolchain
with:
arch: x86_64
toolchain: gcc
lookup-only: true

build-and-boot:
needs: toolchain
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -66,42 +86,61 @@ jobs:
with:
submodules: true

- if: ${{ matrix.toolchain == 'gcc' }}
id: toolchain-version
name: Get the toolchain version
run: |
python3 -c 'import scripts.build_utils.toolchain_builder as tb
print(f"key=gcc-{tb.GCC_VERSION}-binutils-{tb.BINUTILS_VERSION}")' \
>> "$GITHUB_OUTPUT"

- if: ${{ matrix.toolchain == 'gcc' }}
id: toolchain-cache
name: Restore the toolchain cache
uses: actions/cache/restore@v4.2.2
with:
path: "${{ github.workspace }}/toolchain/tools-${{ matrix.toolchain }}-${{ matrix.arch }}"
key: "${{ runner.os }}-${{ runner.arch }}-${{ matrix.arch }}-${{ steps.toolchain-version.outputs.key }}"

- name: Build the platform toolchain
run: "${{ github.workspace }}/build.py --arch ${{ matrix.arch }} --toolchain ${{ matrix.toolchain }} --no-tune-native --toolchain-only"

- if: ${{ matrix.toolchain == 'gcc' && steps.toolchain-cache.outputs.cache-hit != 'true' }}
name: Save the toolchain cache
uses: actions/cache/save@v4.2.2
uses: ./.github/actions/toolchain
with:
path: "${{ github.workspace }}/toolchain/tools-${{ matrix.toolchain }}-${{ matrix.arch }}"
key: ${{ steps.toolchain-cache.outputs.cache-primary-key }}
arch: ${{ matrix.arch }}
toolchain: ${{ matrix.toolchain }}

- name: Build the kernel
run: "${{ github.workspace }}/build.py --arch ${{ matrix.arch }} --config ${{ matrix.preset }} --toolchain ${{ matrix.toolchain }} --no-tune-native"
- name: Build and boot the kernel
run: "${{ github.workspace }}/build.py --arch ${{ matrix.arch }} --config ${{ matrix.preset }} --toolchain ${{ matrix.toolchain }} --no-tune-native --boot-test"

unit-tests:
ktest:
needs: toolchain
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
arch: x86_64
toolchain: clang
accel: kvm
overrides: --optimization-level 3 --lto
- os: ubuntu-latest
arch: x86_64
toolchain: gcc
accel: tcg
overrides: --optimization-level 2
- os: macos-latest
arch: x86_64
toolchain: clang
accel: tcg

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build the platform toolchain
uses: ./.github/actions/toolchain
with:
arch: ${{ matrix.arch }}
toolchain: ${{ matrix.toolchain }}

- if: ${{ matrix.accel == 'kvm' }}
name: Give the runner access to KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Run the in-kernel tests
run: "${{ github.workspace }}/build.py --arch ${{ matrix.arch }} --toolchain ${{ matrix.toolchain }} --no-tune-native --ktest ${{ matrix.accel == 'kvm' && '--kvm' || '' }} ${{ matrix.overrides }}"

unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand Down
Loading
Loading