]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
create-diff-object: Add support for applied/reverted marker
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Tue, 26 Nov 2019 12:25:08 +0000 (12:25 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Thu, 6 Feb 2020 16:26:05 +0000 (16:26 +0000)
With version 2 of a payload structure additional field is supported
to track whether given function has been applied or reverted.
There also comes additional 8-byte alignment padding to reserve
place for future flags and options.

The new fields are zero-out upon .livepatch.funcs section creation.

Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
common.h
create-diff-object.c

index 2122b93ae9ec26ff5e0c553bd84da8f7d6e26514..7a6620387e6d72be0efa9ff5c278f720839f3c8d 100644 (file)
--- a/common.h
+++ b/common.h
@@ -124,6 +124,8 @@ struct livepatch_patch_func {
        uint32_t old_size;
        uint8_t version;
        unsigned char pad[31];
+       uint8_t applied;
+       uint8_t _pad[7];
 };
 
 struct special_section {
index bebfc46550f7fba13e5f40f1152825703ae9e706..e54821c2babffb32d61bc1153ff05baad9e7cba3 100644 (file)
@@ -2026,8 +2026,10 @@ static void livepatch_create_patches_sections(struct kpatch_elf *kelf,
                        funcs[index].old_size = result.size;
                        funcs[index].new_addr = 0;
                        funcs[index].new_size = sym->sym.st_size;
-                       funcs[index].version = 1;
+                       funcs[index].version = 2;
                        memset(funcs[index].pad, 0, sizeof funcs[index].pad);
+                       funcs[index].applied = 0;
+                       memset(funcs[index]._pad, 0, sizeof funcs[index]._pad);
 
                        /*
                         * Add a relocation that will populate