Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1052084lqh; Sun, 5 May 2024 14:00:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwx2HNOoelzJFVcC743mQ+Svn3+afrJxILfuR3jTgnNkWxbE0WOQhK1Erm9Rjh2DST3abc1kPThuSRDNs3Lpp+k+nLmwyZb66lhXBb3g== X-Google-Smtp-Source: AGHT+IEJmq/uNFShE2R8Ivte1njD9d/quueXgNhuVqaZNCqY9Bh+hLekttGlOQCCBuPbPYsozpss X-Received: by 2002:a05:6512:541:b0:519:1d68:ed with SMTP id h1-20020a056512054100b005191d6800edmr5232884lfl.47.1714942836553; Sun, 05 May 2024 14:00:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714942836; cv=pass; d=google.com; s=arc-20160816; b=t5CyYN6/82yARgdN0gXZoL2cFm4y/tN4xxVOrKxS8Mh9hg+eAGfXQLPsHI1pOPKPw7 mnqsiSFxox6dYwkcDN4wX+vaP2z0y0e1fhR4QEneXei/MXMWafn/JZVdsNDSV9rFIymm srZypHXRAfl3tCoKpp9O2GbGd7EZXGen5MuYJx/70CV4BDzmS8hyQ3M2uyoozvVkLtfo 7sOonzohPVyD2PcU49mpu8rXDoH66r6Z6oQQVHgMU1qPaXE0H7NrSU597amTxOCLLhdP L/6bM1dveQesyOqzek368n1kl1iX6a7aG6OUgAKzj67PAF4c9C8djqkIf+HjUUR78Ntt bMoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gCYC2cvPbxST6RQ7Q2EKnN4n4MqgXx/hH4mWd+3mLB0=; fh=DNHtU2MvZaKTM5eHWi+kaZhzmVReRg+/4/7H3Ecd0VU=; b=A08tX8Fn2ferhv2Xye4lPNnyUhUeWdpnmRRKgniUtReLSUdoZoGZnazQVTFwTsI2++ w8ghJD7CR+49Pphnf9WoAa0AWx7k1nZZSNDaxS/Wmw2Z4RjdF8bPQUVKck6liAJAMBMm lP7H0JEa5hJ4Kyxjtgk+4WUgi/7Bd9IykpiYlHT3AEw3jTRv+CEt4S4u2VgtJw3RlLml xv8qrzp6pNtH+rorKks0MphsaEfFGzSHdU4RN/IO6wgA2noiXgRRFvLsNSpLGOM8o9iF Mt7f1nKTgmxHUuAS1jJhx8tUGsqJioV0EcK2V7kVYIe+3MuWww1ddIlOVg8huW7bQVY3 63Sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Km+UI4VF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z12-20020a05640240cc00b00572890c166dsi4140855edb.449.2024.05.05.14.00.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 14:00:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Km+UI4VF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 473641F21277 for ; Sun, 5 May 2024 21:00:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE1A876028; Sun, 5 May 2024 21:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Km+UI4VF" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 082FA6CDBD; Sun, 5 May 2024 21:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714942827; cv=none; b=i1ULQ00nUbaBYC1J0cTVBaRcfhpWrwuzDL/X315DHkD1L0OYuDfQz+xWVUJsiCDlQwctYMEKemauWvOymhNIeKJna0Vx2hCdPtnt+v9gbIh2keDm+s/UaN1F9zV2yL2Rdhz/NapHn8bYLU9PZhamFAqCZfkiqL0n+ipzvXdPEks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714942827; c=relaxed/simple; bh=9xjsM37E5E5cOsGCqAL/S0VNAfQ7SyGuZPJpH+QQFJ4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FZKc57wbQy31kVxoUvNRdqLhjP4BOQkxGFrw+f1A3s2/oKKugsS/4ohDrQr8MO9YvUBHZyj9NFpNsgpslTROKdX/bCHQb3nVm8CnPz4bBVHKzJfw7+410a8jNebB5i7JX1IlZRP9yynW4IP/QMmeznXrzTnup5+bqYUoshKWQ6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Km+UI4VF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D70CC116B1; Sun, 5 May 2024 21:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714942826; bh=9xjsM37E5E5cOsGCqAL/S0VNAfQ7SyGuZPJpH+QQFJ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Km+UI4VFWIEaDG7cb5rw9YDN4URq3V9hzWc6thk4F5A6IZRsDAEVPRt9880/SloLM FhjRsVOZE402opeGfce1jcVUMTHUJdghTCNK+BzCFgjA2F29oSURdp/0u3LYAHpnS4 iDQ73j9RD9yVMPAnaA7KX2vNK9/fu3xTRzoqYQcJ8xAIhjJaEUPNf93h6yxXXxrJBI J748+8ZvSYVwl0M4WB6bRwoM5oqZF8ewwzNvpd+JzwRK65HeJlxFdwym3a7R7YY7ig RBoscvl2MFvW7tWIaaF+CQiIEyHEbGmg5r6jKThU6iTFz42kmKtRK3pZSvuN3DV2++ vV4nYOPaUjNnQ== Date: Sun, 5 May 2024 14:00:24 -0700 From: Josh Poimboeuf To: zhangwarden@gmail.com Cc: mbenes@suse.cz, jikos@kernel.org, pmladek@suse.com, joe.lawrence@redhat.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch.h: Add comment to klp transition state Message-ID: <20240505210024.2veie34wkbwkqggl@treble> References: <20240429072628.23841-1-zhangwarden@gmail.com> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240429072628.23841-1-zhangwarden@gmail.com> On Mon, Apr 29, 2024 at 03:26:28PM +0800, zhangwarden@gmail.com wrote: > From: Wardenjohn > > livepatch.h use KLP_UNDEFINED\KLP_UNPATCHED\KLP_PATCHED for klp transition state. > When livepatch is ready but idle, using KLP_UNDEFINED seems very confusing. > In order not to introduce potential risks to kernel, just update comment > to these state. > --- > include/linux/livepatch.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h > index 9b9b38e89563..b6a214f2f8e3 100644 > --- a/include/linux/livepatch.h > +++ b/include/linux/livepatch.h > @@ -18,9 +18,9 @@ > #if IS_ENABLED(CONFIG_LIVEPATCH) > > /* task patch states */ > -#define KLP_UNDEFINED -1 > -#define KLP_UNPATCHED 0 > -#define KLP_PATCHED 1 > +#define KLP_UNDEFINED -1 /* idle, no transition in progress */ > +#define KLP_UNPATCHED 0 /* transitioning to unpatched state */ > +#define KLP_PATCHED 1 /* transitioning to patched state */ Instead of the comments, how about we just rename them to KLP_TRANSITION_IDLE KLP_TRANSITION_UNPATCHED KLP_TRANSITION_PATCHED which shouldn't break userspace AFAIK. -- Josh