Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macros: add KPATCH_REVERT_FUNCTION macro #715

Closed
wants to merge 1 commit into from

Conversation

jpoimboe
Copy link
Member

Add a KPATCH_REVERT_FUNCTION macro for forcing a function to be patched
with its original contents. This is needed for the case where the patch
is a cumulative upgrade to a previous patch which modified the function,
and now the current patch needs to revert that change.

This is basically a copy/paste/modify job from KPATCH_IGNORE_FUNCTION
and kpatch_mark_ignored_functions_same().

Add a KPATCH_REVERT_FUNCTION macro for forcing a function to be patched
with its original contents.  This is needed for the case where the patch
is a cumulative upgrade to a previous patch which modified the function,
and now the current patch needs to revert that change.

This is basically a copy/paste/modify job from KPATCH_IGNORE_FUNCTION
and kpatch_mark_ignored_functions_same().
@jpoimboe
Copy link
Member Author

This probably needs a patch author guide update as well, to document the steps:

  1. compile v1 and note the list of changed functions

  2. compile v2 (without KPATCH_REVERT_FUNCTION macro) and note the
    list of changed functions

  3. for those functions which changed in v1 and did not change in v2,
    annotate them with KPATCH_REVERT_FUNCTION

@jpoimboe
Copy link
Member Author

We had problems testing this macro in a case where the function symbol had an isra suffix. Adding a reference to the function name caused gcc to change its inlining decision for the function, causing the isra suffix to get removed, and then a seg fault happened.

So I'm going to drop this patch for now. We can use #716 to track the fact that we'll need to bring back the replace feature, or something comparable, to make cumulative update reverts more straightforward.

@jpoimboe jpoimboe closed this Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant