From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 66AC6379EF2 for ; Thu, 9 Apr 2026 07:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775720199; cv=none; b=sL+vrTDCjR0ajD/MoaSzIZ2zoP0/4NETfcThdGO/0f47evM6NxeTaZTscW18mKQUlwl0AD0eDjMJO0SS11wVJOTmKERRymNdSYOICOjQNajbBaUAtEYm80FSYOg6SutB13VBjKC+P/AnmAJeCWiKrDa2OQRFl0N+/sbF83prrag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775720199; c=relaxed/simple; bh=bWM+n0PuIclSzxSg8yrCMqDB9BwasgmhRhRSh6nIcUg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gV3GsQeOOWDDqeEp8WoaW9P7YvbVuysXIwszRD34+l0EXxuHqN3Sl92rODTggZhFJIghaThnp5fwCQALyzBKBMoIpvx+BBxdKa7MN4ImPjp+RnhuKcgMryn9LvRq+ma/1jqVGfdkTYgk01NijJrhz+UbBSRj6UhOs9HDyXTeJB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=cBCYfFvr; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="cBCYfFvr" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-488aa77a06eso8850275e9.0 for ; Thu, 09 Apr 2026 00:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1775720195; x=1776324995; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=SFIAOrBx/Kk6hQbOqlmoeLP19Ql72j2A2UxB1/jbKYA=; b=cBCYfFvrs1geXGepneF48LzQAgmUYgVNSWs7NXsWvzAB3JeKpKS0eBD5D5iChjgId+ XNhLodDX3OaRT+lCWCtHl9GTXt/zd38gGDyImjK8v9vMtNhrHkXOOMzmj6Fdg2Furs96 CXJTnqHnFDvRGXQxeCu2v0MTKtkmYolX5VYeXL2UMLxG1wGALEF8xs4oouz47G6tMxnT bPdop31V4ZUG1STY5xZiVloB76UIThDBi4FQmNNDVxG/14vJ5zFWqYi6lZgzj2+Q9Oyl e5fFK3GsAcb7JbJ94z0YXEon477481XH7PfwuKCFveYFAPEEucllZwaOSVVhuP7X7a4J betQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775720195; x=1776324995; h=in-reply-to:content-transfer-encoding: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=SFIAOrBx/Kk6hQbOqlmoeLP19Ql72j2A2UxB1/jbKYA=; b=Q2I1h28YY0d+cLkKkPJF3K6yhflIQ1/aLSK1OxKxd53YsgmJrPRbT+fzgEUf0kVPRV DVsF6TOJpk8tC37v6nVzOEeuK/AmkKnVUHsksPTLBHT+V+DNvSWSAxF9tOG7sHQfyhgt GWwycf7QX88XKMqX1dwfaysE6EKAP/lAu4/O/HxeGjrB/IN65xeVtWipzsetQ8/avuHK /0Amjcl2RiQfpqqi6NqmsU2eW3sIKqLTsVJ60E28Z8bxdHzGDMG9IashYW5iYnS/9qEX WM7FSBqfPwKFG/TIscWlWq1jl1Bm/KNs7dq7Bj2CHQT1Y8OJnGe7/sMSU1CWlJx2OA1e rrug== X-Forwarded-Encrypted: i=1; AJvYcCXCA/P+hGNJ+3O+I3DX5aZDHpkrUB1q6qPB0M5RDaELDncOcMV4v8emL4aZ6wMM1vgEZ1OXO09G4JQFOpPR@vger.kernel.org X-Gm-Message-State: AOJu0YxxwULs+BDatjaHbCoj8KRxxMjcTHp/X6TmMC3uYSRF096NNvT3 kojUuagpP0pqoVAOMaPZnaV6/K8JbeWDkQLuiHTGYYyy5LDNv2LCBr96cyN13z8U4PM= X-Gm-Gg: AeBDieuBCJjskpdFvZMg2K9JoPclWnJze6tKsWXnsJOxrpz4DzY0OLDsWtvxXcN+Qp0 ALTSw9zQI3kHluCi8tWpi2qJ6U6EXjxQCs8mebyXHmConFgKZ8Nl3LhEOgALM+wLX2WgyqWbxl0 niqg4l/vSmt912sD3SbsCsZ5uTEeBv66DCMzqM2FDk4ady6E8M1UBm1wrv/danxRc9R/fMqzi3D DRwU6RgR9o+2L7NoInlkMkIB9zrDsakF8kT4G/pKmaKsxxv4bwwgHy41PCqEVm6QOk9yKUMkQVm Q9V1j0IjOf/jV/yAX0mF7ahIljFp4VaGpQ0+FE6xO+MYhsSlN8q0wp1hcH0BD0iW0/wghP3ELD7 hOqF0hKSecmNb5t8ft9uio14O2HejsksGz5AgnJpaYNMYtmVd7X4uOfqN5UmKSvnG6YQkXGs1C9 DapBFppBAXsZVJix7rKjFcEWnGNg== X-Received: by 2002:a05:600c:4753:b0:486:fcc7:d6a with SMTP id 5b1f17b1804b1-4889976eb60mr333821525e9.13.1775720194684; Thu, 09 Apr 2026 00:36:34 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488cd19ea83sm81192215e9.1.2026.04.09.00.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2026 00:36:34 -0700 (PDT) Date: Thu, 9 Apr 2026 09:36:31 +0200 From: Petr Mladek To: Song Liu Cc: Yafang Shao , Joe Lawrence , Dylan Hatch , jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, kpsingh@kernel.org, mattbobrowski@google.com, jolsa@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, memxor@gmail.com, yonghong.song@linux.dev, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [RFC PATCH 3/4] livepatch: Add "replaceable" attribute to klp_patch Message-ID: References: Precedence: bulk X-Mailing-List: live-patching@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed 2026-04-08 11:19:50, Song Liu wrote: > On Wed, Apr 8, 2026 at 4:43 AM Petr Mladek wrote: > [...] > > > > > > > > This is weird semantic. Which livepatch tag would be allowed to > > > > supersede it, please? > > > > > > > > Do we still need this category? > > > > > > It can be superseded by any livepatch that has a non-zero tag set. > > > > And this exactly the weird thing. > > > > A patch with the .replace flag set is supposed to obsolete all already > > installed livepatches. It means that it should provide all existing > > fixes and features. > > > > Now, we want to introduce a replace flag/set which would allow to > > replace/obsolete only the livepatch with the same tag/set number. > > And we want to prevent conflicts by making sure that livepatches with > > different tag/set number will never livepatch the same function. > > > > Obviously, livepatches with different tag/set number could not > > obsolete the same no-replace livepatch. They would need to livepatch > > the same functions touched by the no-replace livepatch and would > > conflict. > > > > So, I suggest to remove the no-replace mode completely. It should > > not be needed. A livepatch which should be installed in parallel > > will simply use another unique tag/set number. > > I think I see your point now. Existing code works as: > - replace=false doesn't replace anything > - replace=true replaces everything > > If we assume false=0 and true=1, it is technically possible to define: > - replace_set=0 doesn't replace anything > - replace_set=1 replaces everything > - replace_set=2+ only replace the same replace_set Yes. This well describes my point. > This is probably a little too complicated. > > > > This ensures backward compatibility: while a non-atomic-replace > > > livepatch can be superseded by an atomic-replace one, the reverse is > > > not permitted—an atomic-replace livepatch cannot be superseded by a > > > non-atomic one. > > > > IMHO, the backward compatibility would just create complexity and mess > > in this case. > > Given that livepatch is for expert users, I think we can make this work > without backward compatibility. But breaking compatibility is always not > preferred. I believe that it is acceptable because: 1. It was always hard to combine no-replace and replace livepatches. I wonder if anyone combines them at all. 2. I believe that nobody tries to load the same livepatch module on different kernel versions. Instead, everyone prepares a custom livepatch module for each livepatched kernel version/release. And the tooling for creating livepatches will need to be updated to use "number" instead of "true/false" anyway. That said, it is easier to always use "0" for non-replace patches instead of assigning an unique "number" to avoid replacing. But I do not think that this would justify the complexity of having different semantic for 0, 1, and 2+ replace_set numbers. Best Regards, Petr