diff mbox series

[RFC,v3,06/22] Add IND_WRITE64 primitive to kexec kimage

Message ID 20200130161330.2324143-6-dwmw2@infradead.org (mailing list archive)
State New, archived
Headers show
Series Live update: boot memory management, data stream handling, record format | expand

Commit Message

David Woodhouse Jan. 30, 2020, 4:13 p.m. UTC
From: David Woodhouse <dwmw@amazon.co.uk>

This allows a single page-aligned physical address to be written to
the current destination, intended to pass the location of the live
update data stream from one Xen to the next.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 xen/arch/x86/x86_64/kexec_reloc.S | 9 ++++++++-
 xen/include/xen/kimage.h          | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/xen/arch/x86/x86_64/kexec_reloc.S b/xen/arch/x86/x86_64/kexec_reloc.S
index d488d127cf..a75f989926 100644
--- a/xen/arch/x86/x86_64/kexec_reloc.S
+++ b/xen/arch/x86/x86_64/kexec_reloc.S
@@ -131,11 +131,18 @@  is_source:
         jmp     next_entry
 is_zero:
         testb   $IND_ZERO, %cl
-        jz      next_entry
+        jz      is_write64
         movl    $(PAGE_SIZE / 8), %ecx  /* Zero the destination page. */
         xorl    %eax, %eax
         rep stosq
         jmp     next_entry
+is_write64:
+        testb   $IND_WRITE64, %cl
+        jz      next_entry
+        andq    $PAGE_MASK, %rcx
+        movq    %rcx, %rax
+        stosq
+        jmp     next_entry
 done:
         popq    %rbx
         ret
diff --git a/xen/include/xen/kimage.h b/xen/include/xen/kimage.h
index cbfb9e9054..e94839d7c3 100644
--- a/xen/include/xen/kimage.h
+++ b/xen/include/xen/kimage.h
@@ -6,6 +6,7 @@ 
 #define IND_DONE         0x4
 #define IND_SOURCE       0x8
 #define IND_ZERO        0x10
+#define IND_WRITE64     0x20
 
 #ifndef __ASSEMBLY__