]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: Always enable CXL on supported architectures
authorDaan De Meyer <daan@amutable.com>
Tue, 7 Apr 2026 08:59:03 +0000 (08:59 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 7 Apr 2026 10:47:31 +0000 (12:47 +0200)
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.

man/systemd-vmspawn.xml
shell-completion/bash/systemd-vmspawn
src/vmspawn/vmspawn.c

index 0a61d781d39d0efc332ee5b416dd7fa157a88daa..92872233aee54ce7893795257316320cca84482d 100644 (file)
           <xi:include href="version-info.xml" xpointer="v255"/></listitem>
         </varlistentry>
 
-        <varlistentry>
-          <term><option>--cxl=<replaceable>BOOL</replaceable></option></term>
-
-          <listitem><para>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.</para>
-
-          <xi:include href="version-info.xml" xpointer="v261"/></listitem>
-        </varlistentry>
-
         <varlistentry>
           <term><option>--vsock=<replaceable>BOOL</replaceable></option></term>
 
index 1ca45091a7ef4fb64c02f708d7a003f7a6f17376..b2b3f4f5a8ba38e817012bf301452764d23d48b5 100644 (file)
@@ -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'
index c1ae51261d9a2420546d05b143042239129931ec..1b3558b47e75ee5e86a15aa9431bcb95eb14ad12 100644 (file)
@@ -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;