From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: [PATCH 2/2] arm, arm64/xen: introduce HYPERVISOR_suspend Date: Thu, 8 May 2014 11:09:24 +0100 Message-ID: <1399543764-29054-3-git-send-email-david.vrabel@citrix.com> References: <1399543764-29054-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WiLGg-0005gS-BI for xen-devel@lists.xenproject.org; Thu, 08 May 2014 10:09:34 +0000 In-Reply-To: <1399543764-29054-1-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Boris Ostrovsky , Stefano Stabellini , David Vrabel List-Id: xen-devel@lists.xenproject.org From: Stefano Stabellini Introduce HYPERVISOR_suspend: it is a call to sched_op with an additional argument that is always 0 on arm and arm64. Introduce a few additional empty stubs for Xen arch specific functions called by drivers/xen/manage.c. Signed-off-by: Stefano Stabellini Signed-off-by: David Vrabel --- arch/arm/include/asm/xen/hypercall.h | 10 ++++++++++ arch/arm/xen/enlighten.c | 9 +++++++++ arch/arm/xen/hypercall.S | 6 ++++++ arch/arm64/xen/hypercall.S | 6 ++++++ 4 files changed, 31 insertions(+) diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h index 7704e28..24135be 100644 --- a/arch/arm/include/asm/xen/hypercall.h +++ b/arch/arm/include/asm/xen/hypercall.h @@ -48,6 +48,16 @@ int HYPERVISOR_memory_op(unsigned int cmd, void *arg); int HYPERVISOR_physdev_op(int cmd, void *arg); int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args); int HYPERVISOR_tmem_op(void *arg); +int HYPERVISOR_sched_op_shutdown(int cmd, void *arg, unsigned long unused); + +static inline int +HYPERVISOR_suspend(unsigned long start_info_mfn) +{ + struct sched_shutdown r = { .reason = SHUTDOWN_suspend }; + + /* start_info_mfn is unused on ARM, pass 0 instead */ + return HYPERVISOR_sched_op_shutdown(SCHEDOP_shutdown, &r, 0); +} static inline void MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va, diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index b96723e..7f01565 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); @@ -351,3 +359,4 @@ EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op); EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op); EXPORT_SYMBOL_GPL(HYPERVISOR_tmem_op); EXPORT_SYMBOL_GPL(privcmd_call); +EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op_shutdown); diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S index d1cf7b7..7da8837 100644 --- a/arch/arm/xen/hypercall.S +++ b/arch/arm/xen/hypercall.S @@ -102,3 +102,9 @@ ENTRY(privcmd_call) ldm sp!, {r4} mov pc, lr ENDPROC(privcmd_call); + +ENTRY(HYPERVISOR_sched_op_shutdown) + mov r12, #__HYPERVISOR_sched_op + __HVC(XEN_IMM) + mov pc, lr +ENDPROC(HYPERVISOR_sched_op_shutdown) diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S index 531342e..aa51678 100644 --- a/arch/arm64/xen/hypercall.S +++ b/arch/arm64/xen/hypercall.S @@ -91,3 +91,9 @@ ENTRY(privcmd_call) hvc XEN_IMM ret ENDPROC(privcmd_call); + +ENTRY(HYPERVISOR_sched_op_shutdown) + mov x16, #__HYPERVISOR_sched_op + hvc XEN_IMM + ret +ENDPROC(HYPERVISOR_sched_op_shutdown) -- 1.7.10.4