From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: qemu-devel@nongnu.org
Cc: Eric Farman <farman@linux.vnet.ibm.com>,
borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com,
Cornelia Huck <cornelia.huck@de.ibm.com>,
agraf@suse.de
Subject: [Qemu-devel] [PATCH 03/10] s390x: Store Additional Status SIGP order
Date: Wed, 20 May 2015 18:33:19 +0200 [thread overview]
Message-ID: <1432139606-23705-4-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1432139606-23705-1-git-send-email-cornelia.huck@de.ibm.com>
From: Eric Farman <farman@linux.vnet.ibm.com>
Add handling for the Store Additional Status at Address order
that exists for the Signal Processor (SIGP) instruction.
Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
target-s390x/cpu.h | 1 +
target-s390x/kvm.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+)
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 708349c..031f94d 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -945,6 +945,7 @@ struct sysib_322 {
#define SIGP_SET_PREFIX 0x0d
#define SIGP_STORE_STATUS_ADDR 0x0e
#define SIGP_SET_ARCH 0x12
+#define SIGP_STORE_ADTL_STATUS 0x17
/* SIGP condition codes */
#define SIGP_CC_ORDER_CODE_ACCEPTED 0
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index ca8ffcc..61e1321 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -1373,6 +1373,28 @@ static void sigp_stop(void *arg)
si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
}
+#define ADTL_SAVE_AREA_SIZE 1024
+static int kvm_s390_store_adtl_status(S390CPU *cpu, hwaddr addr)
+{
+ void *mem;
+ hwaddr len = ADTL_SAVE_AREA_SIZE;
+
+ mem = cpu_physical_memory_map(addr, &len, 1);
+ if (!mem) {
+ return -EFAULT;
+ }
+ if (len != ADTL_SAVE_AREA_SIZE) {
+ cpu_physical_memory_unmap(mem, len, 1, 0);
+ return -EFAULT;
+ }
+
+ memcpy(mem, &cpu->env.vregs, 512);
+
+ cpu_physical_memory_unmap(mem, len, 1, len);
+
+ return 0;
+}
+
#define KVM_S390_STORE_STATUS_DEF_ADDR offsetof(LowCore, floating_pt_save_area)
#define SAVE_AREA_SIZE 512
static int kvm_s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch)
@@ -1461,6 +1483,36 @@ static void sigp_store_status_at_address(void *arg)
si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
}
+static void sigp_store_adtl_status(void *arg)
+{
+ SigpInfo *si = arg;
+
+ if (!kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS)) {
+ set_sigp_status(si, SIGP_STAT_INVALID_ORDER);
+ return;
+ }
+
+ /* cpu has to be stopped */
+ if (s390_cpu_get_state(si->cpu) != CPU_STATE_STOPPED) {
+ set_sigp_status(si, SIGP_STAT_INCORRECT_STATE);
+ return;
+ }
+
+ /* parameter must be aligned to 1024-byte boundary */
+ if (si->param & 0x3ff) {
+ set_sigp_status(si, SIGP_STAT_INVALID_PARAMETER);
+ return;
+ }
+
+ cpu_synchronize_state(CPU(si->cpu));
+
+ if (kvm_s390_store_adtl_status(si->cpu, si->param)) {
+ set_sigp_status(si, SIGP_STAT_INVALID_PARAMETER);
+ return;
+ }
+ si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
+}
+
static void sigp_restart(void *arg)
{
SigpInfo *si = arg;
@@ -1578,6 +1630,9 @@ static int handle_sigp_single_dst(S390CPU *dst_cpu, uint8_t order,
case SIGP_STORE_STATUS_ADDR:
run_on_cpu(CPU(dst_cpu), sigp_store_status_at_address, &si);
break;
+ case SIGP_STORE_ADTL_STATUS:
+ run_on_cpu(CPU(dst_cpu), sigp_store_adtl_status, &si);
+ break;
case SIGP_SET_PREFIX:
run_on_cpu(CPU(dst_cpu), sigp_set_prefix, &si);
break;
--
2.4.1
next prev parent reply other threads:[~2015-05-20 16:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 16:33 [Qemu-devel] [PATCH 00/10] s390x: SIMD support Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 01/10] s390x: Common access to floating point registers Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 02/10] s390x: Vector Register IOCTLs Cornelia Huck
2015-05-20 16:33 ` Cornelia Huck [this message]
2015-05-20 16:33 ` [Qemu-devel] [PATCH 04/10] gdb-xml: Include XML for s390 vector registers Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 05/10] s390x: gdb updates for " Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 06/10] s390x: Add vector registers to HMP output Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 07/10] linux/elf.h update Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 08/10] s390x: Add vector registers to ELF dump Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 09/10] s390x: Migrate vector registers Cornelia Huck
2015-05-20 16:33 ` [Qemu-devel] [PATCH 10/10] s390x: Enable vector processing capability Cornelia Huck
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=1432139606-23705-4-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=farman@linux.vnet.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).