From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 F22CB409605 for ; Thu, 28 May 2026 19:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998047; cv=none; b=cjKtGSzPmHkgQnGKWMLvvdE4UmmpmFzE4pZAVRSZ6tRWJ7n05+KZmc1ETcewEbM+iAtLKxH+wDgb3Jzx3Vockq3vXDOz8LfoAgX8w6g5Itd1mQZxA6/C913Dr71L+/MDpdV/dFMde6MH5z6s52yNVRxg8+izCY4C3Z4BzBiR5p4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998047; c=relaxed/simple; bh=5nqRxNakogx/4yPGbhMWXM6kLaEr4JRWCP596afBA2c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MT/peh9Ym8lT5S76kmqNR03hSOpV/YBVEhNL3r5/VXcVHieqIuiWR2pr3CKf3YK4OmwAtELVqO7+PqM2tDlRTk86xGjWWhTegdoPX1p4oQLNvBEpw1igmbxsARHmDVTjxJReh9w3Bo4vjGrKYfSi8PkSzWLifKsbFZuHco6MHD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=X0lnLcaW; arc=none smtp.client-ip=209.85.160.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="X0lnLcaW" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-516d78df76aso70541731cf.3 for ; Thu, 28 May 2026 12:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779998042; x=1780602842; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=v9XIwGoHI7koXT5NUKG3hqbl2ARW9TxartU/PZHOXcY=; b=X0lnLcaWT1GcFZzLbs7Qs492kBptPhA3nBkmjVFfNpgE63EzMdxs2oCW2VAGf11/iq ZJBGN5dX9l8m9w/t0vM0mEBE5PK0gtfnQa1G94Cr0j3eIom1weBu4F2t23fR69CSUiT5 otX9+Hfz9Vq1RRZOGsEK9mj42FmgIqCYcsXHwZABPqkwyDeqQjGNGJgs7wHoWj6r87k1 C1HQAR8h2Rm9hPBrGrlJoh9vX2531k+ocnGHqeEA3eYMx5u6SpXWt7ctPUCOmR16ueyA BSPd4kLKs6dpz94tcaGSYljt9kRTRaaAYUAyuLTvTlGTcIjwQemHDY6Iw6LCoS73akrX c1Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779998042; x=1780602842; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v9XIwGoHI7koXT5NUKG3hqbl2ARW9TxartU/PZHOXcY=; b=UUfhf5SKe/cbLjc2rA0Ww3aoLCWCak7NEPCTuJxXov/eLrdxmcgXlPhwBwZqMQTAe0 LAKMoNMxu27IznatgauL7R0hZW/uXuiKTSN6Dp3nLcn8mQhXKoLpFTpLliqeaE4q/NTO V3fEJvMX7/J0YpIkMvO3Gk80Y1R3JOJbdHLW8sKnIZ6ztLYIROC1bqoULlGlZ2PvBr0u qMJdAHdQEJQ7lj/SD5Q03nWUsKhilvimh4EZ1sGBEcAQFvx8rTi2AaKkfpF3xWygI8qe ZFwFmhKNjCEVbGTYezGhS9E0rRN4L3NtB1IR7sRI8Ew65S60Oc5k7oTWILocbipJIrpH bmhg== X-Forwarded-Encrypted: i=1; AFNElJ/yRQMXU0ab7TbXtSIpnlGGJQVMoCjHP+mMZaiENY9/Rk6jMBWEMPGE1L99Zg38j963ijy9AJBi5Tf5A04=@vger.kernel.org X-Gm-Message-State: AOJu0YxuBMHetLZ1jWbDGpGg4+mHy0GOQf31oWWeft2bndJrmPQFLjfl gfDe8ZXxhMIuwuklQvn91mpBlKRrkXfAVNTbhlvoZffyi0V5xa2gs5VgG1WqxmAhTC4= X-Gm-Gg: Acq92OGIJ3rR6wd6FFe3ibZyN1Cwt01bWRxbHMIRnv5oqqnlNA1d7GpofSVcHLzknxQ AnWtbkWCwfi08ZGpSXoi+lEIPX0ytoOzFfXGmjw7l2Qh4YL8pkEEipvs+eRD5eeDQWnxqcF8fz5 /NCngtAijQhE1OVBB+bID7jSvct/Ns8Mud9YUovokYnnAiNrE6eoTAot7i5v7IRXrrx5n/l6Y57 PSdumFXJYPFfy9DPLJKiBudUfj3t2lNkpgakFY8wfkUP+EfLFP01kDG6jjI9YJWb2tGotBqHZR/ mshyhi9Frwmuo5kcXr1sCE1I3SEPqNVOycckHhWnMUe8c6Z/aTY6eeQ+F2kg/RLUobb5ouuTqoR X47ZD3MVe2Bal8Y8OEA50+VumOQaztD2DAd2Tt6oRIVttW9gY6v8UfReTIuW/Lll1PTBm5375ba 9bDrmFc5fVYEEmfZADvNmoaYptM1vJjpnZTGnxHNX1fPFPYIYQud0HfTjWn+J2Ig== X-Received: by 2002:a05:622a:6202:b0:50e:5cc3:6f42 with SMTP id d75a77b69052e-5172cca732cmr3748581cf.59.1779998041630; Thu, 28 May 2026 12:54:01 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51706adc63dsm85233251cf.16.2026.05.28.12.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 12:54:01 -0700 (PDT) Date: Thu, 28 May 2026 19:54:00 +0000 From: Pasha Tatashin To: Pratyush Yadav Cc: Pasha Tatashin , linux-kselftest@vger.kernel.org, rppt@kernel.org, shuah@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, skhan@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, corbet@lwn.net, dmatlack@google.com, kexec@lists.infradead.org, skhawaja@google.com, graf@amazon.com Subject: Re: [PATCH v2 01/10] liveupdate: centralize state management into struct luo_ser Message-ID: References: <20260514222628.931312-1-pasha.tatashin@soleen.com> <20260514222628.931312-2-pasha.tatashin@soleen.com> <2vxz7bor78zw.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2vxz7bor78zw.fsf@kernel.org> On 05-25 18:24, Pratyush Yadav wrote: > On Thu, May 14 2026, Pasha Tatashin wrote: > > > Transition the LUO to ABI v2, which centralizes state management into a > > single struct luo_ser header. > > > > Previously, LUO state was spread across multiple FDT properties and > > subnodes. ABI v2 simplifies this by placing all core state, including > > the liveupdate number and physical addresses for sessions and FLB > > headers into a centralized struct luo_ser. > > Makes a lot of sense I think. > > But nit: this brings about a semantic difference: now sessions and FLB > serialization format is no longer independent of LUO. I think that makes > sense but can you please spell that out in the commit message. Added. > > > > > Signed-off-by: Pasha Tatashin > > --- > > include/linux/kho/abi/luo.h | 91 +++++++++++--------------------- > > kernel/liveupdate/luo_core.c | 59 ++++++++++++++------- > > kernel/liveupdate/luo_flb.c | 65 ++++------------------- > > kernel/liveupdate/luo_internal.h | 8 +-- > > kernel/liveupdate/luo_session.c | 57 +++----------------- > > 5 files changed, 93 insertions(+), 187 deletions(-) > > > > diff --git a/include/linux/kho/abi/luo.h b/include/linux/kho/abi/luo.h > > index 46750a0ddf88..1b2f865a771a 100644 > > --- a/include/linux/kho/abi/luo.h > > +++ b/include/linux/kho/abi/luo.h > > @@ -30,52 +30,25 @@ > > * .. code-block:: none > > * > > * / { > > - * compatible = "luo-v1"; > > - * liveupdate-number = <...>; > > - * > > - * luo-session { > > - * compatible = "luo-session-v1"; > > - * luo-session-header = ; > > - * }; > > - * > > - * luo-flb { > > - * compatible = "luo-flb-v1"; > > - * luo-flb-header = ; > > - * }; > > + * compatible = "luo-v2"; > > + * luo-abi-header = ; > > While you are at it, perhaps also get rid of the LUO FDT entirely? With > this change it only holds the compatible and a pointer to a blob. Might > as well move the compatible string to the blob and use it directly. Do > you see any benefits of sticking with the FDT here? We have already > removed it from memfd for example (and AFAIK the upcoming PCI and VFIO > patches also do not use it). Good idea, let's remove it entirly, I am going to do this in a separate patch. > > > * }; > > * > > * Main LUO Node (/): > > * > > - * - compatible: "luo-v1" > > + * - compatible: "luo-v2" > > * Identifies the overall LUO ABI version. > > - * - liveupdate-number: u64 > > - * A counter tracking the number of successful live updates performed. > > @@ -109,13 +82,26 @@ > > > > /* > > * The LUO FDT hooks all LUO state for sessions, fds, etc. > > - * In the root it also carries "liveupdate-number" 64-bit property that > > - * corresponds to the number of live-updates performed on this machine. > > */ > > #define LUO_FDT_SIZE PAGE_SIZE > > #define LUO_FDT_KHO_ENTRY_NAME "LUO" > > -#define LUO_FDT_COMPATIBLE "luo-v1" > > -#define LUO_FDT_LIVEUPDATE_NUM "liveupdate-number" > > +#define LUO_FDT_COMPATIBLE "luo-v2" > > +#define LUO_FDT_ABI_HEADER "luo-abi-header" > > Nit: If we do go with FDT, I suppose "luo-ser-pa" (or "luo-ser"?) would > be more descriptive? I think, this is a good idea to remove FDT. > > > + > > +/** > > + * struct luo_ser - Centralized LUO ABI header. > > diff --git a/kernel/liveupdate/luo_flb.c b/kernel/liveupdate/luo_flb.c > > index 8f5c5dd01cd0..7ccc59981297 100644 > > --- a/kernel/liveupdate/luo_flb.c > > +++ b/kernel/liveupdate/luo_flb.c > > @@ -159,8 +159,8 @@ static void luo_flb_file_unpreserve_one(struct liveupdate_flb *flb) > > > > static int luo_flb_retrieve_one(struct liveupdate_flb *flb) > > { > > - struct luo_flb_private *private = luo_flb_get_private(flb); > > struct luo_flb_header *fh = &luo_flb_global.incoming; > > + struct luo_flb_private *private = luo_flb_get_private(flb); > > Nit: this doesn't seem to do anything. Is this a stray change? Removed > > > struct liveupdate_flb_op_args args = {0}; > > bool found = false; > > int err; > > > -int __init luo_flb_setup_incoming(void *fdt_in) > > +void __init luo_flb_setup_incoming(u64 flbs_pa) > > { > > struct luo_flb_header_ser *header_ser; > > - int err, header_size, offset; > > - const void *ptr; > > - u64 header_ser_pa; > > - > > - offset = fdt_subnode_offset(fdt_in, 0, LUO_FDT_FLB_NODE_NAME); > > - if (offset < 0) { > > - pr_err("Unable to get FLB node [%s]\n", LUO_FDT_FLB_NODE_NAME); > > > > - return -ENOENT; > > + if (flbs_pa) { > > + header_ser = phys_to_virt(flbs_pa); > > + luo_flb_global.incoming.header_ser = header_ser; > > + luo_flb_global.incoming.ser = (void *)(header_ser + 1); > > + luo_flb_global.incoming.active = true; > > Nit: Not getting FLB data resulted in a error print. I suppose we should > keep that here as well. This is no longer necessary. Previously, we relied on the FDT, which contained its own errors, but since everything is now passed through LUO's own struct, there are no errors to parse through fdtlib. The absence of flbs_pa indicates that it was not preserved by the previous kernel (i.e., there is no flbs). > > > } > > - > > - err = fdt_node_check_compatible(fdt_in, offset, > > - LUO_FDT_FLB_COMPATIBLE); > > - if (err) { > > - pr_err("FLB node is incompatible with '%s' [%d]\n", > > - LUO_FDT_FLB_COMPATIBLE, err); > > - > > - return -EINVAL; > > - } > > - > > - header_size = 0; > > - ptr = fdt_getprop(fdt_in, offset, LUO_FDT_FLB_HEADER, &header_size); > > - if (!ptr || header_size != sizeof(u64)) { > > - pr_err("Unable to get FLB header property '%s' [%d]\n", > > - LUO_FDT_FLB_HEADER, header_size); > > - > > - return -EINVAL; > > - } > > - > > - header_ser_pa = get_unaligned((u64 *)ptr); > > - header_ser = phys_to_virt(header_ser_pa); > > - > > - luo_flb_global.incoming.header_ser = header_ser; > > - luo_flb_global.incoming.ser = (void *)(header_ser + 1); > > - luo_flb_global.incoming.active = true; > > - > > - return 0; > > } > > > > /** > > > -int __init luo_session_setup_incoming(void *fdt_in) > > +int __init luo_session_setup_incoming(u64 sessions_pa) > > { > > struct luo_session_header_ser *header_ser; > > - int err, header_size, offset; > > - u64 header_ser_pa; > > - const void *ptr; > > - > > - offset = fdt_subnode_offset(fdt_in, 0, LUO_FDT_SESSION_NODE_NAME); > > - if (offset < 0) { > > - pr_err("Unable to get session node: [%s]\n", > > - LUO_FDT_SESSION_NODE_NAME); > > - return -EINVAL; > > - } > > > > - err = fdt_node_check_compatible(fdt_in, offset, > > - LUO_FDT_SESSION_COMPATIBLE); > > - if (err) { > > - pr_err("Session node incompatible [%s]\n", > > - LUO_FDT_SESSION_COMPATIBLE); > > - return -EINVAL; > > - } > > - > > - header_size = 0; > > - ptr = fdt_getprop(fdt_in, offset, LUO_FDT_SESSION_HEADER, &header_size); > > - if (!ptr || header_size != sizeof(u64)) { > > - pr_err("Unable to get session header '%s' [%d]\n", > > - LUO_FDT_SESSION_HEADER, header_size); > > - return -EINVAL; > > + if (sessions_pa) { > > Nit: same thing about the error print here. ditto. > > > + header_ser = phys_to_virt(sessions_pa); > > + luo_session_global.incoming.header_ser = header_ser; > > + luo_session_global.incoming.ser = (void *)(header_ser + 1); > > + luo_session_global.incoming.active = true; > > } > > > > - header_ser_pa = get_unaligned((u64 *)ptr); > > - header_ser = phys_to_virt(header_ser_pa); > > - > > - luo_session_global.incoming.header_ser = header_ser; > > - luo_session_global.incoming.ser = (void *)(header_ser + 1); > > - luo_session_global.incoming.active = true; > > - > > return 0; > > } > > -- > Regards, > Pratyush Yadav