From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7961B31F9BD for ; Fri, 31 Jul 2026 21:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785534802; cv=none; b=kLB1VgJgnY5KHQM2Mqt6nBmI3/7F0sv78yAiULaJh6E17dEcK0HSHuY2x4MZSrYy7vLucDBHW01XW33TGj97JmaQcGd9cGFBnsTdRlMj8xsX1W5FUcQt8hVNNUtvRK2Qgcpxvmn2LhGllO77I31RDpK4Bfz5TfwMETgmdz2Ml84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785534802; c=relaxed/simple; bh=YvKfwdP/CINvsX/oPUMPfGyyNAKqWo3jStVDvu0FY40=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=Z8XyqWwFUFoXOjCdg/fBqSpNGbYWCaX27H2TlHIG04tBW2677yu3vpYGmmfHq0as9CDaPbHa381o1qGil3OFbLib+tr6DnP1lGTPe4qZSyApFj/2uIsIhl/BntYL5pfEZsgYtpn56N7IudUM/4C5yJGpRJ0ydb67bjPUJ3VgwZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--loganodell.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jt75Sgwb; arc=none smtp.client-ip=209.85.215.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--loganodell.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jt75Sgwb" Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c89704da8c7so2012467a12.0 for ; Fri, 31 Jul 2026 14:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785534801; x=1786139601; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:mime-version:date:from:to:cc:subject:date:message-id :reply-to:content-type; bh=QMT8aJxPN69Dyrd3LsDwUHfdRMUYihjZGyjp7f0vmTQ=; b=jt75SgwbY9mHhZcbTqcEnUGzAfnbjmtYo2IifbvzTDPxcy52vtGclFIqW9haZabm3C LQDhdTJU//8WSQkGrjaUwm+C9MM2CCyVTkE1FpzB3bMg1yPrDnqXMo69YsjH0JBGAjD4 blANf2WTqlRNrzUUyA56VSP8RLsg4oUyVY17n7GH6D+GmAmSVm2N5J8IANE85w1z3aGx dl2meq52M6Xgmd8FPxI1BGjeyp9ShS+pMvomqltoWApOrK3Dggra/MqIKn1F53AEF4C3 aA91gLE7gPtAN7ZBWa8ZA/NP8zfZf69oq09Fdj+Yn3PHrV7ArOtNNiEGdPyEl3vQSvC3 X6wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785534801; x=1786139601; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:mime-version:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=QMT8aJxPN69Dyrd3LsDwUHfdRMUYihjZGyjp7f0vmTQ=; b=lnRDltzwaNkuk9gDTSnTe0O19pxPWybEGkrx+giLw/g2muFOe2VcvwY7I5AkxnHSM7 I35Xn421PSTdqiiDh4jyD64Rq6/cdXbnq7XGj2HUBm+uW53MBlRE2+7+xTyhn1l4Vf+w Khz/f62Yhr7BVHLCPt7qpkjnrWRvZ8aZYpQFUTzP+wPXQh/6SZVIVFsAdqNyCL/fHmt7 U33bHEDLR99/scChkgzt4rETQGBjJvSPKR7fZuEpoUhy7iTJCaUGori6scw0E+X+IdyD wfQIFghVmODOmNEoCUAI0sJXSNkdnuER0oK09CbZnMquMogo0KBn438/ETLvQl6IRywK f/Mg== X-Forwarded-Encrypted: i=1; AHgh+Rphl3U7Sf32djq/2i1OYJDXMri/bigRynRk16toORkKtIa2qFnyYOF+6Ua03LsUp4KTLmg05HAnYEOZmXw=@vger.kernel.org X-Gm-Message-State: AOJu0YzBrhkV6nkGgTJONjHRwd+BiR3NVgWX7IB6bkSnDY0zeg2nativ a1YfsKLMIEytCG+iitLvYUWFd3Y9PvkoZKrt94owq9KK928fetvfmRTLorIUw3b9J87Au0Vc8CI L/Jk+5EPjJFOqlocIbgHVmg== X-Received: from dybhd40.prod.google.com ([2002:a05:7300:e128:b0:30c:5a76:5abe]) (user=loganodell job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:6f07:b0:3b4:7e2d:a3c2 with SMTP id adf61e73a8af0-3c92a52a045mr1268067637.18.1785534800614; Fri, 31 Jul 2026 14:53:20 -0700 (PDT) Date: Fri, 31 Jul 2026 14:52:20 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.508.g3f0d502094-goog Message-ID: <20260731215224.831696-1-loganodell@google.com> Subject: [RFC PATCH 0/2] Add support for multiple versions to KHO From: Logan Odell To: graf@amazon.com, rppt@kernel.org, pasha.tatashin@soleen.com Cc: pratyush@kernel.org, akpm@linux-foundation.org, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Logan Odell Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The format of the preserved-data blob that LUO saves to KHO is expected to change as new features are added, bugs are fixed, etc. Currently, LUO handles this by embedding a compatibility string into struct luo_ser which can be used to compare two kernels. This works if the changes between kernels are fundamentally incompatible. In a case where a new feature is added, we may want to support both versions in the new kernel to retain compatibility. This series adds a KHO interface to embed multiple versions under a single node in a subtree.=20 We go from something like: / (Root Node) =E2=94=94=E2=94=80=E2=94=80 LUO (Legacy Parent Node) =E2=94=9C=E2=94=80=E2=94=80 preserved-data =3D <0xphys_luo> =E2=94=94=E2=94=80=E2=94=80 blob-size =3D <0xsize_luo> To something like this: / (Root Node) =E2=94=94=E2=94=80=E2=94=80 LUO (Versioned Parent Node) =E2=94=9C=E2=94=80=E2=94=80 1 (Version 1 Node) =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 preserved-data =3D <0xph= ys_luo_v1> =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 blob-size =3D <0xsize_lu= o_v1> =E2=94=94=E2=94=80=E2=94=80 2 (Version 2 Node) =E2=94=9C=E2=94=80=E2=94=80 preserved-data =3D <0xphys_luo_v= 2> =E2=94=94=E2=94=80=E2=94=80 blob-size =3D <0xsize_luo_v2> We can also support mixed mode, allowing backwards compatibility in case of a roll-back to a pre-multi version kernel: / (Root Node) =E2=94=94=E2=94=80=E2=94=80 LUO (Versioned Parent Node) =E2=94=9C=E2=94=80=E2=94=80 preserved-data =3D <0xphys_luo> =E2=94=9C=E2=94=80=E2=94=80 blob-size =3D <0xphys_luo> =E2=94=9C=E2=94=80=E2=94=80 1 (Version 1 Node) =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 preserved-data =3D <0xph= ys_luo_v1> =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 blob-size =3D <0xsize_lu= o_v1> =E2=94=94=E2=94=80=E2=94=80 2 (Version 2 Node) =E2=94=9C=E2=94=80=E2=94=80 preserved-data =3D <0xphys_luo_v= 2> =E2=94=94=E2=94=80=E2=94=80 blob-size =3D <0xsize_luo_v2> The first patch moves some common functionality for preserving a node into a separate function. The second patch adds our new APIs. The third patch adds support for multiple versions to the debugfs entries. The forth patch adds new test cases to test_kho. Logan Odell (4): kho: Move subtree blob logic to separate function kho: Add support for multiple versions in subtrees kho: Add support for multiple versions to debugfs kho: Add test cases for versioned subtrees include/linux/kexec_handover.h | 14 ++ include/linux/kho/abi/kexec_handover.h | 16 ++ kernel/liveupdate/kexec_handover.c | 234 +++++++++++++++++- kernel/liveupdate/kexec_handover_debugfs.c | 57 ++++- lib/test_kho.c | 266 +++++++++++++++++++-- 5 files changed, 540 insertions(+), 47 deletions(-) --=20 2.55.0.508.g3f0d502094-goog