summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/epapr_paravirt.c
diff options
context:
space:
mode:
authorLiu Yu-B13201 <Yu.Liu@freescale.com>2012-07-03 05:48:53 +0000
committerAlexander Graf <agraf@suse.de>2012-10-05 23:38:37 +0200
commit2f979de8a716bdbdc9f4db532652fbca08ed710c (patch)
tree14f51a0b1c1b71f6981d4723a165fe284c70f38d /arch/powerpc/kernel/epapr_paravirt.c
parent9202e07636f0c4858ba6c30773a3f160b2b5659a (diff)
downloadblackbird-op-linux-2f979de8a716bdbdc9f4db532652fbca08ed710c.tar.gz
blackbird-op-linux-2f979de8a716bdbdc9f4db532652fbca08ed710c.zip
KVM: PPC: ev_idle hcall support for e500 guests
Signed-off-by: Liu Yu <yu.liu@freescale.com> [varun: 64-bit changes] Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kernel/epapr_paravirt.c')
-rw-r--r--arch/powerpc/kernel/epapr_paravirt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
index 028aeae370b6..f3eab8594d9f 100644
--- a/arch/powerpc/kernel/epapr_paravirt.c
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -21,6 +21,10 @@
#include <asm/epapr_hcalls.h>
#include <asm/cacheflush.h>
#include <asm/code-patching.h>
+#include <asm/machdep.h>
+
+extern void epapr_ev_idle(void);
+extern u32 epapr_ev_idle_start[];
bool epapr_paravirt_enabled;
@@ -41,8 +45,13 @@ static int __init epapr_paravirt_init(void)
if (len % 4 || len > (4 * 4))
return -ENODEV;
- for (i = 0; i < (len / 4); i++)
+ for (i = 0; i < (len / 4); i++) {
patch_instruction(epapr_hypercall_start + i, insts[i]);
+ patch_instruction(epapr_ev_idle_start + i, insts[i]);
+ }
+
+ if (of_get_property(hyper_node, "has-idle", NULL))
+ ppc_md.power_save = epapr_ev_idle;
epapr_paravirt_enabled = true;
OpenPOWER on IntegriCloud