From nobody Sun Apr 6 03:18:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1736530388; cv=none; d=zohomail.com; s=zohoarc; b=H63EoyhpWO5X7ieFdEDq8mJS3j1ao2cdCjLhLeoRBo7QQwz80aSoN2nj3Bmdv0JvrYNCI4XEeDpqd9bF4RgXfi182I0yPlvBvDkRI0w9T8xNEepO5GT3u20tCIGYA94bY8SKHRkpq8qUYZOT6Zgco4LH36q94e3nPE5Zuu5vuyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736530388; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pG3zaZWN3xKo4fMPNgWXUV42ACJFQFragGulQEy5rlA=; b=fJYLeKUpIT8fCZZqK2PULYPspNq39w+J92sQ2iEJtldfi7xB6VBLKJLL6i2b9nFSu71pgDWsxSEtnDY8YzZTngBL0OWx5iZaHHUius1nKJA5TxdLLPUrLNFXLTUJtq05zjzEvRIPK3AcxztArlif+D/70qnIpixF6PQWVbfqMO8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1736530388679311.7091828878856; Fri, 10 Jan 2025 09:33:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWIsG-0005WP-0b; Fri, 10 Jan 2025 12:32:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWIs2-0005Tc-FQ for qemu-devel@nongnu.org; Fri, 10 Jan 2025 12:32:31 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWIrx-00009I-UV for qemu-devel@nongnu.org; Fri, 10 Jan 2025 12:32:28 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361f664af5so26912405e9.1 for ; Fri, 10 Jan 2025 09:32:25 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9dd1957sm58173665e9.16.2025.01.10.09.32.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 09:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736530344; x=1737135144; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pG3zaZWN3xKo4fMPNgWXUV42ACJFQFragGulQEy5rlA=; b=rILu3Q2J0k6CtlNaKLAvB3faC6aatfR0BEKoGkmdlULzmClOJCiBEi3htZDXaf7lwm n8oaGJiZGIjPYdqCv9Q9JxIbXH1rT7jzjbHEA3hUVy9RI/c93+5E4HqBqBjjozlhHGsX bUP7ABqApoUVn+RAWrfj3ePcS6zZC2Cl8D+TL7dhl+ECaGsshEWPwgwchQZn11UiOb0a sf0n6y8efOy4JzLlreOig2oB0gH1c/vb0KBO+WEijCP4Fmia4IXb+4tNwD3UhUkrFCHg U+G8tIom1Yidi009GwDshVWbWmhInCYtUWcfXIHiVBQNiNEHs+91eb1r3F//sIrMobaD f/pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736530344; x=1737135144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pG3zaZWN3xKo4fMPNgWXUV42ACJFQFragGulQEy5rlA=; b=cRVYxtp/YZs6tGbHgK2Zs01ysVdyHmm41ffVijXU4DugfxE1jZpyV/05Ug9vZv7A9s kxT+zyuzSTDTcyAAU4VBf7oyT5ISTE+pgm3fvIpfr8Dsq5fQFcBxm3jlFJpPCTgODoMX 96ox3jNg/V5Eh6eLWZEG07xI/G2kC3/8FejNAGyqFrO4+zuqu0ZDlCKRg/HGRcK9DDgb iu+ibcZMc52RjLOYV+2e5PbbSl7uqliat+M0Lrn0HS3jCOjytj2X/TR4w2EtbhCXMNM1 Nob3dFzrFsp+0mYxyg/9YNEoOCX7RYPToC3lQzL/la7C7w5kK4tCTaKjUCwlE70IeKX4 k2hw== X-Gm-Message-State: AOJu0Yyac7uCuvniIzsN60TwofHSHG6RNeYbmkIu+VEwjrbjlcIf/Zfb cfZ5Z1aqvOZX22nZANLveLch4YaHe4g6v20fakkRj2nUKKh/UvvbH1OkkKe+HhM15bnxRsvxyx6 1+cc= X-Gm-Gg: ASbGncve/sMmNOn0z5srgLmurHEstULEXCsi7k21XAxJ4w5j5e5aU5b09rCbwsyeh4V xx3cZX1WT9Or9XT5+l9hvYL2qpOCKKL0jAMdJopY1OkmyMHM95YBxaK0n2yvaZYuMiG1ZBzJBio MmRh2V1dbAk18R6/5Yyzo6+Q1QjmlVI1hjA834zZek/7oUNYrjpP+Ve0f/B6GATx+IRj3QLeFCt sEUOfu/oiNJRTyXH+c5kN+DSrSUjqp81Vg0QOi3ABhUHQtCGwyXqimAO8RfohLJr+e5Q5S3rZb6 1x9eAct8RkofRjGRmARXEQTbg8HWOgU= X-Google-Smtp-Source: AGHT+IFw4UKTHnetcGf7xY5mKTrBfh3NU1eovELNRWynxfrYx/X4H35J0SQB6evrqulW+njap3/F+g== X-Received: by 2002:a05:600c:511f:b0:436:1b96:7072 with SMTP id 5b1f17b1804b1-436e26867f6mr117937825e9.5.1736530344082; Fri, 10 Jan 2025 09:32:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gustavo Romero , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/2] hw/ppc/prep_systemio: Use link property to remove &first_cpu Date: Fri, 10 Jan 2025 18:32:16 +0100 Message-ID: <20250110173217.80942-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110173217.80942-1-philmd@linaro.org> References: <20250110173217.80942-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1736530390264019000 In order to avoid using the &first_cpu global, pass the CPU as link property from the 40p MachineClass::init(). Declare the link type as TYPE_POWERPC_CPU to have the CPU type checked automatically. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/prep.c | 2 ++ hw/ppc/prep_systemio.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 3e68d8e6e20..88a9b0fa7bb 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -324,6 +324,8 @@ static void ibm_40p_init(MachineState *machine) dev =3D DEVICE(isa_dev); qdev_prop_set_uint32(dev, "ibm-planar-id", 0xfc); qdev_prop_set_uint32(dev, "equipment", 0xc0); + object_property_set_link(OBJECT(dev), "cpu", + OBJECT(cpu), &error_fatal); isa_realize_and_unref(isa_dev, isa_bus, &error_fatal); =20 dev =3D DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(1, 0), diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index b1f2e130f03..7cbf7e4eecd 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -44,7 +44,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(PrepSystemIoState, PREP_SYSTEM= IO) =20 struct PrepSystemIoState { ISADevice parent_obj; + MemoryRegion ppc_parity_mem; + CPUState *cpu; =20 qemu_irq non_contiguous_io_map_irq; uint8_t sreset; /* 0x0092 */ @@ -255,14 +257,12 @@ static void prep_systemio_realize(DeviceState *dev, E= rror **errp) { ISADevice *isa =3D ISA_DEVICE(dev); PrepSystemIoState *s =3D PREP_SYSTEMIO(dev); - PowerPCCPU *cpu; =20 qdev_init_gpio_out(dev, &s->non_contiguous_io_map_irq, 1); s->iomap_type =3D PORT0850_IOMAP_NONCONTIGUOUS; qemu_set_irq(s->non_contiguous_io_map_irq, s->iomap_type & PORT0850_IOMAP_NONCONTIGUOUS); - cpu =3D POWERPC_CPU(first_cpu); - s->softreset_irq =3D qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_HRESET= ); + s->softreset_irq =3D qdev_get_gpio_in(DEVICE(s->cpu), PPC6xx_INPUT_HRE= SET); =20 isa_register_portio_list(isa, &s->portio, 0x0, ppc_io800_port_list, s, "systemio800"); @@ -288,6 +288,8 @@ static const VMStateDescription vmstate_prep_systemio = =3D { static const Property prep_systemio_properties[] =3D { DEFINE_PROP_UINT8("ibm-planar-id", PrepSystemIoState, ibm_planar_id, 0= ), DEFINE_PROP_UINT8("equipment", PrepSystemIoState, equipment, 0), + DEFINE_PROP_LINK("cpu", PrepSystemIoState, cpu, + TYPE_POWERPC_CPU, CPUState *), }; =20 static void prep_systemio_class_initfn(ObjectClass *klass, void *data) --=20 2.47.1 From nobody Sun Apr 6 03:18:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1736530388; cv=none; d=zohomail.com; s=zohoarc; b=afITwjHrwZ4k6ppbO2hkLEzU1oMbsuKS+SyqGQ3NYb12RoSCfd2S+Sy7TK7P9SdlLYYS9cA96Gop2TZTfv2pHG8gRblWpJVrFrSvEixnUWxnxGEO2jVgNHTPK9560r+im+OCdfUY5rj4b+xxQCKL3bTKN5xcmz0Pme55Are74Is= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736530388; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nNUbs9+iXWkzUulkoWT20NOwr2Ic+DqflysU5aQWhXA=; b=F8oqkOpbQXLjnn5umv9Sw1kus9ukCdJbX/3DeAktmmau8opiH0ihODdDrdUnzZRRBVXwKdyWyvEV3q6/QyINF2cSfssQvnzMXsJUV2B92FJ6iZ0V00fwfck/3i5Q/CsNaANhVRAZXE4//MPZ15RT5RMxDFcPjdnM31wSpYcvuF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1736530388528538.9426827613856; Fri, 10 Jan 2025 09:33:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWIsJ-0005XP-M9; Fri, 10 Jan 2025 12:32:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWIsC-0005Uh-6I for qemu-devel@nongnu.org; Fri, 10 Jan 2025 12:32:40 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWIs9-00009h-Hc for qemu-devel@nongnu.org; Fri, 10 Jan 2025 12:32:39 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-386329da1d9so1253880f8f.1 for ; Fri, 10 Jan 2025 09:32:30 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e383654sm5134100f8f.30.2025.01.10.09.32.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 09:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736530349; x=1737135149; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nNUbs9+iXWkzUulkoWT20NOwr2Ic+DqflysU5aQWhXA=; b=tf+HYap5+HB+/KwX4SpcqsiV4RcJuKbfz3pZ6nu0W4GG7VzkwZkRggcUj3l6SOb00x KwidAFpXlqITHqK9nZ/MDKfiRIQNoQCREUzfxAECGINdkURAcFIv1cIIw9en+gyprnxL kOJkrThWUJLzbTVxvaUaOXp3IfTifnb/EYilRPuOl5C50qfqTZ1plyhU/EIkVTeklNE2 ivR4beRuLx88AzD1Ni4YMMlmm8QM0mm8H4SqVAOm8O457g2yb5coUYoSgwBUENANbfGO oc95WPYKmHS1V7ltolulZzgJRwSaBmwHpRvWRaDkrMgNbWHLobv9n6OcMTGg+x6Nh+jx MpUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736530349; x=1737135149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nNUbs9+iXWkzUulkoWT20NOwr2Ic+DqflysU5aQWhXA=; b=kWB2Iq+1BZPdpiu+9kg3XlSDnUFkGijE8KR3Ldmhs9K8cRanzYWTjFaRWjSRb5zXF6 MwCZKGKMSPNj/hw55yF1shCOak3qoW1++CS8Ov9jY7WilYCHJtWSVRmou3x9ljP5Tvr0 JahswS6l5TDrcep4HIlaJOlmuougQZp+8VyovR6VZFuZCthj84z2OE7/TPKdVK07GTxQ arGv40zxmOnYaLji0GO4b73BFeaXXogO7uurRt4GLmdr6sc3g0pc2eys/7iue77H4xfZ Eb7dmTRD3XHv8rtPULbxCSmySFFjD1X53RiCKYG7uXI/JsSuycCbP90jvasYRS2tRNYh x8qg== X-Gm-Message-State: AOJu0YypKw2ZXE/nvY6HumOg9LwvH74+WOceNXR9MNzT89DrqtHtky1v Y3kqVqI0ieV6BNFcCgcleyqeKa5AnfejnYeDqgzWexeYT2oGWNYa+n2IaL4L0kNU3BumB+kP73V X6t4= X-Gm-Gg: ASbGncsAsHnJ0sEk1M+oJE8l1QS/Wx0ZYtNY4ZVPSjn5wEG+I9Ad8XRs+7hP5j9bKwl E0UZHGKn3mXVY2GQExGJB8PU00Fb5iS/szzHWg9V4xuOHpp4V2M02fWM4oMaQRz4YbZQNSrT4tX PbYfOAMrqACdf/MKKSHokhqyqAjL7TtIum/HoToQaKOZhlw2oOiugqQvqr3+yP6dBrOVDIbhMDm YT4ekAZV1BxgQm2nLfxcKS9i/teHjaLsiCfqsAm66ddG4QRx4XvnShJ9U5O1FPFuhpvDVB3qs0F DYvZ+rsGcFwunNCLBiA+rSfX3yszQ1U= X-Google-Smtp-Source: AGHT+IFBRXvmojeptjmFxNDaZBsmcfZm9vpZbKLnZyyLe+xdmiUQVmnsCSYyaV7mq2cY3LTGdXyAIA== X-Received: by 2002:a5d:6c63:0:b0:385:e22e:288f with SMTP id ffacd0b85a97d-38a872ea33fmr11189484f8f.31.1736530348711; Fri, 10 Jan 2025 09:32:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gustavo Romero , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] hw/ppc/prep_systemio: Set IOMap IRQ in ResetExit() handler Date: Fri, 10 Jan 2025 18:32:17 +0100 Message-ID: <20250110173217.80942-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110173217.80942-1-philmd@linaro.org> References: <20250110173217.80942-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1736530389676116600 Since the IOMap output IRQ is created in prep_systemio_realize(), it can not yet be wired before the device is realized, thus it is not reset properly. Fix by moving the qemu_set_irq() call in the ResetExit handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/prep_systemio.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index 7cbf7e4eecd..87f412891e2 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -260,8 +260,6 @@ static void prep_systemio_realize(DeviceState *dev, Err= or **errp) =20 qdev_init_gpio_out(dev, &s->non_contiguous_io_map_irq, 1); s->iomap_type =3D PORT0850_IOMAP_NONCONTIGUOUS; - qemu_set_irq(s->non_contiguous_io_map_irq, - s->iomap_type & PORT0850_IOMAP_NONCONTIGUOUS); s->softreset_irq =3D qdev_get_gpio_in(DEVICE(s->cpu), PPC6xx_INPUT_HRE= SET); =20 isa_register_portio_list(isa, &s->portio, 0x0, ppc_io800_port_list, s, @@ -273,6 +271,14 @@ static void prep_systemio_realize(DeviceState *dev, Er= ror **errp) &s->ppc_parity_mem); } =20 +static void prep_systemio_reset_exit(Object *obj, ResetType type) +{ + PrepSystemIoState *s =3D PREP_SYSTEMIO(obj); + + qemu_set_irq(s->non_contiguous_io_map_irq, + s->iomap_type & PORT0850_IOMAP_NONCONTIGUOUS); +} + static const VMStateDescription vmstate_prep_systemio =3D { .name =3D "prep_systemio", .version_id =3D 1, @@ -295,10 +301,12 @@ static const Property prep_systemio_properties[] =3D { static void prep_systemio_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->realize =3D prep_systemio_realize; dc->vmsd =3D &vmstate_prep_systemio; device_class_set_props(dc, prep_systemio_properties); + rc->phases.exit =3D prep_systemio_reset_exit; } =20 static const TypeInfo prep_systemio800_info =3D { --=20 2.47.1