From nobody Tue Nov 4 18:51:38 2025 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.zohomail.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 1530597829701368.5446175761891; Mon, 2 Jul 2018 23:03:49 -0700 (PDT) Received: from localhost ([::1]:37955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faEPl-0006kv-1r for importer@patchew.org; Tue, 03 Jul 2018 02:03:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faEKP-0002ld-Tv for qemu-devel@nongnu.org; Tue, 03 Jul 2018 01:58:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faEKO-0006tL-FE for qemu-devel@nongnu.org; Tue, 03 Jul 2018 01:58:17 -0400 Received: from ozlabs.org ([203.11.71.1]:40695) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1faEKO-0006n2-3U; Tue, 03 Jul 2018 01:58:16 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 41KYM65wkYz9s4Z; Tue, 3 Jul 2018 15:58:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1530597490; bh=i6D/IYJQIEZ41jVnAbw/TRdTC+Q1gHkg0B9CsZK6EWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cJsNaaYCy1A4JY+oRyem0bIVYJKWsHvJK06bSfkqiEo4ot8HxkLa1vHAeLz0voxih vBVkB36b2YQSDBGvOcOHN/odyJSv9JaeFGFoT/IJKF5+7Tg+r+Kira3o+zVCdDKT9x Zcr+wEFjjEacJ3wu83snuOc+MSIpLFDQP3Dwo3zk= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 3 Jul 2018 15:57:38 +1000 Message-Id: <20180703055804.13449-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180703055804.13449-1-david@gibson.dropbear.id.au> References: <20180703055804.13449-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 09/35] ppc/xics: rework the ICS classes inheritance tree 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-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, aik@ozlabs.ru, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, 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-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater With the previous changes, we can now let the ICS_KVM class inherit directly from ICS_BASE class and not from the intermediate ICS_SIMPLE. It makes the class hierarchy much cleaner. What is left in the top classes is the low level interface to access the KVM XICS device in ICS_KVM and the XICS emulating handlers in ICS_SIMPLE. This should not break migration compatibility. Signed-off-by: C=C3=A9dric Le Goater Signed-off-by: David Gibson --- hw/intc/xics_kvm.c | 12 +++++------- hw/ppc/spapr.c | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index b314eb7d16..30c3769a20 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -359,12 +359,10 @@ static void ics_kvm_class_init(ObjectClass *klass, vo= id *data) ICSStateClass *icsc =3D ICS_BASE_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - /* - * Use device_class_set_parent_realize() when ics-kvm inherits - * directly from ics-base and not from ics-simple anymore. - */ - dc->realize =3D ics_kvm_realize; - dc->reset =3D ics_kvm_reset; + device_class_set_parent_realize(dc, ics_kvm_realize, + &icsc->parent_realize); + device_class_set_parent_reset(dc, ics_kvm_reset, + &icsc->parent_reset); =20 icsc->pre_save =3D ics_get_kvm_state; icsc->post_load =3D ics_set_kvm_state; @@ -373,7 +371,7 @@ static void ics_kvm_class_init(ObjectClass *klass, void= *data) =20 static const TypeInfo ics_kvm_info =3D { .name =3D TYPE_ICS_KVM, - .parent =3D TYPE_ICS_SIMPLE, + .parent =3D TYPE_ICS_BASE, .instance_size =3D sizeof(ICSState), .class_init =3D ics_kvm_class_init, }; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index b32b971a14..b2baec026f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -137,7 +137,7 @@ static ICSState *spapr_ics_create(sPAPRMachineState *sp= apr, goto error; } =20 - return ICS_SIMPLE(obj); + return ICS_BASE(obj); =20 error: error_propagate(errp, local_err); --=20 2.17.1