]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
x86/kexec: add IND_WRITE64 primitive to kexec kimage
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 15 Jan 2020 16:58:44 +0000 (17:58 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 18 Mar 2020 23:42:36 +0000 (23:42 +0000)
This allows a single page-aligned physical address to be written to
the current destination, intended to place the 'breadcrumb' leading to
the live update data stream into the first page of the reserved boot
memory (which might be in active use by the running Xen, so can't be
written earlier).

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
xen/arch/x86/x86_64/kexec_reloc.S
xen/include/xen/kimage.h

index d488d127cfb9a91de24d37909a4db132cdb42adb..a75f989926d248e6b9365064ba3b1a3c42c191a3 100644 (file)
@@ -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
index cbfb9e9054dfbe0fbecee8db3a5cc709ce53f300..e94839d7c3d993f0f297b4763af5425e36162d53 100644 (file)
@@ -6,6 +6,7 @@
 #define IND_DONE         0x4
 #define IND_SOURCE       0x8
 #define IND_ZERO        0x10
+#define IND_WRITE64     0x20
 
 #ifndef __ASSEMBLY__