Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752627AbdG1S3F (ORCPT ); Fri, 28 Jul 2017 14:29:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39626 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbdG1S3D (ORCPT ); Fri, 28 Jul 2017 14:29:03 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 66FC640252 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Fri, 28 Jul 2017 13:29:00 -0500 From: Josh Poimboeuf To: Joe Lawrence Cc: Petr Mladek , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu , Jiri Kosina , Miroslav Benes , Chris J Arges Subject: Re: [PATCH] livepatch: add (un)patch hooks Message-ID: <20170728182900.7ea7dnnvditaestd@treble> References: <1499868600-10176-1-git-send-email-joe.lawrence@redhat.com> <1499868600-10176-2-git-send-email-joe.lawrence@redhat.com> <20170717155144.GF32632@pathway.suse.cz> <20170719204952.4fyhtig3rbw7z4w4@treble> <20170720041723.35r6qk2fia7xix3t@treble> <20170727213600.52rwakraq3yddojs@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 28 Jul 2017 18:29:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1089 Lines: 25 On Fri, Jul 28, 2017 at 02:08:33PM -0400, Joe Lawrence wrote: > On 07/27/2017 05:36 PM, Josh Poimboeuf wrote: > > On Thu, Jul 27, 2017 at 04:43:58PM -0400, Joe Lawrence wrote: > >> On 07/20/2017 12:17 AM, Josh Poimboeuf wrote: > >>> - The post-patch and post-unpatch hooks will need to be run from either > >>> klp_complete_transition() or klp_module_coming/going(), depending on > >>> whether the to-be-patched module is already loaded or is being > >>> loaded/unloaded. > >> > >> You're suggesting that post-(un)patch-hooks: > >> > >> 1 - Notify klp_objects when a KLP_(UN)PATCHED transition completes > > > > Right. (From klp_complete_transition()) > > We should be careful to only call hooks for those klp_objects that were > actually (un)patched. I don't think there is such state that makes it > all the way out to klp_complete_transition(), but since both the > completion and module_coming/going code both operate under the > klp_mutex, perhaps klp_is_object_loaded() is a sufficient check? Yeah, the mutex makes it safe to just check klp_is_object_loaded(). -- Josh