From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C55FC43387 for ; Thu, 3 Jan 2019 13:37:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6953321872 for ; Thu, 3 Jan 2019 13:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730324AbfACNh1 (ORCPT ); Thu, 3 Jan 2019 08:37:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53620 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728233AbfACNhZ (ORCPT ); Thu, 3 Jan 2019 08:37:25 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E083C057F34; Thu, 3 Jan 2019 13:37:25 +0000 (UTC) Received: from treble (ovpn-122-188.rdu2.redhat.com [10.10.122.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 726795D75E; Thu, 3 Jan 2019 13:37:22 +0000 (UTC) Date: Thu, 3 Jan 2019 07:37:20 -0600 From: Josh Poimboeuf To: Petr Mladek Cc: Jiri Kosina , Miroslav Benes , Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu Subject: Re: [PATCH v14 07/11] livepatch: Add atomic replace Message-ID: <20190103133720.3d57kssgvvg44zjt@treble> References: <20181129094431.7801-1-pmladek@suse.com> <20181129094431.7801-8-pmladek@suse.com> <20181213225528.ies3kxjjtzl6dmd3@treble> <20181217152741.2i2trzjk5rmofgc3@pathway.suse.cz> <20190103124740.s3mpgmjw4no4qr6f@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190103124740.s3mpgmjw4no4qr6f@pathway.suse.cz> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 03 Jan 2019 13:37:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 03, 2019 at 01:47:40PM +0100, Petr Mladek wrote: > On Mon 2018-12-17 16:27:41, Petr Mladek wrote: > > On Thu 2018-12-13 16:55:28, Josh Poimboeuf wrote: > > > On Thu, Nov 29, 2018 at 10:44:27AM +0100, Petr Mladek wrote: > > > Side note, it would probably be useful to have a klp_for_each_patch() > > > helper. > > > > Will do. > > Hmm, there are two possibilities: > > 1) #define klp_for_each_patch(patch) \ > list_for_each_entry(patch, &klp_patches, list) > > 2) #define klp_for_each_patch(patches, patch) \ > list_for_each_entry(patch, &patches, list) > > Problems: > > 1st variant would need to declare klp_patches in > include/linux/livepatch.h. Josh did not like even > kernel/livepatch/core.h. > > 2nd variant looks ugly to me. > > > Alternative solution would be to move all klp_for_each*() > definitions from include/linux/livepatch.h to kernel/livepatch/core.h. > But there might be some users. I wonder if we use these > macros when preparing the cumulative patches. > > > As any solution looks controversial, I would prefer to postpone this change > after this patchset is accepted. I would vote #1, and just put it in core.c next to the klp_patches definition. But it's fine with me if you want to postpone it. -- Josh