Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6942438imu; Mon, 3 Dec 2018 05:25:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/U9mqOcaFsUCqSXUr03KlzEA3RB+av14/QmMLgsQxstz8lHI7+Fgk/g2yKhq/9CbhFlZ2HT X-Received: by 2002:a17:902:66e6:: with SMTP id e93mr15628477plk.92.1543843529649; Mon, 03 Dec 2018 05:25:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543843529; cv=none; d=google.com; s=arc-20160816; b=ml9JGaKbSETxBkg9oOAHwLBUx7jW4YhYtpiYN6wEbdgRYWJ3AQMAEY0LSyMGLirGvu ikNHkyDz5iASkRr37uaU5+2ArSCE6rMGkcPssVnyMlyr5HcuQfJbdA/s5LfDaRAgMvYu GBC4+xCRsglpR/A33gu19N5i2/7t/j2OMBNrr5WTFL6O86AY0mbVZ5smTdFdH+2bJUnl Ykkzh1ROo76phK+dNYKKa/RLdkCNS5jv/n0kLy1FqFQldjxx/B+yWOCJHfRK15Yns3Rm d/5LmfTHHs+S4FCSt9E3HOKdaVz/h4ujwseGV+Bsxprumcso5ZMCd9gsJCfrpoi3RrFh 9xjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=VS/vByW5FCa+W7cN4NMNlj3fFG0iYEedCvaIZGKfRPk=; b=Dc8zsLr0OKXSkf0OthNXH3dsJa8wh7RuOjISGlikrQYLTPjGnBFS19WOMTOwjkrM/V IUJIMgR6i+7p3kT6+zyNqedmdTGn16HBiDDRoi7UiqY+R3X8Q6j3hl/3RZYaTIaf02u/ pjtS8YuoTVRH3K9KjqELLWyg3K6ZxLU31R5pGmU/uJSJTINbbnF8+pa28kY0cdgIzPF8 h2irENmTpiJJZAzEI8zqQTvZk18GM6MzmDOk20oCcTfq2f0mPZr1CW1DJ4vXA15riXVv sLgcUujGTDmZWCfxVMVbeOmlSreCwmXy+ueddY66ysmGXZjof3QveOd0R797imSlzam4 Aq1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c26si12828068pgm.210.2018.12.03.05.25.14; Mon, 03 Dec 2018 05:25:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725957AbeLCNZZ (ORCPT + 99 others); Mon, 3 Dec 2018 08:25:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:47682 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725830AbeLCNZZ (ORCPT ); Mon, 3 Dec 2018 08:25:25 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 009BCAE1F; Mon, 3 Dec 2018 13:24:22 +0000 (UTC) Date: Mon, 3 Dec 2018 14:24:21 +0100 (CET) From: Miroslav Benes To: Petr Mladek cc: Jiri Kosina , Josh Poimboeuf , Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 01/11] livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func In-Reply-To: <20181129094431.7801-2-pmladek@suse.com> Message-ID: References: <20181129094431.7801-1-pmladek@suse.com> <20181129094431.7801-2-pmladek@suse.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Nov 2018, Petr Mladek wrote: > The address of the to be patched function and new function is stored > in struct klp_func as: > > void *new_func; > unsigned long old_addr; > > The different naming scheme and type is derived from the way how > the addresses are set. @old_addr is assigned at runtime using > kallsyms-based search. @new_func is statically initialized, > for example: > > static struct klp_func funcs[] = { > { > .old_name = "cmdline_proc_show", > .new_func = livepatch_cmdline_proc_show, > }, { } > }; > > This patch changes unsigned log old_addr -> void *old_func. It removes > some confusion when these address are later used in the code. It is > motivated by a followup patch that adds special NOP struct klp_func > where we want to assign func->new_func = func->old_addr respectively > func->new_func = func->old_func. > > This patch does not modify the existing behavior. > > Suggested-by: Josh Poimboeuf > Signed-off-by: Petr Mladek > --- > include/linux/livepatch.h | 4 ++-- > kernel/livepatch/core.c | 6 +++--- > kernel/livepatch/patch.c | 18 ++++++++++-------- > kernel/livepatch/patch.h | 2 +- > kernel/livepatch/transition.c | 4 ++-- > 5 files changed, 18 insertions(+), 16 deletions(-) kernel/livepatch/patch.h also mentions old_addr in a comment. You can add Acked-by: Miroslav Benes with that fixed. Miroslav