Skip to contentSkip to conversation

kexec: Introduce --load-live-update for xen

PATCH Simon Horman 2 participants 2 messages Apr 1, 2020 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 11 lines · Varad Gautam

Xen is intended to expose a KEXEC_TYPE_LIVE_UPDATE operation which implies a stateful-kexec into a new xen image - or a "live update". Make kexec-tools capable of triggering a live update.

For a multiboot2 xen image, this will:
- load a xen Elf into into KEXEC_RANGE_MA_XEN
- load purgatory and modules into KEXEC_RANGE_MA_LIVEUPDATE
- append Elf cmdline with " liveupdate=<size>@<addr>

CC David Woodhouse <[email protected]>

Sorry for the long delay.

This patch does not appear to compile.

gcc -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat -O2 -fomit-frame-pointer -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/x86_64/include -c -MD -o kexec/kexec.o kexec/kexec.c kexec/kexec.c: In function ‘my_shutdown’:
kexec/kexec.c:889:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
"shutdown",
^~~~~~~~~~
kexec/kexec.c:890:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
"-r",
^~~~
kexec/kexec.c:891:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
"now",
^~~~~
kexec/kexec.c: In function ‘cmdline_add_liveupdate’:
kexec/kexec.c:1187:2: warning: implicit declaration of function ‘xen_get_kexec_range’; did you mean ‘xen_kexec_status’? [-Wimplicit-function-declaration]
xen_get_kexec_range(KEXEC_RANGE_MA_LIVEUPDATE, &lu_start, &lu_end);
^~~~~~~~~~~~~~~~~~~
xen_kexec_status
kexec/kexec.c:1187:22: error: ‘KEXEC_RANGE_MA_LIVEUPDATE’ undeclared (first use in this function)

  xen_get_kexec_range(KEXEC_RANGE_MA_LIVEUPDATE, &lu_start, &lu_end);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
kexec/kexec.c:1187:22: note: each undeclared identifier is reported only once for each function it appears in
kexec/kexec.c: In function ‘main’:
kexec/kexec.c:1433:37: error: ‘KEXEC_LIVE_UPDATE’ undeclared (first use in this function); did you mean ‘KEXEC_LOADED_PATH’?
            KEXEC_PRESERVE_CONTEXT : KEXEC_LIVE_UPDATE;
                                     ^~~~~~~~~~~~~~~~~
                                     KEXEC_LOADED_PATH
kexec/kexec.c:1374:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
    kexec_debug = 1;
    ~~~~~~~~~~~~^~~

kexec/kexec.c:1375:3: note: here
case OPT_NOIFDOWN:
^~~~
make: *** [Makefile:114: kexec/kexec.o] Error 1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 37 lines · Simon Horman

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

Quoted 11 lines · Varad Gautam

Xen is intended to expose a KEXEC_TYPE_LIVE_UPDATE operation which implies a stateful-kexec into a new xen image - or a "live update". Make kexec-tools capable of triggering a live update.

For a multiboot2 xen image, this will:
- load a xen Elf into into KEXEC_RANGE_MA_XEN
- load purgatory and modules into KEXEC_RANGE_MA_LIVEUPDATE
- append Elf cmdline with " liveupdate=<size>@<addr>

CC David Woodhouse <[email protected]>

Sorry for the long delay.

This patch does not appear to compile.

gcc -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat -O2 -fomit-frame-pointer -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/x86_64/include -c -MD -o kexec/kexec.o kexec/kexec.c kexec/kexec.c: In function ‘my_shutdown’:
kexec/kexec.c:889:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

    "shutdown",
    ^~~~~~~~~~
kexec/kexec.c:890:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    "-r",
    ^~~~
kexec/kexec.c:891:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    "now",
    ^~~~~
kexec/kexec.c: In function ‘cmdline_add_liveupdate’:
kexec/kexec.c:1187:2: warning: implicit declaration of function ‘xen_get_kexec_range’; did you mean ‘xen_kexec_status’? [-Wimplicit-function-declaration]
   xen_get_kexec_range(KEXEC_RANGE_MA_LIVEUPDATE, &lu_start, &lu_end);
   ^~~~~~~~~~~~~~~~~~~
   xen_kexec_status

kexec/kexec.c:1187:22: error: ‘KEXEC_RANGE_MA_LIVEUPDATE’ undeclared (first use in this function)

Quoted 8 lines
   xen_get_kexec_range(KEXEC_RANGE_MA_LIVEUPDATE, &lu_start, &lu_end);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
kexec/kexec.c:1187:22: note: each undeclared identifier is reported only once for each function it appears in
kexec/kexec.c: In function ‘main’:
kexec/kexec.c:1433:37: error: ‘KEXEC_LIVE_UPDATE’ undeclared (first use in this function); did you mean ‘KEXEC_LOADED_PATH’?
             KEXEC_PRESERVE_CONTEXT : KEXEC_LIVE_UPDATE;
                                      ^~~~~~~~~~~~~~~~~
                                      KEXEC_LOADED_PATH

I see, the symbols I added are hidden behind HAVE_LIBXENCTRL, and I'm able to compile with --with-xen=yes without this happening: https://paste.opensuse.org/67739589 .

I'll rework this to work on both xen and non-xen setups and send again.

Varad

Quoted 8 lines

kexec/kexec.c:1374:16: warning: this statement may fall through [-Wimplicit-fallthrough=]

     kexec_debug = 1;
     ~~~~~~~~~~~~^~~
kexec/kexec.c:1375:3: note: here
    case OPT_NOIFDOWN:
    ^~~~

make: *** [Makefile:114: kexec/kexec.o] Error 1

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

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec