]> xenbits.xensource.com Git - mini-os.git/commitdiff
Save/Restore Support: Refactor HYPERVISOR_suspend hypercall
authorBruno Alvisio <bruno.alvisio@gmail.com>
Mon, 11 Dec 2017 06:51:07 +0000 (22:51 -0800)
committerWei Liu <wei.liu2@citrix.com>
Wed, 21 Mar 2018 09:16:49 +0000 (09:16 +0000)
Directly using the SHUTDOWN_suspend macro as a parameter for the schedop
hypercall causes an error in the Xen hypercall handler. Also for consistency,
the SHUTDOWN_suspend param is wrapped in the sched_shutdown struct.

Signed-off-by: Bruno Alvisio <bruno.alvisio@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
include/x86/x86_32/hypercall-x86_32.h
include/x86/x86_64/hypercall-x86_64.h

index 5c93464c02438bf8e40df8fb18617ebc7c1f60e6..70505a45304b650a0ce05621e604b66f8f8194a9 100644 (file)
@@ -298,8 +298,8 @@ static inline int
 HYPERVISOR_suspend(
        unsigned long srec)
 {
-       return _hypercall3(int, sched_op, SCHEDOP_shutdown,
-                          SHUTDOWN_suspend, srec);
+       struct sched_shutdown shutdown = { .reason = SHUTDOWN_suspend };
+       return _hypercall3(int, sched_op, SCHEDOP_shutdown, &shutdown, srec);
 }
 
 static inline int
index 617181293a7c9e576143944c9ff5763167a3a634..95f8adea2771c17ce4c8dfcb9425713f2d5ee14f 100644 (file)
@@ -305,8 +305,8 @@ static inline int
 HYPERVISOR_suspend(
        unsigned long srec)
 {
-       return _hypercall3(int, sched_op, SCHEDOP_shutdown,
-                          SHUTDOWN_suspend, srec);
+       struct sched_shutdown shutdown = { .reason = SHUTDOWN_suspend };
+       return _hypercall3(int, sched_op, SCHEDOP_shutdown, &shutdown, srec);
 }
 
 static inline int