dynup/kpatch — pull request #322 by spartacus06 (2014-07-22 16:34:44+00:00)
Title: add support for manually ignore functions

This commit adds the __kpatch_ignore macro for ignore functions that
may change as a side effect of a change in another function. The WARN
class of macros, for example, embed the line number in an instruction,
which will cause the function to be detected as changed when, in fact,
there has been no functional change.

Just at __kpatch_ignore to the function definition (like you would
__init) to cause the function to be ignored.

Test patches:

To see the problem
```
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index bf233b2..9bf17c6 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2322,6 +2322,7 @@ static unsigned long pvm_determine_end(struct vmap_area **pnext,
const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
unsigned long addr;

+ pr_info("here!\n");
if (*pnext)
addr = min((*pnext)->va_start & ~(align - 1), vmalloc_end);
else
```

To see how the macro fixes the problem
```
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index bf233b2..a5a7f16 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2322,6 +2322,7 @@ static unsigned long pvm_determine_end(struct vmap_area **pnext,
const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
unsigned long addr;

+ pr_info("here!\n");
if (*pnext)
addr = min((*pnext)->va_start & ~(align - 1), vmalloc_end);
else
@@ -2359,7 +2360,8 @@ static unsigned long pvm_determine_end(struct vmap_area **pnext,
* area. Scanning is repeated till all the areas fit and then all
* necessary data structres are inserted and the result is returned.
*/
-struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
+#include "kpatch-macros.h"
+struct vm_struct __kpatch_ignore **pcpu_get_vm_areas(const unsigned long *offsets,
const size_t *sizes, int nr_vms,
size_t align)
{
```