[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1424183053-4310-14-git-send-email-mimu@linux.vnet.ibm.com>
Date: Tue, 17 Feb 2015 15:24:11 +0100
From: Michael Mueller <mimu@...ux.vnet.ibm.com>
To: qemu-devel@...gnu.org, kvm@...r.kernel.org,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Gleb Natapov <gleb@...nel.org>, Alexander Graf <agraf@...e.de>,
Christian Borntraeger <borntraeger@...ibm.com>,
"Jason J. Herne" <jjherne@...ux.vnet.ibm.com>,
Cornelia Huck <cornelia.huck@...ibm.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Andreas Faerber <afaerber@...e.de>,
Richard Henderson <rth@...ddle.net>,
Michael Mueller <mimu@...ux.vnet.ibm.com>
Subject: [RFC PATCH v2 13/15] cpu-model/s390: Add processor property routines
This patch implements the functions:
- s390_get_proceccor_props()
- s390_set_proceccor_props()
They can be used to request or retrieve processor related information from an accelerator.
That information comprises the cpu identifier, the ICB value and the facility lists.
Signed-off-by: Michael Mueller <mimu@...ux.vnet.ibm.com>
---
target-s390x/cpu-models.c | 36 ++++++++++++++++++++++++++++++++++++
target-s390x/cpu-models.h | 2 ++
2 files changed, 38 insertions(+)
diff --git a/target-s390x/cpu-models.c b/target-s390x/cpu-models.c
index c63b4c2..9bc4d89 100644
--- a/target-s390x/cpu-models.c
+++ b/target-s390x/cpu-models.c
@@ -579,6 +579,42 @@ void s390_cpu_list_entry(gpointer data, gpointer user_data)
}
/**
+ * s390_get_processor_props - retrieves processor properties from
+ * from the currently used accelerator
+ * @prop: address to processor property structure to store the
+ * retrieved processor properties
+ *
+ * Returns: 0 in case of success
+ * -ENOSYS in case the current accelerator has no processor
+ * properties implemented
+ */
+int s390_get_processor_props(S390ProcessorProps *prop)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_get_processor_props(prop);
+ }
+ return -ENOSYS;
+}
+
+/**
+ * s390_set_processor_props - stores processor properties in the
+ * currently used accelerator
+ * @prop: address to processor property structure to store the
+ * retrieved processor properties
+ *
+ * Returns: 0 in case of success
+ * -ENOSYS in case the current accelerator has no processor
+ * properties implemented
+ */
+int s390_set_processor_props(S390ProcessorProps *prop)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_set_processor_props(prop);
+ }
+ return -ENOSYS;
+}
+
+/**
* s390_cpu_classes_initialized - indicates if the all cpu classes and
* their properties have been initialized
*
diff --git a/target-s390x/cpu-models.h b/target-s390x/cpu-models.h
index d41fc37..bc478d8 100644
--- a/target-s390x/cpu-models.h
+++ b/target-s390x/cpu-models.h
@@ -108,6 +108,8 @@ int s390_setup_cpu_classes(AccelId accel, S390MachineProps *prop);
gint s390_cpu_class_asc_order_compare(gconstpointer a, gconstpointer b);
gint s390_cpu_class_desc_order_compare(gconstpointer a, gconstpointer b);
void s390_cpu_list_entry(gpointer data, gpointer user_data);
+int s390_get_processor_props(S390ProcessorProps *prop);
+int s390_set_processor_props(S390ProcessorProps *prop);
bool s390_cpu_classes_initialized(void);
bool s390_test_facility(S390CPUClass *cc, unsigned long nr);
bool s390_probe_mode(void);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists