From: Miroslav Benes <mbenes@suse.cz>
To: Petr Mladek <pmladek@suse.com>
Cc: Jiri Kosina <jikos@kernel.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Jason Baron <jbaron@akamai.com>,
Joe Lawrence <joe.lawrence@redhat.com>,
Jessica Yu <jeyu@kernel.org>,
Evgenii Shatokhin <eshatokhin@virtuozzo.com>,
live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 4/7] livepatch: Allow to unpatch only functions of the given type
Date: Fri, 9 Feb 2018 13:29:46 +0100 (CET) [thread overview]
Message-ID: <alpine.LSU.2.21.1802091326490.30746@pobox.suse.cz> (raw)
In-Reply-To: <20180206103424.10829-5-pmladek@suse.com>
> +/*
> + * Remove ftrace handler for the given object and function type.
Isn't it imprecise? It does not necessarily remove ftrace handler. It
removes a function of given ftype from func_stack. I'd remove the
sentence.
> + *
> + * It keeps obj->patched flag true when any listed function is still patched.
> + * The caller is responsible for removing the unpatched functions to
> + * make the flag clean again.
> + */
> +void klp_unpatch_object(struct klp_object *obj, enum klp_func_type ftype)
> {
> struct klp_func *func;
> + bool patched = false;
>
> - klp_for_each_func(obj, func)
> - if (func->patched)
> + klp_for_each_func(obj, func) {
> + if (!func->patched)
> + continue;
> +
> + if (klp_is_func_type(func, ftype))
> klp_unpatch_func(func);
> + else
> + patched = true;
> + }
>
> - obj->patched = false;
> + obj->patched = patched;
> }
>
> int klp_patch_object(struct klp_object *obj)
> @@ -258,7 +272,7 @@ int klp_patch_object(struct klp_object *obj)
> klp_for_each_func(obj, func) {
> ret = klp_patch_func(func);
> if (ret) {
> - klp_unpatch_object(obj);
> + klp_unpatch_object(obj, KLP_FUNC_ANY);
> return ret;
> }
> }
> @@ -267,11 +281,12 @@ int klp_patch_object(struct klp_object *obj)
> return 0;
> }
>
> -void klp_unpatch_objects(struct klp_patch *patch)
> +/* Removes ftrace handler in all objects for the given function type. */
Same here.
> +void klp_unpatch_objects(struct klp_patch *patch, enum klp_func_type ftype)
> {
> struct klp_object *obj;
>
> klp_for_each_object(patch, obj)
> if (obj->patched)
> - klp_unpatch_object(obj);
> + klp_unpatch_object(obj, ftype);
> }
Miroslav
next prev parent reply other threads:[~2018-02-09 12:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 10:34 [PATCH v7 0/7] livepatch: Atomic replace feature Petr Mladek
2018-02-06 10:34 ` [PATCH v7 1/7] livepatch: Use lists to manage patches, objects and functions Petr Mladek
2018-02-09 10:06 ` Miroslav Benes
2018-02-06 10:34 ` [PATCH v7 2/7] livepatch: Free only structures with initialized kobject Petr Mladek
2018-02-09 10:06 ` Miroslav Benes
2018-02-06 10:34 ` [PATCH v7 3/7] livepatch: Initial support for dynamic structures Petr Mladek
2018-02-09 10:06 ` Miroslav Benes
2018-02-06 10:34 ` [PATCH v7 4/7] livepatch: Allow to unpatch only functions of the given type Petr Mladek
2018-02-09 12:29 ` Miroslav Benes [this message]
2018-02-06 10:34 ` [PATCH v7 5/7] livepatch: Support separate list for replaced patches Petr Mladek
2018-02-09 12:59 ` Miroslav Benes
2018-02-06 10:34 ` [PATCH v7 6/7] livepatch: Add atomic replace Petr Mladek
2018-02-12 15:54 ` Miroslav Benes
2018-02-06 10:34 ` [PATCH v7 7/7] livepatch: Atomic replace and cumulative patches documentation Petr Mladek
2018-02-06 17:07 ` Joe Lawrence
2018-02-14 16:16 ` [PATCH v7 0/7] livepatch: Atomic replace feature Miroslav Benes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.2.21.1802091326490.30746@pobox.suse.cz \
--to=mbenes@suse.cz \
--cc=eshatokhin@virtuozzo.com \
--cc=jbaron@akamai.com \
--cc=jeyu@kernel.org \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=pmladek@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®