aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/cpu.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-02-24 14:15:27 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-03-10 09:26:22 +0100
commit18ff949474cfbba892fdc34aa6ed7558afc78c5c (patch)
treeb485f7149893ac3cbcffdada29dde043508b783d /target-s390x/cpu.h
parent56dba22b7dc1c41ff7dca6593080a99bcca74b5c (diff)
s390x/kvm: implement handling of new SIGP orders
This patch adds handling code for the following SIGP orders: - SIGP SET ARCHITECTURE - SIGP SET PREFIX - SIGP STOP - SIGP STOP AND STORE STATUS - SIGP STORE STATUS AT ADDRESS SIGP STOP (AND STORE STATUS) are the only orders that can stay pending forever (and may only be interrupted by resets), so special care has to be taken about them. Their status also has to be tracked within QEMU. This patch takes care of migrating this status (e.g. if migration happens during a SIGP STOP). Due to the BQL, only one VCPU is currently able to execute SIGP handlers at a time. According to the PoP, BUSY should be returned if another SIGP order is currently being executed on a VCPU. This can only be implemented when the BQL does not protect all handlers. For now, all SIGP orders on all VCPUs will be serialized, which will be okay for the first shot. Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Message-Id: <1424783731-43426-7-git-send-email-jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x/cpu.h')
-rw-r--r--target-s390x/cpu.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 1cdfe5edaf..da0af9453f 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -157,6 +157,9 @@ typedef struct CPUS390XState {
#define CPU_STATE_LOAD 0x04
uint8_t cpu_state;
+ /* currently processed sigp order */
+ uint8_t sigp_order;
+
} CPUS390XState;
#include "cpu-qom.h"
@@ -411,6 +414,10 @@ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr);
unsigned int s390_cpu_halt(S390CPU *cpu);
void s390_cpu_unhalt(S390CPU *cpu);
unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu);
+static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
+{
+ return cpu->env.cpu_state;
+}
/* service interrupts are floating therefore we must not pass an cpustate */
void s390_sclp_extint(uint32_t parm);
@@ -896,6 +903,11 @@ struct sysib_322 {
#define SIGP_STAT_INVALID_ORDER 0x00000002UL
#define SIGP_STAT_RECEIVER_CHECK 0x00000001UL
+/* SIGP SET ARCHITECTURE modes */
+#define SIGP_MODE_ESA_S390 0
+#define SIGP_MODE_Z_ARCH_TRANS_ALL_PSW 1
+#define SIGP_MODE_Z_ARCH_TRANS_CUR_PSW 2
+
void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr);
int mmu_translate(CPUS390XState *env, target_ulong vaddr, int rw, uint64_t asc,
target_ulong *raddr, int *flags, bool exc);