diff mbox

[Xen-devel,2/2] arm, arm64/xen: introduce HYPERVISOR_suspend

Message ID alpine.DEB.2.02.1405081644070.14596@kaball.uk.xensource.com
State New
Headers show

Commit Message

Stefano Stabellini May 8, 2014, 3:54 p.m. UTC
On Thu, 8 May 2014, David Vrabel wrote:
> From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> Introduce HYPERVISOR_suspend: it is a call to sched_op with an
> additional argument that is always 0 on arm and arm64.

Given that the third argument is not actually mandatory, we can have a
simpler arm side patch:

---

arm,arm64/xen: introduce HYPERVISOR_suspend

Introduce HYPERVISOR_suspend.
Also introduce a few additional empty stubs for Xen arch specific
functions called by drivers/xen/manage.c.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Comments

David Vrabel May 12, 2014, 4:50 p.m. UTC | #1
On 08/05/14 16:54, Stefano Stabellini wrote:
> On Thu, 8 May 2014, David Vrabel wrote:
>> From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>
>> Introduce HYPERVISOR_suspend: it is a call to sched_op with an
>> additional argument that is always 0 on arm and arm64.
> 
> Given that the third argument is not actually mandatory, we can have a
> simpler arm side patch:

Thanks.

Applied to devel/for-linus-3.16

David
diff mbox

Patch

diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h
index 7658150..712b50e 100644
--- a/arch/arm/include/asm/xen/hypercall.h
+++ b/arch/arm/include/asm/xen/hypercall.h
@@ -34,6 +34,7 @@ 
 #define _ASM_ARM_XEN_HYPERCALL_H
 
 #include <xen/interface/xen.h>
+#include <xen/interface/sched.h>
 
 long privcmd_call(unsigned call, unsigned long a1,
 		unsigned long a2, unsigned long a3,
@@ -50,6 +51,15 @@  int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
 int HYPERVISOR_tmem_op(void *arg);
 int HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr);
 
+static inline int
+HYPERVISOR_suspend(unsigned long start_info_mfn)
+{
+	struct sched_shutdown r = { .reason = SHUTDOWN_suspend };
+
+	/* start_info_mfn is unused on ARM */
+	return HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
+}
+
 static inline void
 MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
 			unsigned int new_val, unsigned long flags)
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index b96723e..1a7087b 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -339,6 +339,14 @@  static int __init xen_pm_init(void)
 }
 late_initcall(xen_pm_init);
 
+
+/* empty stubs */
+void xen_arch_pre_suspend(void) { }
+void xen_arch_post_suspend(int suspend_cancelled) { }
+void xen_timer_resume(void) { }
+void xen_arch_resume(void) { }
+
+
 /* In the hypervisor.S file. */
 EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
 EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);