From: Daan De Meyer Date: Tue, 7 Apr 2026 08:59:03 +0000 (+0000) Subject: vmspawn: Always enable CXL on supported architectures X-Git-Tag: v261-rc1~576 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4f535fdcae0cf715880f6f4307f5d0e58d93020;p=thirdparty%2Fsystemd.git vmspawn: Always enable CXL on supported architectures Drop the --cxl= option and unconditionally enable cxl=on the QEMU machine type whenever the host architecture supports it (x86_64 and aarch64). The flag was only added for testing parity with mkosi's CXL= setting and there is no reason to leave it as an opt-in toggle: with no pxb-cxl device or cxl-fmw window attached, enabling it on the machine only reserves a small MMIO region and emits an empty CEDT, so the cost is negligible while removing one knob users would otherwise have to flip explicitly to exercise the CXL code paths in QEMU. --- diff --git a/man/systemd-vmspawn.xml b/man/systemd-vmspawn.xml index 0a61d781d39..92872233aee 100644 --- a/man/systemd-vmspawn.xml +++ b/man/systemd-vmspawn.xml @@ -187,18 +187,6 @@ - - - - Controls whether to enable CXL (Compute Express Link) support in the virtual - machine. CXL is a high-speed interconnect standard that allows CPUs to access memory attached to - devices such as accelerators and memory expanders, enabling flexible memory pooling and expansion - beyond what is physically installed on the motherboard. Only supported on x86_64 and aarch64 - architectures. - - - - diff --git a/shell-completion/bash/systemd-vmspawn b/shell-completion/bash/systemd-vmspawn index 1ca45091a7e..b2b3f4f5a8b 100644 --- a/shell-completion/bash/systemd-vmspawn +++ b/shell-completion/bash/systemd-vmspawn @@ -31,7 +31,7 @@ _systemd_vmspawn() { local -A OPTS=( [STANDALONE]='-h --help --version -q --quiet --no-pager -n --network-tap --network-user-mode --user --system -x --ephemeral' [PATH]='-D --directory -i --image --linux --initrd --extra-drive --forward-journal --efi-nvram-template' - [BOOL]='--kvm --cxl --vsock --tpm --discard-disk --pass-ssh-key' + [BOOL]='--kvm --vsock --tpm --discard-disk --pass-ssh-key' [TRISTATE]='--register --secure-boot' [FIRMWARE]='--firmware' [FIRMWARE_FEATURES]='--firmware-features' diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index c1ae51261d9..1b3558b47e7 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -133,7 +133,6 @@ static uint64_t arg_ram = UINT64_C(2) * U64_GB; static uint64_t arg_ram_max = 0; static unsigned arg_ram_slots = 0; static int arg_kvm = -1; -static bool arg_cxl = false; static int arg_vsock = -1; static unsigned arg_vsock_cid = VMADDR_CID_ANY; static int arg_tpm = -1; @@ -236,7 +235,6 @@ static int help(void) { " Configure guest's RAM size (and max/slots for\n" " hotplug)\n" " --kvm=BOOL Enable use of KVM\n" - " --cxl=BOOL Enable use of CXL\n" " --vsock=BOOL Override autodetection of VSOCK support\n" " --vsock-cid=CID Specify the CID to use for the guest's VSOCK support\n" " --tpm=BOOL Enable use of a virtual TPM\n" @@ -382,7 +380,6 @@ static int parse_argv(int argc, char *argv[]) { ARG_CPUS, ARG_RAM, ARG_KVM, - ARG_CXL, ARG_VSOCK, ARG_VSOCK_CID, ARG_TPM, @@ -441,7 +438,6 @@ static int parse_argv(int argc, char *argv[]) { { "ram", required_argument, NULL, ARG_RAM }, { "qemu-mem", required_argument, NULL, ARG_RAM }, /* Compat alias */ { "kvm", required_argument, NULL, ARG_KVM }, - { "cxl", required_argument, NULL, ARG_CXL }, { "qemu-kvm", required_argument, NULL, ARG_KVM }, /* Compat alias */ { "vsock", required_argument, NULL, ARG_VSOCK }, { "qemu-vsock", required_argument, NULL, ARG_VSOCK }, /* Compat alias */ @@ -573,15 +569,6 @@ static int parse_argv(int argc, char *argv[]) { return r; break; - case ARG_CXL: - r = parse_boolean_argument("--cxl=", optarg, &arg_cxl); - if (r < 0) - return r; - if (arg_cxl && !ARCHITECTURE_SUPPORTS_CXL) - return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), - "CXL not supported on %s.", architecture_to_string(native_architecture())); - break; - case ARG_VSOCK: r = parse_tristate_argument_with_auto("--vsock=", optarg, &arg_vsock); if (r < 0) @@ -2371,7 +2358,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { return r; } - if (arg_cxl) { + if (ARCHITECTURE_SUPPORTS_CXL) { r = qemu_config_key(config_file, "cxl", "on"); if (r < 0) return r;