Commit Graph
60159 Commits
Author SHA1 Message Date
Lennart Poettering 85d47bfa92 firstboot: make clear where the full screen console wizards end
The three first boot screens are visually separated from the console
output before them via the "chome" and welcome strings and sufficient
whitespace. But so far they weren't from the output after them. This is
sometimes a big confusing. Let's add a bit of a separator between the
end and what comes next, too.

Just cosmetics, nothing else.
2026-05-21 09:09:38 +09:00
Yu Watanabe 6cb65dacd1 vmspawn: rearrange --help and man page a bit (#42200)
This does not change man page or --help contents at all, but it does
introduce new sections, and moves some knobs between sections. It also
reorders things in the man page so that man page and --help show items
in the same order again.
2026-05-21 09:07:34 +09:00
Lennart Poettering 20ab4a8b15 report: use new --help formatting calls 2026-05-21 09:05:26 +09:00
Yu Watanabe ba13cd1245 include: update kernel headers from v7.1-rc4
It seems there is no notable changes to us.
2026-05-21 07:07:37 +09:00
Lennart Poettering b12a365866 vmspawn: move --kernel=/--initrd= under the "Execution" section
This has little to do with host configuration (where it was so far), and
a lot with what being executed, let's move it over.

Note that --help and man page so far differed here quite a bit: the
former had the "Execution" section, the latter didn't. This creates it
in the man page, to bring the two back in sync.
2026-05-20 23:39:47 +02:00
Lennart Poettering 183ec272ef vmspawn: split out networking related options into its own "Networking" section in --help 2026-05-20 23:38:30 +02:00
Lennart Poettering f9a40f7aa3 vmspawn: split 'Integration' section into 'Logging' and 'SSH'
Each of the two has multiple options, hence let's split them out.
2026-05-20 23:37:32 +02:00
Lennart Poettering 1a0b17df32 vmspawn: move image related knobs close to --image=
(Also, arrange the order if the image options group in the man page to
the same as in the --help text)
2026-05-20 23:37:31 +02:00
Yu Watanabe 12b9760800 musl: drop several statx definitions
Those dropped definitions have been provided since musl v1.2.6.
2026-05-21 05:06:35 +09:00
Yu Watanabe bc40f6cc32 musl: drop renameat2() wrapper
musl provides renameat2() since v1.2.6:
https://git.musl-libc.org/cgit/musl/commit/?id=05ce67fea99ca09cd4b6625cff7aec9cc222dd5a
2026-05-21 05:06:35 +09:00
Philip Withnall 8c0f9073c7 updatectl: Add a --no-ask-password argument
While commit 83c1e8ff5f added support for interactive polkit
authentication in `updatectl`, some users might want to disable that for
some use cases; so add the standard `--no-ask-password` argument.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: https://github.com/systemd/systemd/issues/37412
2026-05-21 04:24:55 +09:00
Yu Watanabe bcbae0c132 Couple of rearragements for src/core/meson.build (#42207)
Net result is `import-creds.c` moving from libcore to systemd
2026-05-21 04:18:14 +09:00
Daan De Meyer 393b908669 ci: run the musl build & test under mkosi with a postmarketOS tools tree (#42171) 2026-05-20 21:03:14 +02:00
Yu Watanabe 5904cee941 include: move several missing definitions to musl
Those moved ones have been defined in glibc <= 2.34, and only
necessary when built with musl.

Follow-up for c8c1bcf194.
2026-05-21 03:51:26 +09:00
Yu Watanabe b17723e66b firstboot: auto-fill keymap/locale questions with data from firmware, if available (#42177)
Let's make the installer experience a tiny bit nicer, and prefill
everything with the data the firmware gives us.
2026-05-21 03:50:43 +09:00
Yu Watanabe 594f2314b2 dns-packet: bail out early if the packet is too short (#42189)
This should address the nit from Claude in
https://github.com/systemd/systemd/pull/42178#pullrequestreview-4320763076.
2026-05-21 03:43:18 +09:00
Daan De Meyer 65f076f4b0 test-path: Skip test when we can't create a cgroup
Instead of having CI runner specific checks, let's just
skip the test if we get EXIT_CGROUP which is what we get
when we can't create a cgroup. This makes the check work
independently of CI runner, and specifically also on github
actions.
2026-05-20 17:22:35 +00:00
Luca Boccassi e13e69de7c meson: move one source file from libcore to systemd array 2026-05-20 18:15:56 +01:00
Luca Boccassi fd16d4ac54 meson: reorder core sources alphabetically 2026-05-20 18:15:56 +01:00
Luca Boccassi 70b6dc7631 meson: reorder core sources array
To hint that sources should be added to the lowest common denominator
first
2026-05-20 18:15:56 +01:00
Daan De Meyer fc7a32df38 test-path: Migrate to test framework and macros
- Also clean up the logging in check_states() to
  only log on state changes so it's less noisy.
2026-05-20 16:04:26 +00:00
Daan De Meyer eb69a3c59d test-path: Fail earlier on start-limit-hit 2026-05-20 16:04:26 +00:00
Daan De Meyer b01dcb3a81 test-ukify: Skip kernel images we can't access 2026-05-20 16:04:26 +00:00
Daan De Meyer 12836f982a ptyfwd: Imply PTY_FORWARD_READ_ONLY if stdin isn't readable
if stdin is connected to a closed pipe or similar, imply 
PTY_FORWARD_READ_ONLY so we don't even try to read from it
in the first place. Otherwise we'll immediately get a hangup
which will cause the forwarder to call sd_event_exit() and
shut down the event loop.

Debugged-by: Christian Brauner <brauner@kernel.org>
2026-05-20 18:04:13 +02:00
Lennart Poettering f941dff917 vmspawn: initial support for SEV-SNP guests (#42193) 2026-05-20 17:42:26 +02:00
Yu Watanabe 79877fdfa9 systemd-udevd: configure NIC IRQs CPU affinity (#40304)
# Context

#40195 defines the initial proposal and the motivation behind this PR.

This PR introduces 3 new options for `.link` files `[Link]` section:
- `IRQAffinityPolicy=`
- `IRQAffinity=`
- `IRQAffinityNUMA=`

The purpose is to allow `systemd-udevd` to configure a NIC's IRQs
affinity to specific CPU(s).

`IRQAffinityPolicy=` supports two policies:
- `single`: assign all the NIC IRQs to CPU 0, or the first CPU in the
CPU set resulting from the union of `IRQAffinity=` and
`IRQAffinityNUMA=`.
- `spread`: assign all the NIC IRQs to all the CPUs (or the union of
`IRQAffinity=` and `IRQAffinityNUMA=` if defined) in a round-robin
fashion while optimizing for cache locally while spreading apart queues
on CPUs as much as possible.

Both `IRQAffinity=` and `IRQAffinityNUMA=` behaves as filters to reduce
the CPU set to assign IRQs to, and are only valid if
`IRQAffinityPolicy=` is defined.

# Spreading IRQs

This section describes the algorithm responsible for spreading IRQs over
different CPUs to maximize performance.

## 1. Discover CPU topology

Read from `/sys/devices/system/cpu/cpu*/topology` to identify:
- L3 cache domains (dies)
- Physical cores VS hyperthreads
- NUMA nodes
- Core ordering within each die

```
Example: Dual-socket server with 2 dies per socket, 4 cores per die

      ┌─────────────────────────────────────────────────────────────────┐
      │                         NUMA Node 0                             │
      │   ┌─────────────────────────┐   ┌─────────────────────────┐     │
      │   │   Die 0 (L3 Cache)      │   │   Die 1 (L3 Cache)      │     │
      │   │  ┌────┐┌────┐┌────┐┌────│   │  ┌────┐┌────┐┌────┐┌────│     │
      │   │  │ C0 ││ C1 ││ C2 ││ C3 │   │  │ C4 ││ C5 ││ C6 ││ C7 │     │
      │   │  │0,16││1,17││2,18││3,19│   │  │4,20││5,21││6,22││7,23│     │
      │   │  └────┘└────┘└────┘└────│   │  └────┘└────┘└────┘└────│     │
      │   └─────────────────────────┘   └─────────────────────────┘     │
      └─────────────────────────────────────────────────────────────────┘
      ┌─────────────────────────────────────────────────────────────────┐
      │                         NUMA Node 1                             │
      │   ┌─────────────────────────┐   ┌─────────────────────────┐     │
      │   │   Die 2 (L3 Cache)      │   │   Die 3 (L3 Cache)      │     │
      │   │  ┌────┐┌────┐┌────┐┌────│   │  ┌────┐┌────┐┌────┐┌────│     │
      │   │  │ C8 ││ C9 ││C10 ││C11 │   │  │C12 ││C13 ││C14 ││C15 │     │
      │   │  │8,24││9,25││10,2││11,2│   │  │12,2││13,2││14,3││15,3│     │
      │   │  └────┘└────┘└────┘└────│   │  └────┘└────┘└────┘└────│     │
      │   └─────────────────────────┘   └─────────────────────────┘     │
      └─────────────────────────────────────────────────────────────────┘
                  (Numbers show CPU IDs: first HT, second HT)
```

## 2. Filter the first hyperthread only

Use only the first hyperthread of each physical core to avoid SMT
contention. Two IRQs on sibling HTs contend for ALU/cache without cache
benefit.

```
      Before: CPUs 0-31 (16 cores × 2 HTs)
      After:  CPUs 0-15 (first HT of each core)
```

## 3. Equidistant permutations

Reorder dies and CPUs so consecutive selections are maximally spread
apart.

```
        Original order:  [0, 1, 2, 3]          (adjacent dies/CPUs)
                            |
                            v
        Equidistant:     [0, 2, 1, 3]          (spread apart)
```

This ensures that even if only 2 IRQs are assigned, they land on dies 0
and 2 (not 0 and 1), maximizing physical distance. The permutation is
also applied within each die:

```
        Die permutation:   Die0 -> Die2 -> Die1 -> Die3
        
        Within each die:
        ┌───────────────────────────────────────────────┐
        │ Die 0: [C0,C1,C2,C3]     -> [C0,C2,C1,C3]     │
        │ Die 1: [C4,C5,C6,C7]     -> [C4,C6,C5,C7]     │
        │ Die 2: [C8,C9,C10,C11]   -> [C8,C10,C9,C11]   │
        │ Die 3: [C12,C13,C14,C15] -> [C12,C14,C13,C15] │
        └───────────────────────────────────────────────┘
```

## 4. Round-robin selection across dies

Pick one CPU from each die in rotation, following permuted order.

```

      Round 1:     Die0->C0   Die2->C8   Die1->C4   Die3->C12
                      |          |          |          |
                      v          v          v          v
      IRQs:         [IRQ0]     [IRQ1]     [IRQ2]     [IRQ3]
      
      Round 2:     Die0->C2   Die2->C10  Die1->C6   Die3->C14
                      |          |          |          |
                      v          v          v          v
      IRQs:         [IRQ4]     [IRQ5]     [IRQ6]     [IRQ7]
```

If there are more IRQs than physical cores, this logic wraps around and
reuse CPUs. Only the first hyperthread of each core is used to avoid
cache line contention between queues.

Closes #40195.
2026-05-21 00:39:47 +09:00
Lennart Poettering ec1f40c89d firstboot: port help() to help-util.[ch] APIs 2026-05-20 16:39:04 +02:00
Lennart Poettering 460dab3936 firstboot: prefill language prompt with firmware language if it makes
sense
2026-05-20 16:38:19 +02:00
Lennart Poettering ad19aced00 bootctl: show platform lang in bootctl status output 2026-05-20 16:38:19 +02:00
Lennart Poettering 862816a1fc locale-setup: pick up platform lang from firmware 2026-05-20 16:38:19 +02:00
Lennart Poettering 706de22cba sysinstall: prefill firmware variable question with 'yes' 2026-05-20 16:38:18 +02:00
Lennart Poettering 1d646aed65 firstboot: prefill keymap question with EFI provided info 2026-05-20 16:38:18 +02:00
Lennart Poettering a80024e96d ask-string: support prefilling a string query with an explicit string 2026-05-20 16:34:21 +02:00
Lennart Poettering 183051f23f vconsole-util: move code to read EFI keyboard layout into generic code 2026-05-20 16:34:21 +02:00
Daan De Meyer 933a45835f basic/math-util: drop libm where possible
- test-random-util is reworked to not use sqrt()
- pretty-print.c inlines ceil() so libm doesn't have
  to be linked into libshared
- We add fno-math-errno to allow inlining of more math
  functions by not requiring standard math functions to 
  set errno on invalid input.
2026-05-20 16:32:22 +02:00
Daan De Meyer c61a9a6dba repart: canonicalize node in varlink Run method
Run acquire_root_devno() on the varlink-provided node so symlinks (e.g.
/dev/disk/by-id/...) resolve to their canonical /dev/ path before being
used. Without this, sym_fdisk_partname() produces a "-partN" symlink
that udev hasn't created yet when repart calls open() on it right after
BLKPG_ADD_PARTITION, failing with ENOENT.

This also brings the varlink path in line with the CLI path's
partition-to-whole-disk and dm-crypt-to-backing resolution.
2026-05-20 16:22:00 +02:00
Paul Meyer 1ccda1533d vmspawn: use EPYC-v4 cpu for SNP
SNP requires a named, stable CPU model so the launch measurement is
reproducible across hosts. EPYC-v4 is the baseline that covers all
SNP-capable processors (Milan and later).

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2026-05-20 13:26:03 +02:00
Paul Meyer 4f8215add2 vmspawn: initial support for SEV-SNP guests
Add --confidential-computing=sev-snp to run the guest as an AMD SEV-SNP
confidential VM. Loads a raw OVMF firmware blob via -bios (SNP doesn't
support the pflash + NVRAM split), attaches a sev-snp-guest object,
and hashes the kernel, initrd and cmdline into the launch measurement
when direct kernel boot is used. Incompatible features (Secure Boot,
CXL, virtio-balloon, SMBIOS credentials) are rejected or disabled; an
attached vTPM must be treated as untrusted by the guest.

The feature is marked experimental in the man page.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2026-05-20 13:25:34 +02:00
Quentin Deslandes 7dfbbfb90d udev/net: add IRQAffinityNUMA= option for NUMA-aware filtering
Add support for filtering IRQ affinity to CPUs on a specific NUMA node
via the new IRQAffinityNUMA= option in .link files. The option accepts:
- "local": use the NUMA node local to the NIC's PCIe slot
- Explicit node number (0, 1, 2, ...): use CPUs on the specified node

When both IRQAffinity= and IRQAffinityNUMA= are specified, their
intersection is used. If the intersection is empty, an error is logged
and IRQ affinity configuration is skipped.

When "local" is specified but the device's NUMA node cannot be
determined (numa_node shows -1), a warning is logged and IRQ affinity
configuration is skipped.
2026-05-20 11:39:11 +02:00
Quentin Deslandes a9e821549b udev/net: add IRQAffinity= option to filter eligible CPUs
Add IRQAffinity= option to .link files that filters the set of CPUs
eligible for IRQ placement. This works in conjunction with
IRQAffinityPolicy= to constrain which CPUs receive network IRQs.

When specified with spread policy, only the listed CPUs are considered
for IRQ distribution. When specified with single policy, IRQs are
pinned to the first CPU in the allowed set instead of CPU 0.
2026-05-20 11:39:10 +02:00
Quentin Deslandes cf32bd9e7c udev/net: implement IRQAffinityPolicy=spread with topology awareness
Implement the spread policy for IRQ affinity distribution using a
topology-aware algorithm. The algorithm:

1. Discovers CPU topology from sysfs (NUMA node, package, die/L3, core)
2. Groups CPUs by L3 cache domain (die) with equidistant ordering
3. Round-robins across dies, spreading IRQs across the system
4. Uses first hyperthread of each core before second hyperthreads
5. Applies IRQ affinity via /proc/irq/<n>/smp_affinity

When there are more IRQs than CPUs, queues wrap around using round-robin.
2026-05-20 11:39:10 +02:00
Quentin Deslandes 66892d877c udev/net: add IRQAffinityPolicy= option for .link files
Add support for configuring IRQ affinity for network interfaces via
systemd .link files. For now, the new IRQAffinityPolicy= option in the [Link]
section only accepts "single", which pins all MSI IRQs to CPU 0.

This allows declarative IRQ affinity configuration for network devices
during udev processing, which is useful for optimizing network
performance on multi-core systems.

Further commits will expand the options supported by IRQAffinityPolicy=.
2026-05-20 11:39:10 +02:00
Frantisek Sumsal 180985c2ce dns-packet: bail out early if the packet is too short
Let's bail out early if the packet claims to contain some
questions or answer RRs, but the remaining packet data size is not
enough to hold a single such entry.

Follow-up for e7cd836dcf.
2026-05-20 11:16:29 +02:00
Frantisek Sumsal 6c119e11b2 dns-packet: drop unnecessary indentation
Bail out early if QDCOUNT == 0, similarly to what we already do in
dns_packet_extract_answer() when RRCOUNT == 0.
2026-05-20 11:16:29 +02:00
Daan De Meyer d52c8f2068 tree-wide: Replace exp10() with our own impl
exp10() has a symbol version > 2.34 on latest glibc. To allow 
dropping our baseline required glibc runtime version to <= 2.34, 
let's add our own version to prevent pulling in the newer symbol 
from glibc.
2026-05-20 11:03:27 +02:00
Yu Watanabe 27e0bba966 core: introduce varlink io.systemd.Job interface (#42104)
Methods:

- `io.systemd.Job.List` — list all queued jobs or look up by `id`/`unit`
name, with streaming support. Uses context/runtime split: `JobContext`
(Unit, JobType) and `JobRuntime` (Id, State, Result,
ActivationDetails). Follows the same SELinux and parameter-conflict
patterns as `io.systemd.Unit.List`.
- `io.systemd.Job.Cancel` — cancel a specific job by ID, with SELinux
and polkit authorization.
- `io.systemd.Job.ClearAll` — cancel all pending jobs, with SELinux and
polkit authorization.
2026-05-20 17:22:18 +09:00
Patrick Rohr b131473ce5 networkd: fix race condition in per-interface ICMPv6 processing
There exists a small window of time in icmp6_bind() between creating the
ICMPv6 socket and binding it to an ifindex, where the link-scoped socket
can process an ICMPv6 packet received on any interface. The applies to
both sd-radv and sd-ndisc codepaths.

This change adds an explicit check for ifindex on the receive path and
ignores packets received on other interfaces.

Co-developed-by: OpenAI Codex <noreply@openai.com>
2026-05-20 10:26:39 +09:00
Yu Watanabe ce260a112f sd-bus: add depth limit to message_skip_fields() to prevent stack overflow (#42164)
`message_skip_fields()` recursively processes D-Bus variant types in
message header fields with no depth limit. A crafted message with deeply
nested variants can cause unbounded recursion and overflow the stack.

Add a `depth` parameter checked against `BUS_CONTAINER_DEPTH` (128),
matching the limit already enforced by the public
`sd_bus_message_skip()` API. All recursive call sites pass `depth + 1`,
and the top-level caller in `message_parse_fields()` passes `0`.
2026-05-20 10:22:32 +09:00
Michael Vogt ae169c99fa core: improve errors from varlink io.systemd.Unit.StartTransient
The existing error reporting for the varlink `StartTransient` code
was converting all errors into `VARLINK_ERROR_UNIT_BAD_SETTING`.

This is not correct in some cases, we need to have a more targted
pattern here, i.e. only convert EINVAL to VARLINK_ERROR_UNIT_BAD_SETTING
and otherwise return the matching varlink error from the errno instead.

This commit fixes this issue. Thanks to Ivan Kruglov for raising
this.
2026-05-20 10:10:15 +09:00
Yu Watanabe 318bf0ca75 tree-wide: move static dl handles into their dlopen_*() functions (#42168)
Each dlopen_*() wrapper kept its dl handle as a file-scope
'static void *xxx_dl = NULL;' even though only the wrapper itself
ever referenced it. Move each one inside the corresponding function
so its scope matches its actual use, leaving the rest of each
translation unit free of the unused file-scope name.

In pcre2-util.c the assert(pcre2_dl) in pattern_matches_and_log()
becomes assert(sym_pcre2_match), which carries the same invariant
(pattern_compile_and_log() ran dlopen_pcre2()).
2026-05-20 10:08:11 +09:00