Skip to contentSkip to conversation

kimage: Allow load/exec for images with KEXEC_TYPE_LIVE_UPDATE

PATCH In review Varad Gautam 3 participants 3 messages Feb 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kimage: Allow load/exec for images with KEXEC_TYPE_LIVE_UPDATE

Do not -EINVAL on loading/execing an image if kexec type is KEXEC_TYPE_LIVE_UPDATE.

CC David Woodhouse <[email protected]>
---
 xen/common/kimage.c | 3 +++
 1 file changed, 3 insertions(+)
xen/common/kimage.c +3 -0
index 86d2797..599aa74 100644
@@ -421,6 +421,7 @@ struct page_info *kimage_alloc_control_page(struct kexec_image *image,
     switch ( image->type )
     {
     case KEXEC_TYPE_DEFAULT:
+    case KEXEC_TYPE_LIVE_UPDATE:
         pages = kimage_alloc_normal_control_page(image, memflags);
         break;
     case KEXEC_TYPE_CRASH:
@@ -775,6 +776,7 @@ static int kimage_load_segment(struct kexec_image *image, xen_kexec_segment_t *s
         switch ( image->type )
         {
         case KEXEC_TYPE_DEFAULT:
+        case KEXEC_TYPE_LIVE_UPDATE:
             result = kimage_load_normal_segment(image, segment);
             break;
         case KEXEC_TYPE_CRASH:
@@ -803,6 +805,7 @@ int kimage_alloc(struct kexec_image **rimage, uint8_t type, uint16_t arch,
     switch( type )
     {
     case KEXEC_TYPE_DEFAULT:
+    case KEXEC_TYPE_LIVE_UPDATE:
         result = kimage_normal_alloc(rimage, entry_maddr, nr_segments, segment);
         break;
     case KEXEC_TYPE_CRASH:
Signature · 20 lines
2.7.4




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879




_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 5 lines · Varad Gautam

Do not -EINVAL on loading/execing an image if kexec type is KEXEC_TYPE_LIVE_UPDATE.

CC David Woodhouse <[email protected]>

Please Cc maintainers on patches.

Quoted 19 lines
xen/common/kimage.c +2 -0
@@ -421,6 +421,7 @@ struct page_info *kimage_alloc_control_page(struct kexec_image *image,
     switch ( image->type )
     {
     case KEXEC_TYPE_DEFAULT:
+    case KEXEC_TYPE_LIVE_UPDATE:
         pages = kimage_alloc_normal_control_page(image, memflags);
         break;
     case KEXEC_TYPE_CRASH:
@@ -775,6 +776,7 @@ static int kimage_load_segment(struct kexec_image *image, xen_kexec_segment_t *s
         switch ( image->type )
         {
         case KEXEC_TYPE_DEFAULT:
+        case KEXEC_TYPE_LIVE_UPDATE:
             result = kimage_load_normal_segment(image, segment);
             break;
         case KEXEC_TYPE_CRASH:

xen/common/kimage.c int kimage_alloc(struct kexec_image **rimage, uint8_t type, uint16_t arch, · line 811

Quoted 7 lines
xen/common/kimage.c +1 -0
@@ -803,6 +805,7 @@ int kimage_alloc(struct kexec_image **rimage, uint8_t type, uint16_t arch,
     switch( type )
     {
     case KEXEC_TYPE_DEFAULT:
+    case KEXEC_TYPE_LIVE_UPDATE:
         result = kimage_normal_alloc(rimage, entry_maddr, nr_segments, segment);
         break;
     case KEXEC_TYPE_CRASH:

You don't mention any prereq patches, and I can't see any definition of KEXEC_TYPE_LIVE_UPDATE in the public headers. IOW I can't see how this patch would be able to not break the build on current staging. Please clarify.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 4 lines · Jan Beulich

You don't mention any prereq patches, and I can't see any definition of KEXEC_TYPE_LIVE_UPDATE in the public headers. IOW I can't see how this patch would be able to not break the build on current staging. Please clarify.

I don't think this was meant to go to the list.

It's a fixup for the patch I posted in my RFC series at
https://lists.xenproject.org/archives/html/xen-devel/2020-01/msg02690.html

The original testing was just hard-coding addresses and using a 'normal' kexec load, and we were only testing KEXEC_TYPE_LIVE_UPDATE for the actual kexec_exec.

Once Varad had implemented the automatic placement support in kexec userspace tools, we spotted that the load operation wasn't working for KEXEC_TYPE_LIVE_UPDATE, hence this fixup.

I merged it into the appropriate patch in my tree some time last week.
https://xenbits.xen.org/gitweb/?p=people/dwmw2/xen.git;a=commitdiff;h=0bf4204cdb5f4fb8d17ead8df3e4fda37cfd6a28

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel