Received: by 10.213.65.68 with SMTP id h4csp3660569imn; Tue, 10 Apr 2018 02:35:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+oXpp5hMvC+6IGXFgTu2nPBp6vCmM2AF/H240dv742s9IydUFKtP1b/xl9Rdn3s67iBaR4 X-Received: by 2002:a17:902:549:: with SMTP id 67-v6mr43962978plf.276.1523352913394; Tue, 10 Apr 2018 02:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523352913; cv=none; d=google.com; s=arc-20160816; b=TYAroLIfBQCS/DjLEZbJ8pCPtMfZM37WuFNdaszmOqwRujpjXhZsdd+7R38QZqH9vU k/rDGc7Yx5r6626QfNzebfPxlR4/AFU34iq7KwM+te6HVrUsDr9oW+2Bks/DfHvPb7Gk I+nFXikHTnHtNSP9i/85Nd5gAvqxgyva6Iws5d7WUJLpvt0x45Pr66uZD9yphDmZqWuC 8E0AaERYDsWneNUhvxOG53n7Z5IKUy/Ye3wahaib9MKNlp9qJ1sYNLCP4OQpKbvQ9HAJ Lm4i02wWTBAjFVCFgCCYDUDQcTauafnOvdaVHMVxW98bvVW0TROsZXuEC3XeZ21dm1tl hhaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Dj3ZNJFJ4F6NYHrC1UJ+L68OrzGx3jPjOWSn4fczHog=; b=wunIZIkHAxytbKfW24ArzhxEaVl0suZFu0TrRo4RxH3VC0MX2wgjGMcxfpYaRnAS66 EQZiGwvaeUtG09j2fksDxYtBVFG7DVhDragYbc0C0I+Hsdfx2Jm8ZZYkN8MSCpun1Exm mJ/TzaUp5tKJLwVnmNciKtFyto1e3CyBZ51l51qqaOMZ+pG+J+JFlPUOKJLnVD/a8/0g MZ1Uo3e8d6dX5eL+Il5AuevTLVIiBIr18QIu8oRdFgl3VHOpyfFvHLxB1KGI8g1/Sdlj xGY8LwWcyo6d02g1hvoj0hYUKb15uWC+o6TjvHHZ4EIu6hccNZZFLD76SL2oNB5vXRt6 UJTA== 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 k67si1525061pga.195.2018.04.10.02.34.35; Tue, 10 Apr 2018 02:35:13 -0700 (PDT) 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 S1752364AbeDJJbx (ORCPT + 99 others); Tue, 10 Apr 2018 05:31:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:50528 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752196AbeDJJbv (ORCPT ); Tue, 10 Apr 2018 05:31:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BF611AED7; Tue, 10 Apr 2018 09:31:49 +0000 (UTC) Date: Tue, 10 Apr 2018 11:31:47 +0200 From: Petr Mladek To: Miroslav Benes Cc: Josh Poimboeuf , Jiri Kosina , Jason Baron , Joe Lawrence , Jessica Yu , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] livepatch: Add atomic replace Message-ID: <20180410093147.agf7a3wcr2kjslkc@pathway.suse.cz> References: <20180323120028.31451-1-pmladek@suse.com> <20180323120028.31451-4-pmladek@suse.com> <20180406220530.snglx7m3quye34wp@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2018-04-09 15:53:03, Miroslav Benes wrote: > > > + * see klp_init_object_loaded(). > > > + */ > > > + if (!func->new_func && !func->nop) > > > return -EINVAL; > > > > > > > > INIT_LIST_HEAD(&func->stack_node); > > > @@ -742,6 +920,9 @@ static int klp_init_object_loaded(struct klp_patch *patch, > > > return -ENOENT; > > > } > > > > > > + if (func->nop) > > > + func->new_func = (void *)func->old_addr; > > > + > > > > These changes make it more obvious that 'new_func' isn't quite the right > > name. It should really be 'new_addr' IMO. > > I think we wanted to point out the difference from old_addr which is > initialized with the symbol name while new_func is initialized with the > new function itself (function pointer). I agree though that it looks > awkward in this context and I'm not against changing it to new_addr. I am fine with the rename. I was confused by "new_func" several times in the past. "new_addr" makes it clear that we are setting an address in compare with the name in "old_name". > Petr, could you also add a note to the changelog why we need to setup > new_func for nop functions, please? It's not obvious because of the hack > in klp_ftrace_handler() > (klp_cancel_transition()->...->klp_check_stack_func() needs it). Yup. Best Regards, Petr