aboutsummaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
authorMatthew Rosato <mjrosato@linux.vnet.ibm.com>2014-08-28 11:25:35 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-09-01 09:25:32 +0200
commit1def6656b61c65757a02beb0318249e0b1c4e634 (patch)
treefe655de7c9034a453f2dfa0bacdeb3ee7e40fc29 /target-s390x
parente7f1314f97a8e9e035100e9aa4e9613f245fb00c (diff)
downloadqemu-1def6656b61c65757a02beb0318249e0b1c4e634.zip
qemu-1def6656b61c65757a02beb0318249e0b1c4e634.tar.gz
qemu-1def6656b61c65757a02beb0318249e0b1c4e634.tar.bz2
sclp-s390: Add memory hotplug SCLPs
Add memory information to read SCP info and add handlers for Read Storage Element Information, Attach Storage Element, Assign Storage and Unassign Storage. Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/cpu.h15
-rw-r--r--target-s390x/kvm.c5
2 files changed, 20 insertions, 0 deletions
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index f2715c6..772d513 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -1062,6 +1062,7 @@ static inline void cpu_inject_crw_mchk(S390CPU *cpu)
/* from s390-virtio-ccw */
#define MEM_SECTION_SIZE 0x10000000UL
+#define MAX_AVAIL_SLOTS 32
/* fpu_helper.c */
uint32_t set_cc_nz_f32(float32 v);
@@ -1085,6 +1086,7 @@ void kvm_s390_enable_css_support(S390CPU *cpu);
int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch,
int vq, bool assign);
int kvm_s390_cpu_restart(S390CPU *cpu);
+int kvm_s390_get_memslot_count(KVMState *s);
void kvm_s390_clear_cmma_callback(void *opaque);
#else
static inline void kvm_s390_io_interrupt(uint16_t subchannel_id,
@@ -1112,6 +1114,10 @@ static inline int kvm_s390_cpu_restart(S390CPU *cpu)
static inline void kvm_s390_clear_cmma_callback(void *opaque)
{
}
+static inline int kvm_s390_get_memslot_count(KVMState *s)
+{
+ return MAX_AVAIL_SLOTS;
+}
#endif
static inline void cmma_reset(S390CPU *cpu)
@@ -1130,6 +1136,15 @@ static inline int s390_cpu_restart(S390CPU *cpu)
return -ENOSYS;
}
+static inline int s390_get_memslot_count(KVMState *s)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_get_memslot_count(s);
+ } else {
+ return MAX_AVAIL_SLOTS;
+ }
+}
+
void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
uint32_t io_int_parm, uint32_t io_int_word);
void s390_crw_mchk(void);
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 421ff43..a85a480 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -1315,3 +1315,8 @@ int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch,
}
return kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &kick);
}
+
+int kvm_s390_get_memslot_count(KVMState *s)
+{
+ return kvm_check_extension(s, KVM_CAP_NR_MEMSLOTS);
+}