]> xenbits.xensource.com Git - people/wipawel/livepatch-build-tools/commitdiff
create-diff-object: Add support for applied/reverted marker
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Fri, 5 Oct 2018 08:08:11 +0000 (08:08 +0000)
committerPawel Wieczorkiewicz <wipawel@amazon.de>
Thu, 8 Aug 2019 14:32:25 +0000 (14:32 +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>
common.h
create-diff-object.c

index 06e19e76f78a5e23b438cef93bc0ce2116fa5791..d8cde35fa29db522d003ad31cc0d1ecf61ea087d 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 263c7d23a4d51725fbb877f7b38a34ab047d1d68..534516bc9c5d5b01a98257bc6430d9fe6027943d 100644 (file)
@@ -2009,8 +2009,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