Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3749775pxb; Mon, 1 Feb 2021 03:51:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWjw1lHbM9dwsfe95BRLdv54ZxyWv2AFYoLaq8s1EW0/XQDwoWbE9wmzNHW2WqkqOw8k0l X-Received: by 2002:aa7:d2d2:: with SMTP id k18mr5728990edr.222.1612180260151; Mon, 01 Feb 2021 03:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612180260; cv=none; d=google.com; s=arc-20160816; b=aKTjAueHUmuk5xv+Ln7/SoTnpuwwMfs9b/qSc1AYpoTiyRSf1AB7qAQriR2Pj2NlK5 4VaZhYCcmhhuqfOLW8R4va081U09ibnG8GxypiLi1fWwsulsose+ySRt/J36pZ9gw25X c5P7SIwnl3cdxXdCRmz2mCVJXXoVrZffkdXSwU+SeKX14yFX6byYp786jDr1VaTGv7nV wf0w2+m1Ouq55vnM3b+bEA+d5zNDfW/L5NHK/lIhJ2jWb+OFpxu0a1X2ipUUQHyBUvMP L3YA4pi/Iqg0LNqDem2kP94kwHUk+lqJRgUVkZOrwZmTrTiSRMOm03V9AbTrFKaOro5T a4Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=/byds3YjUOQouQXsjG3SssVdwwLn7MDIeiw/APH4CKw=; b=plTm/7Fvx20/f4+HdobScFXL1Q74m8j0t9IGTYMVJzJ3jWEXdIdmAmdOCLc8wIbx+a V4o9PfpXpWfSp8MTspcvzDJdorkWK+HqIMTnADzGemkWvxTNGJMPbsE+TFSJNTungubA IRfIDcNPABbD/E1Q3Ac0KEcTCk9inY35D0bpnSNEm38LG9f29BvEak4nIplQw3Ko+gPC V21ErE19zKmGorcGxS1rx4ThWysdcNc+FfCcJQb0GRw96LEHNMT17R2qmfRSij8jQJjE 0MfJQo2q15DHpZojtfHOOSXZ2gOc85x0kq2Phz7eUci5zxqpZ3tdWfbWhdTF+/YFaPS2 n/aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si9387191edn.21.2021.02.01.03.50.34; Mon, 01 Feb 2021 03:51:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229495AbhBALsh (ORCPT + 99 others); Mon, 1 Feb 2021 06:48:37 -0500 Received: from verein.lst.de ([213.95.11.211]:40827 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbhBALsd (ORCPT ); Mon, 1 Feb 2021 06:48:33 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id DD5826736F; Mon, 1 Feb 2021 12:47:49 +0100 (CET) Date: Mon, 1 Feb 2021 12:47:49 +0100 From: Christoph Hellwig To: Petr Mladek Cc: Christoph Hellwig , Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol Message-ID: <20210201114749.GB19696@lst.de> References: <20210128181421.2279-1-hch@lst.de> <20210128181421.2279-6-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2021 at 10:43:36AM +0100, Petr Mladek wrote: > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > @@ -164,12 +164,8 @@ static int klp_find_object_symbol(const char *objname, const char *name, > > .pos = sympos, > > }; > > > > - mutex_lock(&module_mutex); > > - if (objname) > > + if (objname || !kallsyms_on_each_symbol(klp_find_callback, &args)) > > module_kallsyms_on_each_symbol(klp_find_callback, &args); > > - else > > - kallsyms_on_each_symbol(klp_find_callback, &args); > > - mutex_unlock(&module_mutex); > > This change is not needed. (objname == NULL) means that we are > interested only in symbols in "vmlinux". > > module_kallsyms_on_each_symbol(klp_find_callback, &args) > will always fail when objname == NULL. I just tried to keep the old behavior. I can respin it with your recommended change noting the change in behavior, though.