From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNj5u-000754-Sx for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:25:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNj5t-0001RO-Ks for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:25:46 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:37126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNj5t-0001R5-4d for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:25:45 -0500 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Feb 2015 14:25:43 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D4344219005C for ; Tue, 17 Feb 2015 14:24:47 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1HEOrHA10224066 for ; Tue, 17 Feb 2015 14:24:53 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1HEOqYd005073 for ; Tue, 17 Feb 2015 07:24:53 -0700 From: Michael Mueller Date: Tue, 17 Feb 2015 15:24:11 +0100 Message-Id: <1424183053-4310-14-git-send-email-mimu@linux.vnet.ibm.com> In-Reply-To: <1424183053-4310-1-git-send-email-mimu@linux.vnet.ibm.com> References: <1424183053-4310-1-git-send-email-mimu@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v2 13/15] cpu-model/s390: Add processor property routines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Mueller , Gleb Natapov , Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Andreas Faerber , Richard Henderson 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 --- 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