summaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-09-05 10:52:31 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-09-06 17:06:50 +0200
commit3fad3252a362515a44003434cab3766b6b57c985 (patch)
tree061bd25512b2ebe71ca26c347a6b2be4f341fe31 /target-s390x
parent059be520d519565636f73496c20b2b8d331fa865 (diff)
downloadqemu-3fad3252a362515a44003434cab3766b6b57c985.zip
s390x/sclp: propagate the mha via sclp
The mha is provided in the CPU model, so get any CPU and extract the value. Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Message-Id: <20160905085244.99980-18-dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/cpu_models.c14
-rw-r--r--target-s390x/cpu_models.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c
index 342f3e03f0..4d2e48b465 100644
--- a/target-s390x/cpu_models.c
+++ b/target-s390x/cpu_models.c
@@ -74,6 +74,20 @@ static S390CPUDef s390_cpu_defs[] = {
CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
};
+uint8_t s390_get_mha_pow(void)
+{
+ static S390CPU *cpu;
+
+ if (!cpu) {
+ cpu = S390_CPU(qemu_get_cpu(0));
+ }
+
+ if (!cpu || !cpu->model) {
+ return 0;
+ }
+ return cpu->model->def->mha_pow;
+}
+
uint32_t s390_get_ibc_val(void)
{
uint16_t unblocked_ibc, lowest_ibc;
diff --git a/target-s390x/cpu_models.h b/target-s390x/cpu_models.h
index 5e870ec05d..d378919d57 100644
--- a/target-s390x/cpu_models.h
+++ b/target-s390x/cpu_models.h
@@ -51,6 +51,7 @@ typedef struct S390CPUModel {
#define S390_GEN_Z10 0xa
+uint8_t s390_get_mha_pow(void);
uint32_t s390_get_ibc_val(void);
static inline uint16_t s390_ibc_from_cpu_model(const S390CPUModel *model)
{