diff mbox series

kimage: Allow load/exec for images with KEXEC_TYPE_LIVE_UPDATE

Message ID 1581066052-25269-1-git-send-email-vrd@amazon.de (mailing list archive)
State New, archived
Headers show
Series kimage: Allow load/exec for images with KEXEC_TYPE_LIVE_UPDATE | expand

Commit Message

Varad Gautam Feb. 7, 2020, 9 a.m. UTC
Do not -EINVAL on loading/execing an image if kexec type is
KEXEC_TYPE_LIVE_UPDATE.

Signed-off-by: Varad Gautam <vrd@amazon.de>
CC: David Woodhouse <dwmw@amazon.co.uk>
---
 xen/common/kimage.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jan Beulich Feb. 7, 2020, 9:24 a.m. UTC | #1
On 07.02.2020 10:00, Varad Gautam wrote:
> Do not -EINVAL on loading/execing an image if kexec type is
> KEXEC_TYPE_LIVE_UPDATE.
> 
> Signed-off-by: Varad Gautam <vrd@amazon.de>
> CC: David Woodhouse <dwmw@amazon.co.uk>

Please Cc maintainers on patches.

> --- a/xen/common/kimage.c
> +++ b/xen/common/kimage.c
> @@ -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:

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
David Woodhouse Feb. 7, 2020, 10:25 a.m. UTC | #2
On Fri, 2020-02-07 at 10:24 +0100, Jan Beulich wrote:
> 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
diff mbox series

Patch

diff --git a/xen/common/kimage.c b/xen/common/kimage.c
index 86d2797..599aa74 100644
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -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: