From patchwork Mon Feb 27 14:29:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 732898 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 3vX51h1LHgz9s9r for ; Tue, 28 Feb 2017 02:18:00 +1100 (AEDT) Received: from localhost ([::1]:53542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciN3l-0000HD-Hg for incoming@patchwork.ozlabs.org; Mon, 27 Feb 2017 10:17:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciMM2-00033H-D5 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 09:32:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciMLy-0008Kr-DM for qemu-devel@nongnu.org; Mon, 27 Feb 2017 09:32:46 -0500 Received: from 20.mo6.mail-out.ovh.net ([178.32.124.17]:49959) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciMLy-0008KK-3C for qemu-devel@nongnu.org; Mon, 27 Feb 2017 09:32:42 -0500 Received: from player761.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id E9B13B34FD for ; Mon, 27 Feb 2017 15:32:40 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-10647-27.w90-89.abo.wanadoo.fr [90.89.233.27]) (Authenticated sender: clg@kaod.org) by player761.ha.ovh.net (Postfix) with ESMTPSA id 08F134800A6; Mon, 27 Feb 2017 15:31:34 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Mon, 27 Feb 2017 15:29:32 +0100 Message-Id: <1488205773-30436-26-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488205773-30436-1-git-send-email-clg@kaod.org> References: <1488205773-30436-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 4056054417291774950 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelhedrvdeigdeihecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.32.124.17 Subject: [Qemu-devel] [PATCH v4 25/26] ppc/xics: move InterruptStatsProvider to the sPAPR machine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It provides a better monitor output of the ICP and ICS objects, else the objects are printed out of order. Signed-off-by: Cédric Le Goater --- hw/intc/xics.c | 20 ++------------------ hw/ppc/spapr.c | 17 +++++++++++++++++ include/hw/ppc/xics.h | 2 ++ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index ce6e8d75b891..5bcb9550abb5 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -93,10 +93,8 @@ void xics_cpu_setup(XICSFabric *xi, PowerPCCPU *cpu) } } -static void icp_pic_print_info(InterruptStatsProvider *obj, - Monitor *mon) +void icp_pic_print_info(ICPState *icp, Monitor *mon) { - ICPState *icp = ICP(obj); int cpu_index = icp->cs ? icp->cs->cpu_index : -1; if (!icp->output) { @@ -107,10 +105,8 @@ static void icp_pic_print_info(InterruptStatsProvider *obj, icp->pending_priority, icp->mfrr); } -static void ics_simple_pic_print_info(InterruptStatsProvider *obj, - Monitor *mon) +void ics_pic_print_info(ICSState *ics, Monitor *mon) { - ICSState *ics = ICS_SIMPLE(obj); uint32_t i; monitor_printf(mon, "ICS %4x..%4x %p\n", @@ -369,12 +365,10 @@ static void icp_realize(DeviceState *dev, Error **errp) static void icp_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - InterruptStatsProviderClass *ic = INTERRUPT_STATS_PROVIDER_CLASS(klass); dc->reset = icp_reset; dc->vmsd = &vmstate_icp_server; dc->realize = icp_realize; - ic->print_info = icp_pic_print_info; } static const TypeInfo icp_info = { @@ -383,10 +377,6 @@ static const TypeInfo icp_info = { .instance_size = sizeof(ICPState), .class_init = icp_class_init, .class_size = sizeof(ICPStateClass), - .interfaces = (InterfaceInfo[]) { - { TYPE_INTERRUPT_STATS_PROVIDER }, - { } - }, }; /* @@ -632,7 +622,6 @@ static void ics_simple_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); ICSStateClass *isc = ICS_BASE_CLASS(klass); - InterruptStatsProviderClass *ic = INTERRUPT_STATS_PROVIDER_CLASS(klass); isc->realize = ics_simple_realize; dc->props = ics_simple_properties; @@ -641,7 +630,6 @@ static void ics_simple_class_init(ObjectClass *klass, void *data) isc->reject = ics_simple_reject; isc->resend = ics_simple_resend; isc->eoi = ics_simple_eoi; - ic->print_info = ics_simple_pic_print_info; } static const TypeInfo ics_simple_info = { @@ -651,10 +639,6 @@ static const TypeInfo ics_simple_info = { .class_init = ics_simple_class_init, .class_size = sizeof(ICSStateClass), .instance_init = ics_simple_initfn, - .interfaces = (InterfaceInfo[]) { - { TYPE_INTERRUPT_STATS_PROVIDER }, - { } - }, }; static void ics_base_realize(DeviceState *dev, Error **errp) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e097ff8de1a4..69a6bed09fef 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -63,6 +63,7 @@ #include "qemu/error-report.h" #include "trace.h" #include "hw/nmi.h" +#include "hw/intc/intc.h" #include "hw/compat.h" #include "qemu/cutils.h" @@ -2932,6 +2933,19 @@ static ICPState *spapr_icp_get(XICSFabric *xi, int server) return (server < spapr->nr_servers) ? &spapr->icps[server] : NULL; } +static void spapr_pic_print_info(InterruptStatsProvider *obj, + Monitor *mon) +{ + sPAPRMachineState *spapr = SPAPR_MACHINE(obj); + int i; + + for (i = 0; i < spapr->nr_servers; i++) { + icp_pic_print_info(&spapr->icps[i], mon); + } + + ics_pic_print_info(spapr->ics, mon); +} + static void spapr_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -2941,6 +2955,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); PPCVirtualHypervisorClass *vhc = PPC_VIRTUAL_HYPERVISOR_CLASS(oc); XICSFabricClass *xic = XICS_FABRIC_CLASS(oc); + InterruptStatsProviderClass *ispc = INTERRUPT_STATS_PROVIDER_CLASS(oc); mc->desc = "pSeries Logical Partition (PAPR compliant)"; @@ -2977,6 +2992,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) xic->ics_get = spapr_ics_get; xic->ics_resend = spapr_ics_resend; xic->icp_get = spapr_icp_get; + ispc->print_info = spapr_pic_print_info; } static const TypeInfo spapr_machine_info = { @@ -2994,6 +3010,7 @@ static const TypeInfo spapr_machine_info = { { TYPE_HOTPLUG_HANDLER }, { TYPE_PPC_VIRTUAL_HYPERVISOR }, { TYPE_XICS_FABRIC }, + { TYPE_INTERRUPT_STATS_PROVIDER }, { } }, }; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 007ee2f16d16..1945913bf1c9 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -184,6 +184,8 @@ void ics_simple_write_xive(ICSState *ics, int nr, int server, uint8_t priority, uint8_t saved_priority); void ics_set_irq_type(ICSState *ics, int srcno, bool lsi); +void icp_pic_print_info(ICPState *icp, Monitor *mon); +void ics_pic_print_info(ICSState *ics, Monitor *mon); void ics_resend(ICSState *ics); void icp_resend(ICPState *ss);