From nobody Mon Feb 9 19:07:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496282062981650.6885004408634; Wed, 31 May 2017 18:54:22 -0700 (PDT) Received: from localhost ([::1]:34809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGFJc-0008Em-CL for importer@patchew.org; Wed, 31 May 2017 21:54:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGFHr-0007Gl-JM for qemu-devel@nongnu.org; Wed, 31 May 2017 21:52:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGFHp-0005ts-NE for qemu-devel@nongnu.org; Wed, 31 May 2017 21:52:31 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:38131) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGFHo-0005ru-Qa; Wed, 31 May 2017 21:52:29 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3wdVhk4PG4z9sNJ; Thu, 1 Jun 2017 11:52:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1496281942; bh=dpLr5lo61p4IOSilTqNkDn1PkasZxtolFQH8BpyxVBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CGtmqsMOh0TIp+DyKbsQ+dgPsA1+H+GdsMvOfKtwtn1/V33ZQY8JkTEO8ROBPA+JQ tDXLNdzx/P6nNj6RK24LyRCJFdoLIInUbbvpp3YrVpZQeCOo9+0Jj95WJHqtEZV+7V ZCV8t8GDSQwWpunOPZ8/FRMR85PLoXjYQV87ej8U= From: David Gibson To: mdroth@linux.vnet.ibm.com Date: Thu, 1 Jun 2017 11:52:17 +1000 Message-Id: <20170601015218.9299-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170601015218.9299-1-david@gibson.dropbear.id.au> References: <20170601015218.9299-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PATCH 3/4] spapr: Abolish DRC set_configured method 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: lvivier@redhat.com, nikunj@linux.vnet.ibm.com, sursingh@redhat.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" DRConnectorClass has a set_configured method, however: * There is only one implementation, and only ever likely to be one * There's exactly one caller, and that's (now) local * The implementation is very straightforward So abolish the method entirely, and just open-code what we need. We also remove the tracepoints associated with it, since they don't look to be terribly useful. Signed-off-by: David Gibson Reviewed-by: Greg Kurz Reviewed-by: Laurent Vivier --- hw/ppc/spapr_drc.c | 20 ++++---------------- hw/ppc/trace-events | 2 -- include/hw/ppc/spapr_drc.h | 3 --- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index f5b7b68..025453b 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -199,18 +199,6 @@ static const char *get_name(sPAPRDRConnector *drc) return drc->name; } =20 -static void set_configured(sPAPRDRConnector *drc) -{ - trace_spapr_drc_set_configured(get_index(drc)); - - if (drc->isolation_state !=3D SPAPR_DR_ISOLATION_STATE_UNISOLATED) { - /* guest should be not configuring an isolated device */ - trace_spapr_drc_set_configured_skipping(get_index(drc)); - return; - } - drc->configured =3D true; -} - /* has the guest been notified of device attachment? */ static void set_signalled(sPAPRDRConnector *drc) { @@ -745,7 +733,6 @@ static void spapr_dr_connector_class_init(ObjectClass *= k, void *data) drck->get_index =3D get_index; drck->get_type =3D get_type; drck->get_name =3D get_name; - drck->set_configured =3D set_configured; drck->entity_sense =3D entity_sense; drck->attach =3D attach; drck->detach =3D detach; @@ -1113,7 +1100,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *= cpu, uint64_t wa_offset; uint32_t drc_index; sPAPRDRConnector *drc; - sPAPRDRConnectorClass *drck; sPAPRConfigureConnectorState *ccs; sPAPRDRCCResponse resp =3D SPAPR_DR_CC_RESPONSE_CONTINUE; int rc; @@ -1133,7 +1119,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *= cpu, goto out; } =20 - drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); if (!drc->fdt) { trace_spapr_rtas_ibm_configure_connector_missing_fdt(drc_index); rc =3D SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE; @@ -1170,10 +1155,13 @@ static void rtas_ibm_configure_connector(PowerPCCPU= *cpu, case FDT_END_NODE: ccs->fdt_depth--; if (ccs->fdt_depth =3D=3D 0) { + sPAPRDRIsolationState state =3D drc->isolation_state; /* done sending the device tree, don't need to track * the state anymore */ - drck->set_configured(drc); + if (state =3D=3D SPAPR_DR_ISOLATION_STATE_UNISOLATED) { + drc->configured =3D true; + } spapr_ccs_remove(spapr, ccs); ccs =3D NULL; resp =3D SPAPR_DR_CC_RESPONSE_SUCCESS; diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events index 43d265f..96ffc02 100644 --- a/hw/ppc/trace-events +++ b/hw/ppc/trace-events @@ -42,8 +42,6 @@ spapr_drc_set_isolation_state_deferring(uint32_t index) "= drc: 0x%"PRIx32 spapr_drc_set_indicator_state(uint32_t index, int state) "drc: 0x%"PRIx32"= , state: 0x%x" spapr_drc_set_allocation_state(uint32_t index, int state) "drc: 0x%"PRIx32= ", state: 0x%x" spapr_drc_set_allocation_state_finalizing(uint32_t index) "drc: 0x%"PRIx32 -spapr_drc_set_configured(uint32_t index) "drc: 0x%"PRIx32 -spapr_drc_set_configured_skipping(uint32_t index) "drc: 0x%"PRIx32", isola= ted device" spapr_drc_entity_sense(uint32_t index, int state) "drc: 0x%"PRIx32", state= : 0x%x" spapr_drc_attach(uint32_t index) "drc: 0x%"PRIx32 spapr_drc_detach(uint32_t index) "drc: 0x%"PRIx32 diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index 80db955..90f4953 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -177,9 +177,6 @@ typedef struct sPAPRDRConnectorClass { =20 uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *st= ate); =20 - /* QEMU interfaces for managing FDT/configure-connector */ - void (*set_configured)(sPAPRDRConnector *drc); - /* QEMU interfaces for managing hotplug operations */ void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt, int fdt_start_offset, bool coldplug, Error **errp); --=20 2.9.4