From patchwork Tue Feb 17 14:24:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Mueller X-Patchwork-Id: 440627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5E4E71401AB for ; Wed, 18 Feb 2015 01:36:24 +1100 (AEDT) Received: from localhost ([::1]:45763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNjGA-0003mb-KW for incoming@patchwork.ozlabs.org; Tue, 17 Feb 2015 09:36:22 -0500 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 d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Feb 2015 14:25:01 -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 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t1HEOlRY004626; Tue, 17 Feb 2015 07:24:52 -0700 From: Michael Mueller To: qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 17 Feb 2015 15:24:11 +0100 Message-Id: <1424183053-4310-14-git-send-email-mimu@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 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> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021714-0029-0000-0000-00000366C4AC X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.113 Cc: Michael Mueller , Gleb Natapov , Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Andreas Faerber , Richard Henderson Subject: [Qemu-devel] [RFC PATCH v2 13/15] cpu-model/s390: Add processor property routines X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);