Skip to content

RFC 'reset everything' approach to PVHVM guest kexec

Vitaly Kuznetsov xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xen: evtchn: make evtchn_reset() ready for soft resetxen/common/event_channel.c xen/include/xen/event.h xen/include/xen/sched.h+35 -218 replies
2/4xen: grant_table: implement grant_table_soft_reset()xen/common/grant_table.c xen/include/xen/grant_table.h+68 -06 replies
3/4xen: implement SCHEDOP_soft_resetxen/common/domain.c xen/common/schedule.c xen/include/public/sched.h +1 more+46 -47 replies
4/4xen: arch-specific hooks for domain_soft_reset()xen/arch/arm/domain.c xen/arch/x86/domain.c xen/common/domain.c +1 more+82 -05 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Scott
SeriesA-b A-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 0/4] 'reset everything' approach to PVHVM guest kexec

Jan and Tim,

last week you expressed some concerns about if the toolstack-based approach to PVHVM guest kexec is the best. Here you can see the 'reset everything' approach to the same problem. It is the bare minimum of what should be done to make it possible for the new kernel to boot. Despite the fact that this implementation is much smaller in size and that it doesn't require any toolstack changes I'm personally in favor of the previous toolstack-based approach as it looks more general, less fragile and easier to support to me. Please let me know your thoughts.

I used SCHEDOP_ interface here as DOMCTL_* is not currently supported in Linux kernel and I seriously doubt we need to support something different from DOMID_SELF for soft reset.

Current Linux kernel requires two changes to make use of these hypervisor changes:
1) As XS_RESET_WATCHES is not supported by oxenstored we need to try removing the watch in case add operation failed, e.g.:

drivers/xen/xenbus/xenbus_xs.c +4 -0
@@ -712,6 +712,10 @@ int register_xenbus_watch(struct xenbus_watch *watch)
        spin_unlock(&watches_lock);
 
        err = xs_watch(watch->node, token);
+       if (err) {
+               if (!xs_unwatch(watch->node, token))
+                       err = xs_watch(watch->node, token);
+       }
 
        if (err) {
                spin_lock(&watches_lock);

2) HYPERVISOR_sched_op(SCHEDOP_soft_reset, NULL) is supposed to be called in kexec/kdump situation (via machine_ops.shutdown and machine_ops.crash_shutdown handlers).

v7 of the toolstack-based approach is available here:
http://comments.gmane.org/gmane.comp.emulators.xen.devel/245183
(for some reason it is missing on http://lists.xen.org/archives/html/xen-devel/2015-05/,
there are no messages in May after May, 26 and this series was sent on May, 27)

Vitaly Kuznetsov (4):
xen: evtchn: make evtchn_reset() ready for soft reset
xen: grant_table: implement grant_table_soft_reset()
xen: implement SCHEDOP_soft_reset
xen: arch-specific hooks for domain_soft_reset()

 xen/arch/arm/domain.c         |  5 +++
 xen/arch/x86/domain.c         | 73 +++++++++++++++++++++++++++++++++++++++++++
 xen/common/domain.c           | 39 ++++++++++++++++++++---
 xen/common/event_channel.c    | 52 +++++++++++++++++-------------
 xen/common/grant_table.c      | 62 ++++++++++++++++++++++++++++++++++++
 xen/common/schedule.c         |  4 +++
 xen/include/public/sched.h    |  7 +++++
 xen/include/xen/domain.h      |  4 +++
 xen/include/xen/event.h       |  3 ++
 xen/include/xen/grant_table.h |  6 ++++
 xen/include/xen/sched.h       |  1 +
 11 files changed, 231 insertions(+), 25 deletions(-)
Signature · 1 line
1.9.3