From patchwork Thu May 8 10:09:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 29824 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06F91202DD for ; Thu, 8 May 2014 10:11:14 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id uy17sf6258429igb.11 for ; Thu, 08 May 2014 03:11:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=e2RyOWJw+bTZoKKCGSnLVsH1l0jvDvd/y+jquvHsb/k=; b=GyN5C4y6BV07Nq5gPl209ljbgT73CcqEq8EUQLyZwRQjU/uRZrNUfG6cT3zWo5JIvS WNWSdF9ur4/pMlA1N3kTAOeeDiTnDdUkTLWs5V48UpY8NoWkHZALBcm80Jzt5HyrFEsD wNfkryEIYins7sXy9CAUM0YIWpvD1A3P4HkLM8ZndAJQUts9/B3K8tK3cb8iP8rc+uJ/ frey9igHf4npzhQMxSJIym2kl56CMV/2ti3Xe0ecXCbLstMIMYNXYm/VmmjoBse53CGe wbXviQFOme5JMZhJTUos7MRChwM7SxhjUHg1WEwufCa6flwAhZxB9R9SwKt7f7veU0rD PqTw== X-Gm-Message-State: ALoCoQnZFmJ+bkq//vxXmBhR3js+4TmFiH0ECkds9PgyLnw+XDf2ih3J3EmZn898BH6KhAkO/h0U X-Received: by 10.182.79.41 with SMTP id g9mr1201173obx.41.1399543874252; Thu, 08 May 2014 03:11:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.145 with SMTP id c17ls3951325qgd.60.gmail; Thu, 08 May 2014 03:11:14 -0700 (PDT) X-Received: by 10.221.29.137 with SMTP id ry9mr2269604vcb.6.1399543874123; Thu, 08 May 2014 03:11:14 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id sn5si88558vdc.191.2014.05.08.03.11.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 May 2014 03:11:14 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lc6so2963741vcb.2 for ; Thu, 08 May 2014 03:11:14 -0700 (PDT) X-Received: by 10.58.13.104 with SMTP id g8mr2246573vec.16.1399543874046; Thu, 08 May 2014 03:11:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp383082vcb; Thu, 8 May 2014 03:11:13 -0700 (PDT) X-Received: by 10.52.169.67 with SMTP id ac3mr8263vdc.92.1399543873083; Thu, 08 May 2014 03:11:13 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id db15si96610vec.46.2014.05.08.03.11.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 08 May 2014 03:11:13 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WiLGh-0005gt-Ka; Thu, 08 May 2014 10:09:35 +0000 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 Received: from [85.158.143.35:39458] by server-1.bemta-4.messagelabs.com id 18/CB-09853-DD75B635; Thu, 08 May 2014 10:09:33 +0000 X-Env-Sender: david.vrabel@citrix.com X-Msg-Ref: server-8.tower-21.messagelabs.com!1399543771!3617224!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31743 invoked from network); 8 May 2014 10:09:32 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 8 May 2014 10:09:32 -0000 X-IronPort-AV: E=Sophos; i="4.97,1010,1389744000"; d="scan'208"; a="128913042" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 08 May 2014 10:09:30 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Thu, 8 May 2014 06:09:29 -0400 Received: from qabil.uk.xensource.com ([10.80.2.76]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WiLGb-00080G-Gb; Thu, 08 May 2014 11:09:29 +0100 From: David Vrabel To: Date: Thu, 8 May 2014 11:09:24 +0100 Message-ID: <1399543764-29054-3-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399543764-29054-1-git-send-email-david.vrabel@citrix.com> References: <1399543764-29054-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Boris Ostrovsky , Stefano Stabellini , David Vrabel Subject: [Xen-devel] [PATCH 2/2] arm, arm64/xen: introduce HYPERVISOR_suspend X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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)