[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH] include/xen-x86/hypercall: Fix HYPERVISOR_suspend hypercall



Making the hypercall by directly using the macro SHUTDOWN_suspend
causes an EFAULT error. The suspend reason needs to be sent as an
address where the reason value needs to be set.

Signed-off-by: Radu Nicolau <radunicolau102@xxxxxxxxx>
---
 plat/xen/include/xen-x86/hypercall32.h | 4 ++--
 plat/xen/include/xen-x86/hypercall64.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plat/xen/include/xen-x86/hypercall32.h 
b/plat/xen/include/xen-x86/hypercall32.h
index b255df1..662ebb2 100644
--- a/plat/xen/include/xen-x86/hypercall32.h
+++ b/plat/xen/include/xen-x86/hypercall32.h
@@ -309,8 +309,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
diff --git a/plat/xen/include/xen-x86/hypercall64.h 
b/plat/xen/include/xen-x86/hypercall64.h
index 134078f..467d8fa 100644
--- a/plat/xen/include/xen-x86/hypercall64.h
+++ b/plat/xen/include/xen-x86/hypercall64.h
@@ -316,8 +316,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
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.