From: Ram Pai <linuxram@us.ibm.com>
To: kvm-ppc@vger.kernel.org
Subject: [PATCH 01/13] KVM: PPC: Ultravisor: generic ucall handler plpar_ucall()
Date: Tue, 22 Jan 2019 15:59:32 +0000 [thread overview]
Message-ID: <1548172784-27414-2-git-send-email-linuxram@us.ibm.com> (raw)
plpar_ucall() function can now be used to make ucalls
with varied number of in and out arguments. It handles
4 out arguments and a lot of in arguments.
copies the implementation of plpar_hcall().
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
arch/powerpc/platforms/powernv/Makefile | 1 +
arch/powerpc/platforms/powernv/uvCall.S | 41 +++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 arch/powerpc/platforms/powernv/uvCall.S
diff --git a/arch/powerpc/platforms/powernv/Makefile b/arch/powerpc/platforms/powernv/Makefile
index b540ce8e..5ae1df02 100644
--- a/arch/powerpc/platforms/powernv/Makefile
+++ b/arch/powerpc/platforms/powernv/Makefile
@@ -4,6 +4,7 @@ obj-y += opal-rtc.o opal-nvram.o opal-lpc.o opal-flash.o
obj-y += rng.o opal-elog.o opal-dump.o opal-sysparam.o opal-sensor.o
obj-y += opal-msglog.o opal-hmi.o opal-power.o opal-irqchip.o
obj-y += opal-kmsg.o opal-powercap.o opal-psr.o opal-sensor-groups.o
+obj-y += uvCall.o
obj-$(CONFIG_SMP) += smp.o subcore.o subcore-asm.o
obj-$(CONFIG_PCI) += pci.o pci-ioda.o npu-dma.o pci-ioda-tce.o
diff --git a/arch/powerpc/platforms/powernv/uvCall.S b/arch/powerpc/platforms/powernv/uvCall.S
new file mode 100644
index 0000000..a5e976a
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/uvCall.S
@@ -0,0 +1,41 @@
+/*
+ * This file contains the generic code to perform a ultracall.
+ *
+ * Copyright IBM Corporation 2019.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <linux/jump_label.h>
+#include <asm/ppc_asm.h>
+#include <asm/asm-offsets.h>
+
+_GLOBAL_TOC(plpar_ucall)
+
+ mfcr r0
+ stw r0,8(r1)
+ mr r0,r3
+
+ std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
+
+ mr r3,r5
+ mr r4,r6
+ mr r5,r7
+ mr r6,r8
+ mr r7,r9
+ mr r8,r10
+
+ sc 2 /* invoke the ultravisor */
+
+ ld r12,STK_PARAM(R4)(r1)
+ std r4, 0(r12)
+ std r5, 8(r12)
+ std r6, 16(r12)
+ std r7, 24(r12)
+
+ lwz r0,8(r1)
+ mtcrf 0xff,r0
+
+ blr /* return r3 = status */
--
1.8.3.1
next reply other threads:[~2019-01-22 15:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 15:59 Ram Pai [this message]
2019-01-22 23:32 ` [PATCH 01/13] KVM: PPC: Ultravisor: generic ucall handler plpar_ucall() Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1548172784-27414-2-git-send-email-linuxram@us.ibm.com \
--to=linuxram@us.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox