From nobody Wed Nov 5 20:03:29 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 1537859502399989.8858150781715; Tue, 25 Sep 2018 00:11:42 -0700 (PDT) Received: from localhost ([::1]:51307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hVV-0006wv-Ay for importer@patchew.org; Tue, 25 Sep 2018 03:11:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMH-0006ty-F8 for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMC-0006N7-Ki for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:09 -0400 Received: from ozlabs.org ([203.11.71.1]:33265) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMC-000664-4c; Tue, 25 Sep 2018 03:02:04 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBnz514vz9sBW; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858919; bh=W8oQYccgBzTNLowgDO7nH7K8KkqeaxwPx0es4WnkHtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ui6mlUWMVrKlaYcKdQPSu0JrKRFA/HTXVu73jXy5xhpG7PZBJf6v8Z29Y5KeP2vxc Qcpd3pewY5xSmHMYe2CFnyVIBs2RK43yhJrwwtSNtSvH4MMBFKrb2UyZcnmVtrssem RC4X0gGFdOlVTnVCAOOdi8hQm3dYfBKZlu5u8rg8= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:41 +1000 Message-Id: <20180925070154.5812-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 01/14] Record history of ppcemb target in common.json 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: Thomas Huth , mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth We recently removed the long deprecated "ppcemb" target. This adds a comment in common.json about the SysEmuTarget type, recording when it was removed. Suggested-by: Eric Blake Signed-off-by: David Gibson --- qapi/common.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qapi/common.json b/qapi/common.json index 50ac121d25..021174f04e 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -140,6 +140,8 @@ # prefix to produce the corresponding QEMU executable name. This # is true even for "qemu-system-x86_64". # +# ppcemb: dropped in 3.1 +# # Since: 3.0 ## { 'enum' : 'SysEmuTarget', --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859251422500.03006549120107; Tue, 25 Sep 2018 00:07:31 -0700 (PDT) Received: from localhost ([::1]:51271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hRS-0002oS-4W for importer@patchew.org; Tue, 25 Sep 2018 03:07:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMJ-0006u1-D3 for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hME-0006O0-8v for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:11 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:43237) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMD-00063t-I1; Tue, 25 Sep 2018 03:02:06 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBnz3Cw3z9sB5; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858919; bh=W0GSyQmGOIUm6EjIU4jlL+Q7mzGS/BQclchNXu5roNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QnBd8EnWPGb26W7t1HEKFTm/LOfBQnWV0selkPERNxZXmAMDP3xXiNYvFW5m/08cu kDH1+CTKCMIG57jm1hUSXmDk3srDHgtkkojoHsQHcNhWI1CbDkfpMBb0FU/7K8xPpj 3/x8zRdBxxc45d+D0vQ6u6tY4bo3wFD57WbLx1Gs= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:42 +1000 Message-Id: <20180925070154.5812-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] [PULL 02/14] target/ppc/cpu-models: Re-group the 970 CPUs together again 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: Thomas Huth , mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The addition of the POWER9 CPUs divided the entries for the 970 CPUs, which is a little bit confusing when you look at the code. So let's re-group the 970 CPUs together again, and since these chips have been based on the POWER4 processor, move them also in front of the POWER5 chips now. Signed-off-by: Thomas Huth Signed-off-by: David Gibson --- target/ppc/cpu-models.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c index 6c9bfde2d2..7c75963e3c 100644 --- a/target/ppc/cpu-models.c +++ b/target/ppc/cpu-models.c @@ -741,26 +741,8 @@ "PowerPC 7457A v1.2 (G4)") /* 64 bits PowerPC = */ #if defined (TARGET_PPC64) - POWERPC_DEF("power5+_v2.1", CPU_POWERPC_POWER5P_v21, POWER= 5P, - "POWER5+ v2.1") - POWERPC_DEF("power7_v2.3", CPU_POWERPC_POWER7_v23, POWER= 7, - "POWER7 v2.3") - POWERPC_DEF("power7+_v2.1", CPU_POWERPC_POWER7P_v21, POWER= 7, - "POWER7+ v2.1") - POWERPC_DEF("power8e_v2.1", CPU_POWERPC_POWER8E_v21, POWER= 8, - "POWER8E v2.1") - POWERPC_DEF("power8_v2.0", CPU_POWERPC_POWER8_v20, POWER= 8, - "POWER8 v2.0") - POWERPC_DEF("power8nvl_v1.0", CPU_POWERPC_POWER8NVL_v10, POWER= 8, - "POWER8NVL v1.0") POWERPC_DEF("970_v2.2", CPU_POWERPC_970_v22, 970, "PowerPC 970 v2.2") - - POWERPC_DEF("power9_v1.0", CPU_POWERPC_POWER9_DD1, POWER= 9, - "POWER9 v1.0") - POWERPC_DEF("power9_v2.0", CPU_POWERPC_POWER9_DD20, POWER= 9, - "POWER9 v2.0") - POWERPC_DEF("970fx_v1.0", CPU_POWERPC_970FX_v10, 970, "PowerPC 970FX v1.0 (G5)") POWERPC_DEF("970fx_v2.0", CPU_POWERPC_970FX_v20, 970, @@ -775,6 +757,22 @@ "PowerPC 970MP v1.0") POWERPC_DEF("970mp_v1.1", CPU_POWERPC_970MP_v11, 970, "PowerPC 970MP v1.1") + POWERPC_DEF("power5+_v2.1", CPU_POWERPC_POWER5P_v21, POWER= 5P, + "POWER5+ v2.1") + POWERPC_DEF("power7_v2.3", CPU_POWERPC_POWER7_v23, POWER= 7, + "POWER7 v2.3") + POWERPC_DEF("power7+_v2.1", CPU_POWERPC_POWER7P_v21, POWER= 7, + "POWER7+ v2.1") + POWERPC_DEF("power8e_v2.1", CPU_POWERPC_POWER8E_v21, POWER= 8, + "POWER8E v2.1") + POWERPC_DEF("power8_v2.0", CPU_POWERPC_POWER8_v20, POWER= 8, + "POWER8 v2.0") + POWERPC_DEF("power8nvl_v1.0", CPU_POWERPC_POWER8NVL_v10, POWER= 8, + "POWER8NVL v1.0") + POWERPC_DEF("power9_v1.0", CPU_POWERPC_POWER9_DD1, POWER= 9, + "POWER9 v1.0") + POWERPC_DEF("power9_v2.0", CPU_POWERPC_POWER9_DD20, POWER= 9, + "POWER9 v2.0") #endif /* defined (TARGET_PPC64) */ =20 /*************************************************************************= **/ @@ -940,6 +938,9 @@ PowerPCCPUAlias ppc_cpu_aliases[] =3D { { "7457a", "7457a_v1.2" }, { "apollo7pm", "7457a_v1.0" }, #if defined(TARGET_PPC64) + { "970", "970_v2.2" }, + { "970fx", "970fx_v3.1" }, + { "970mp", "970mp_v1.1" }, { "power5+", "power5+_v2.1" }, { "power5gs", "power5+_v2.1" }, { "power7", "power7_v2.3" }, @@ -948,9 +949,6 @@ PowerPCCPUAlias ppc_cpu_aliases[] =3D { { "power8", "power8_v2.0" }, { "power8nvl", "power8nvl_v1.0" }, { "power9", "power9_v2.0" }, - { "970", "970_v2.2" }, - { "970fx", "970fx_v3.1" }, - { "970mp", "970mp_v1.1" }, #endif =20 /* Generic PowerPCs */ --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537859081933111.14044215659567; Tue, 25 Sep 2018 00:04:41 -0700 (PDT) Received: from localhost ([::1]:51254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hOb-0008On-8F for importer@patchew.org; Tue, 25 Sep 2018 03:04:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMJ-0006u2-Dg for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMD-0006NW-Hn for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:11 -0400 Received: from ozlabs.org ([203.11.71.1]:41151) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMD-000683-5B; Tue, 25 Sep 2018 03:02:05 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBnz6YnXz9sBn; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858919; bh=aK/HZJJH5586PZ/LAeMrxyy6hc38ce+Nx6cBHL/yWSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g20PmhNrqhULgo0mDpAlV3BEiiG36R99yab58HyIWIyeIKRC/B33GBqJpgByFbbsV oijRrxfACR0FKNhgdMA9TAwU5rCU4Uva5J5/LYZJkDr5WSoUVIWJLAuA8gxohhwqaK h71BzVzn7RXPlLPNqwFyctbNDAErsCaqBs2jlfek= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:43 +1000 Message-Id: <20180925070154.5812-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 03/14] hw/ppc: on 40p machine, change default firmware to OpenBIOS 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, groug@kaod.org, =?UTF-8?q?Herv=C3=A9=20Poussineau?= , clg@kaod.org, qemu-ppc@nongnu.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: Herv=C3=A9 Poussineau OpenBIOS gained 40p support in 5b20e4cacecb62fb2bdc6867c11d44cddd77c4ff Use it, instead of relying on an unmaintained and very limited firmware. Signed-off-by: Herv=C3=A9 Poussineau Signed-off-by: David Gibson --- hw/ppc/prep.c | 2 +- tests/boot-serial-test.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 162b27a3b8..baca1d7c04 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -651,7 +651,7 @@ static void ibm_40p_init(MachineState *machine) /* PCI host */ dev =3D qdev_create(NULL, "raven-pcihost"); if (!bios_name) { - bios_name =3D BIOS_FILENAME; + bios_name =3D "openbios-ppc"; } qdev_prop_set_string(dev, "bios-name", bios_name); qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE); diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c index f123b15e3e..f865822e32 100644 --- a/tests/boot-serial-test.c +++ b/tests/boot-serial-test.c @@ -75,12 +75,12 @@ typedef struct testdef { static testdef_t tests[] =3D { { "alpha", "clipper", "", "PCI:" }, { "ppc", "ppce500", "", "U-Boot" }, - { "ppc", "40p", "-boot d", "Booting from device d" }, + { "ppc", "40p", "-vga none -boot d", "Trying cd:," }, { "ppc", "g3beige", "", "PowerPC,750" }, { "ppc", "mac99", "", "PowerPC,G4" }, { "ppc", "sam460ex", "-m 256", "DRAM: 256 MiB" }, { "ppc64", "ppce500", "", "U-Boot" }, - { "ppc64", "40p", "-m 192", "Memory size: 192 MB" }, + { "ppc64", "40p", "-m 192", "Memory: 192M" }, { "ppc64", "mac99", "", "PowerPC,970FX" }, { "ppc64", "pseries", "", "Open Firmware" }, { "ppc64", "powernv", "-cpu POWER8", "OPAL" }, --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859406370395.3300295927912; Tue, 25 Sep 2018 00:10:06 -0700 (PDT) Received: from localhost ([::1]:51290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hTq-0005fj-Nm for importer@patchew.org; Tue, 25 Sep 2018 03:09:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMK-0006uG-DE for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMF-0006Oh-KI for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:12 -0400 Received: from ozlabs.org ([203.11.71.1]:51415) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMF-0006NG-8W; Tue, 25 Sep 2018 03:02:07 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp01xXlz9sCh; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=7Ewwb0cFkGgp431aT9dfZ1XA2dRKH4vH7aAKG2Ny9ag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EqyUT7tRK+DBi6J3YOKmCmlDtMRPTIpfsgj2xBYmht6IhyIOp+6RC8or0R74vgueL 9+aePQPWnPap8nX0Wk0vqbzOyk+fZ2WiUBY5DoG1moOJmeS9440ixo/rUFQryzX1BF kT9XsCDwA9B4KGqaQ5XAJfh+svBVPamN8zx7Z8YI= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:44 +1000 Message-Id: <20180925070154.5812-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 04/14] raven: some minor IRQ-related tidy-ups 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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: Mark Cave-Ayland This really lays the groundwork for the upcoming patches: it renames the irqs PREPPCIState struct member to pci_irqs (as soon there will be a distinction) and then changes the raven IRQ opaque to use PREPPCIState instead of just irqs array. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Herv=C3=A9 Poussineau Tested-by: Herv=C3=A9 Poussineau Signed-off-by: David Gibson --- hw/pci-host/prep.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index 88f035c20b..9b36f19c97 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -55,7 +55,7 @@ typedef struct RavenPCIState { typedef struct PRePPCIState { PCIHostState parent_obj; =20 - qemu_irq irq[PCI_NUM_PINS]; + qemu_irq pci_irqs[PCI_NUM_PINS]; PCIBus pci_bus; AddressSpace pci_io_as; MemoryRegion pci_io; @@ -194,9 +194,9 @@ static int raven_map_irq(PCIDevice *pci_dev, int irq_nu= m) =20 static void raven_set_irq(void *opaque, int irq_num, int level) { - qemu_irq *pic =3D opaque; + PREPPCIState *s =3D opaque; =20 - qemu_set_irq(pic[irq_num] , level); + qemu_set_irq(s->pci_irqs[irq_num], level); } =20 static AddressSpace *raven_pcihost_set_iommu(PCIBus *bus, void *opaque, @@ -223,13 +223,12 @@ static void raven_pcihost_realizefn(DeviceState *d, E= rror **errp) int i; =20 for (i =3D 0; i < PCI_NUM_PINS; i++) { - sysbus_init_irq(dev, &s->irq[i]); + sysbus_init_irq(dev, &s->pci_irqs[i]); } =20 qdev_init_gpio_in(d, raven_change_gpio, 1); =20 - pci_bus_irqs(&s->pci_bus, raven_set_irq, raven_map_irq, s->irq, - PCI_NUM_PINS); + pci_bus_irqs(&s->pci_bus, raven_set_irq, raven_map_irq, s, PCI_NUM_PIN= S); =20 memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_le_ops, = s, "pci-conf-idx", 4); --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537859082149457.6804163377168; Tue, 25 Sep 2018 00:04:42 -0700 (PDT) Received: from localhost ([::1]:51252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hOZ-0008N9-Sp for importer@patchew.org; Tue, 25 Sep 2018 03:04:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMH-0006tz-KY for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMG-0006Ow-GZ for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:09 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:44453) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMF-0006NI-QG; Tue, 25 Sep 2018 03:02:08 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp03C0Mz9sCT; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=p5SonEGZC0wqZecHvi+cukFT4KXuZBncTGlK8eI5/1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KFzOnffqr1pqAWHHvVyjM6B2DOICpjZRDBOY3S58NPWdRaKqCMEuyWx57BLY9L+p6 P5ALqLD9/PFVsROc7ZZYRagZj2SX1qRnllfy5jNYicHHGkkHNutCEVo/jYhxUxUcis ebLnxHXqPP2PE1ThESeC1WEzxj6jKfPs6CVGRd48= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:45 +1000 Message-Id: <20180925070154.5812-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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] [PULL 05/14] 40p: use OR gate to wire up raven PCI interrupts 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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: Mark Cave-Ayland According to the PReP specification section 6.1.6 "System Interrupt Assignments", all PCI interrupts are routed via IRQ 15. Instead of mapping each PCI IRQ separately, we introduce an OR gate within = the raven PCI host bridge and then wire the single output of the OR gate to the interrupt controller. Note that whilst the (now deprecated) PReP machine still exists we still ne= ed to preserve the old IRQ routing. This is done by adding a new "is-legacy-pr= ep" property to the raven PCI host bridge which is set to true for the PReP machine. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Herv=C3=A9 Poussineau Tested-by: Herv=C3=A9 Poussineau Signed-off-by: David Gibson --- hw/pci-host/prep.c | 25 +++++++++++++++++++++++-- hw/ppc/prep.c | 4 +--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index 9b36f19c97..b1b6b16bad 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -32,6 +32,7 @@ #include "hw/pci/pci_host.h" #include "hw/i386/pc.h" #include "hw/loader.h" +#include "hw/or-irq.h" #include "exec/address-spaces.h" #include "elf.h" =20 @@ -55,6 +56,7 @@ typedef struct RavenPCIState { typedef struct PRePPCIState { PCIHostState parent_obj; =20 + qemu_or_irq *or_irq; qemu_irq pci_irqs[PCI_NUM_PINS]; PCIBus pci_bus; AddressSpace pci_io_as; @@ -69,6 +71,7 @@ typedef struct PRePPCIState { RavenPCIState pci_dev; =20 int contiguous_map; + bool is_legacy_prep; } PREPPCIState; =20 #define BIOS_SIZE (1 * MiB) @@ -222,8 +225,23 @@ static void raven_pcihost_realizefn(DeviceState *d, Er= ror **errp) MemoryRegion *address_space_mem =3D get_system_memory(); int i; =20 - for (i =3D 0; i < PCI_NUM_PINS; i++) { - sysbus_init_irq(dev, &s->pci_irqs[i]); + if (s->is_legacy_prep) { + for (i =3D 0; i < PCI_NUM_PINS; i++) { + sysbus_init_irq(dev, &s->pci_irqs[i]); + } + } else { + /* According to PReP specification section 6.1.6 "System Interrupt + * Assignments", all PCI interrupts are routed via IRQ 15 */ + s->or_irq =3D OR_IRQ(object_new(TYPE_OR_IRQ)); + object_property_set_int(OBJECT(s->or_irq), PCI_NUM_PINS, "num-line= s", + &error_fatal); + object_property_set_bool(OBJECT(s->or_irq), true, "realized", + &error_fatal); + sysbus_init_irq(dev, &s->or_irq->out_irq); + + for (i =3D 0; i < PCI_NUM_PINS; i++) { + s->pci_irqs[i] =3D qdev_get_gpio_in(DEVICE(s->or_irq), i); + } } =20 qdev_init_gpio_in(d, raven_change_gpio, 1); @@ -382,6 +400,9 @@ static Property raven_pcihost_properties[] =3D { DEFINE_PROP_UINT32("elf-machine", PREPPCIState, pci_dev.elf_machine, EM_NONE), DEFINE_PROP_STRING("bios-name", PREPPCIState, pci_dev.bios_name), + /* Temporary workaround until legacy prep machine is removed */ + DEFINE_PROP_BOOL("is-legacy-prep", PREPPCIState, is_legacy_prep, + false), DEFINE_PROP_END_OF_LIST() }; =20 diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index baca1d7c04..4bb831c3e6 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -502,6 +502,7 @@ static void ppc_prep_init(MachineState *machine) } qdev_prop_set_string(dev, "bios-name", bios_name); qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE); + qdev_prop_set_bit(dev, "is-legacy-prep", true); pcihost =3D PCI_HOST_BRIDGE(dev); object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), NU= LL); qdev_init_nofail(dev); @@ -669,9 +670,6 @@ static void ibm_40p_init(MachineState *machine) qdev_connect_gpio_out(dev, 0, cpu->env.irq_inputs[PPC6xx_INPUT_INT]); sysbus_connect_irq(pcihost, 0, qdev_get_gpio_in(dev, 15)); - sysbus_connect_irq(pcihost, 1, qdev_get_gpio_in(dev, 13)); - sysbus_connect_irq(pcihost, 2, qdev_get_gpio_in(dev, 15)); - sysbus_connect_irq(pcihost, 3, qdev_get_gpio_in(dev, 13)); isa_bus =3D ISA_BUS(qdev_get_child_bus(dev, "isa.0")); =20 /* Memory controller */ --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537859082013298.68576759491623; Tue, 25 Sep 2018 00:04:42 -0700 (PDT) Received: from localhost ([::1]:51251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hOa-0008Mb-G9 for importer@patchew.org; Tue, 25 Sep 2018 03:04:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMJ-0006u3-EB for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMD-0006NQ-Gd for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:11 -0400 Received: from ozlabs.org ([203.11.71.1]:35523) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMC-000698-Rr; Tue, 25 Sep 2018 03:02:05 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp011W0z9sCP; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=h2PSoO6vOaUO5WxpetbzMqdUL1IRSrtFG5WmI4h81xY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2ZR0J1iNQztaFUwYACQg5laJhuQ0zbudul6UityUc3mFZ7rLQBY8l2WDyTj44wxb tSyVOwwgnZ8nF29jBSGwUZGVVAoVZLe/5hfQSTmwli8L5eqxUpN3WmSodMkvfAHCsT LMrb9qbX70810PvOA6MG5Mv46FxNwc/OwezKBUnE= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:46 +1000 Message-Id: <20180925070154.5812-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 06/14] spapr: introduce a spapr_irq class 'nr_msis' attribute 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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 The number of MSI interrupts a sPAPR machine can allocate is in direct relation with the number of interrupts of the sPAPRIrq backend. Define statically this value at the sPAPRIrq class level and use it for the "ibm,pe-total-#msi" property of the sPAPR PHB. According to the PAPR specs, "ibm,pe-total-#msi" defines the maximum number of MSIs that are available to the PE. We choose to advertise the maximum number of MSIs that are available to the machine for simplicity of the model and to avoid segmenting the MSI interrupt pool which can be easily shared. If the pool limit is reached, it can be extended dynamically. Finally, remove XICS_IRQS_SPAPR which is now unused. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr_irq.c | 9 +++++++-- hw/ppc/spapr_pci.c | 5 +++-- include/hw/ppc/spapr_irq.h | 1 + include/hw/ppc/xics.h | 2 -- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 0cbb5dd393..fe8be5f521 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -99,7 +99,7 @@ static void spapr_irq_init_xics(sPAPRMachineState *spapr,= Error **errp) =20 /* Initialize the MSI IRQ allocator. */ if (!SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) { - spapr_irq_msi_init(spapr, XICS_IRQ_BASE + nr_irqs - SPAPR_IRQ_MSI); + spapr_irq_msi_init(spapr, smc->irq->nr_msis); } =20 if (kvm_enabled()) { @@ -195,8 +195,13 @@ static void spapr_irq_print_info_xics(sPAPRMachineStat= e *spapr, Monitor *mon) ics_pic_print_info(spapr->ics, mon); } =20 +#define SPAPR_IRQ_XICS_NR_IRQS 0x400 +#define SPAPR_IRQ_XICS_NR_MSIS \ + (XICS_IRQ_BASE + SPAPR_IRQ_XICS_NR_IRQS - SPAPR_IRQ_MSI) + sPAPRIrq spapr_irq_xics =3D { - .nr_irqs =3D XICS_IRQS_SPAPR, + .nr_irqs =3D SPAPR_IRQ_XICS_NR_IRQS, + .nr_msis =3D SPAPR_IRQ_XICS_NR_MSIS, =20 .init =3D spapr_irq_init_xics, .claim =3D spapr_irq_claim_xics, diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 6bcb4f419b..bb736177e7 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -2121,6 +2121,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, sPAPRTCETable *tcet; PCIBus *bus =3D PCI_HOST_BRIDGE(phb)->bus; sPAPRFDT s_fdt; + sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(qdev_get_machine()); =20 /* Start populating the FDT */ nodename =3D g_strdup_printf("pci@%" PRIx64, phb->buid); @@ -2138,8 +2139,8 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, _FDT(fdt_setprop(fdt, bus_off, "ranges", &ranges, sizeof_ranges)); _FDT(fdt_setprop(fdt, bus_off, "reg", &bus_reg, sizeof(bus_reg))); _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pci-config-space-type", 0x1)); - /* TODO: fine tune the total count of allocatable MSIs per PHB */ - _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", XICS_IRQS_SPA= PR)); + _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", + smc->irq->nr_msis)); =20 /* Dynamic DMA window */ if (phb->ddw_enabled) { diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index 0e98c4474b..650f810ad2 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -31,6 +31,7 @@ void spapr_irq_msi_reset(sPAPRMachineState *spapr); =20 typedef struct sPAPRIrq { uint32_t nr_irqs; + uint32_t nr_msis; =20 void (*init)(sPAPRMachineState *spapr, Error **errp); int (*claim)(sPAPRMachineState *spapr, int irq, bool lsi, Error **errp= ); diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 9c2916c9b2..9958443d19 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -181,8 +181,6 @@ typedef struct XICSFabricClass { ICPState *(*icp_get)(XICSFabric *xi, int server); } XICSFabricClass; =20 -#define XICS_IRQS_SPAPR 1024 - void spapr_dt_xics(int nr_servers, void *fdt, uint32_t phandle); =20 ICPState *xics_icp_get(XICSFabric *xi, int server); --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537859082000832.9993849770664; Tue, 25 Sep 2018 00:04:42 -0700 (PDT) Received: from localhost ([::1]:51253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hOb-0008OS-D7 for importer@patchew.org; Tue, 25 Sep 2018 03:04:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMJ-0006u0-Cb for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMH-0006Pd-Re for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:11 -0400 Received: from ozlabs.org ([203.11.71.1]:38683) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMH-0006Ni-FY; Tue, 25 Sep 2018 03:02:09 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp04jHlz9sCV; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=5uCva2W2HVzodcozm/NUkUwcZp6MqC5fA311tZ6ag+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PR+btLDDSL2m/Tqr8HFm4DDlcxZlhzfxwkUiXstfiTKd3HCR5tdFMhQq3GBZBnN8R LXTBg2n4GuoIRoQAJV7FEewI2h991ck+8Sawkx9RZM/8e09mqZngYaog5vFLI/rn6v cS+epLzG1P0bA0a2KufW3DOqIb2XM8w7naFkho7k= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:47 +1000 Message-Id: <20180925070154.5812-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 07/14] spapr: increase the size of the IRQ number space 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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 The new layout using static IRQ number does not leave much space to the dynamic MSI range, only 0x100 IRQ numbers. Increase the total number of IRQS for newer machines and introduce a legacy XICS backend for pre-3.1 machines to maintain compatibility. For the old backend, provide a 'nr_msis' value covering the full IRQ number space as it does not use the bitmap allocator to allocate MSI interrupt numbers. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr.c | 1 + hw/ppc/spapr_irq.c | 15 ++++++++++++++- include/hw/ppc/spapr_irq.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4a9dd4d9bc..eba7d60a30 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3971,6 +3971,7 @@ static void spapr_machine_3_0_class_options(MachineCl= ass *mc) SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_0); =20 smc->legacy_irq_allocation =3D true; + smc->irq =3D &spapr_irq_xics_legacy; } =20 DEFINE_SPAPR_MACHINE(3_0, "3.0", false); diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index fe8be5f521..e77b94cc68 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -195,7 +195,7 @@ static void spapr_irq_print_info_xics(sPAPRMachineState= *spapr, Monitor *mon) ics_pic_print_info(spapr->ics, mon); } =20 -#define SPAPR_IRQ_XICS_NR_IRQS 0x400 +#define SPAPR_IRQ_XICS_NR_IRQS 0x1000 #define SPAPR_IRQ_XICS_NR_MSIS \ (XICS_IRQ_BASE + SPAPR_IRQ_XICS_NR_IRQS - SPAPR_IRQ_MSI) =20 @@ -289,3 +289,16 @@ int spapr_irq_find(sPAPRMachineState *spapr, int num, = bool align, Error **errp) =20 return first + ics->offset; } + +#define SPAPR_IRQ_XICS_LEGACY_NR_IRQS 0x400 + +sPAPRIrq spapr_irq_xics_legacy =3D { + .nr_irqs =3D SPAPR_IRQ_XICS_LEGACY_NR_IRQS, + .nr_msis =3D SPAPR_IRQ_XICS_LEGACY_NR_IRQS, + + .init =3D spapr_irq_init_xics, + .claim =3D spapr_irq_claim_xics, + .free =3D spapr_irq_free_xics, + .qirq =3D spapr_qirq_xics, + .print_info =3D spapr_irq_print_info_xics, +}; diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index 650f810ad2..a467ce696e 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -41,6 +41,7 @@ typedef struct sPAPRIrq { } sPAPRIrq; =20 extern sPAPRIrq spapr_irq_xics; +extern sPAPRIrq spapr_irq_xics_legacy; =20 int spapr_irq_claim(sPAPRMachineState *spapr, int irq, bool lsi, Error **e= rrp); void spapr_irq_free(sPAPRMachineState *spapr, int irq, int num); --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859267646205.55284853233672; Tue, 25 Sep 2018 00:07:47 -0700 (PDT) Received: from localhost ([::1]:51272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hRf-00030X-H6 for importer@patchew.org; Tue, 25 Sep 2018 03:07:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMO-0006ws-59 for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMM-0006S2-9Q for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:15 -0400 Received: from ozlabs.org ([203.11.71.1]:56639) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMK-0006Nm-C9; Tue, 25 Sep 2018 03:02:14 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp06KbQz9sCv; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=z+bVtYXz7P2jCY3Ikv7e8fBk9vsSwYypU9v0NGyHqSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hB2wr/bWl/D4wu4xnaTbkkVrj23hmGwiA8dkX1Tn3vk+AapK79j31vdKFEUMjRf++ ZcR+7G3XFRWJpziIJ8cZBjgERxxXPxa9csw+9fIkCoGegLayFHQoXHcN5XTYczDjC3 bLt3zC+TF0qo6erXSzXCimE8x/rsRJxsONVAllgc= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:48 +1000 Message-Id: <20180925070154.5812-9-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 08/14] spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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 So that we don't have to call qdev_get_machine() to get the machine class and the sPAPRIrq backend holding the number of MSIs. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_pci.c | 9 +++------ include/hw/pci-host/spapr.h | 5 ++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index eba7d60a30..98868d893a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1267,7 +1267,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr, } =20 QLIST_FOREACH(phb, &spapr->phbs, list) { - ret =3D spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt); + ret =3D spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt, smc->irq->nr= _msis); if (ret < 0) { error_report("couldn't setup PCI devices in fdt"); exit(1); diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index bb736177e7..c2271e6ed4 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -2069,9 +2069,8 @@ static void spapr_phb_pci_enumerate(sPAPRPHBState *ph= b) =20 } =20 -int spapr_populate_pci_dt(sPAPRPHBState *phb, - uint32_t xics_phandle, - void *fdt) +int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void = *fdt, + uint32_t nr_msis) { int bus_off, i, j, ret; gchar *nodename; @@ -2121,7 +2120,6 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, sPAPRTCETable *tcet; PCIBus *bus =3D PCI_HOST_BRIDGE(phb)->bus; sPAPRFDT s_fdt; - sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(qdev_get_machine()); =20 /* Start populating the FDT */ nodename =3D g_strdup_printf("pci@%" PRIx64, phb->buid); @@ -2139,8 +2137,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, _FDT(fdt_setprop(fdt, bus_off, "ranges", &ranges, sizeof_ranges)); _FDT(fdt_setprop(fdt, bus_off, "reg", &bus_reg, sizeof(bus_reg))); _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pci-config-space-type", 0x1)); - _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", - smc->irq->nr_msis)); + _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", nr_msis)); =20 /* Dynamic DMA window */ if (phb->ddw_enabled) { diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 0fae4fc6a4..7c66c3872f 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -113,9 +113,8 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRP= HBState *phb, int pin) =20 PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index); =20 -int spapr_populate_pci_dt(sPAPRPHBState *phb, - uint32_t xics_phandle, - void *fdt); +int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void = *fdt, + uint32_t nr_msis); =20 void spapr_pci_rtas_init(void); =20 --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859410548601.0519485398446; Tue, 25 Sep 2018 00:10:10 -0700 (PDT) Received: from localhost ([::1]:51292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hTx-0005nN-Kl for importer@patchew.org; Tue, 25 Sep 2018 03:10:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMK-0006uH-Ef for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMJ-0006Q2-AG for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:12 -0400 Received: from ozlabs.org ([203.11.71.1]:51553) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMI-0006Nj-75; Tue, 25 Sep 2018 03:02:10 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp05fjgz9sCm; Tue, 25 Sep 2018 17:02:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=sypZoMskzeKJbT7ou/0eYhYDWaaXR3CpWrzZqZKvBWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0YNbQkmhx89boCo1Usw9+ovr4EL0ihLkLO838PE2Ggz3RkovH5tPGjOWhJJ090n5 Vv1hew8zNJo0DEFKvP1Pm9eBwLZbl+L5KOW3LamvMdzOCci6WO9CoAYnYTl9eTWZsT ygdwqvDxCVn1yOmmB1SkZuiIz7u6yh76XHu2Iv6w= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:49 +1000 Message-Id: <20180925070154.5812-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 09/14] sm501: Adjust endianness of pixel value in rectangle fill 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, Marcus Comstedt , 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" From: Marcus Comstedt The value from twoD_foreground (which is in host endian format) must be converted to the endianness of the framebuffer (currently always little endian) before it can be used to perform the fill operation. Signed-off-by: Marcus Comstedt Reviewed-by: BALATON Zoltan Reviewed-by: Peter Maydell Signed-off-by: David Gibson --- hw/display/sm501.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 874260a143..4a8686f0f5 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -39,6 +39,7 @@ #include "hw/i2c/i2c-ddc.h" #include "qemu/range.h" #include "ui/pixel_ops.h" +#include "qemu/bswap.h" =20 /* * Status: 2010/05/07 @@ -812,9 +813,11 @@ static void sm501_2d_operation(SM501State *s) FILL_RECT(1, uint8_t); break; case 1: + color =3D cpu_to_le16(color); FILL_RECT(2, uint16_t); break; case 2: + color =3D cpu_to_le32(color); FILL_RECT(4, uint32_t); break; } --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859624472428.612967200012; Tue, 25 Sep 2018 00:13:44 -0700 (PDT) Received: from localhost ([::1]:51315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hXT-0008N6-C8 for importer@patchew.org; Tue, 25 Sep 2018 03:13:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMQ-0006yW-0z for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMK-0006Qj-BD for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:17 -0400 Received: from ozlabs.org ([203.11.71.1]:39393) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMJ-0006O8-B4; Tue, 25 Sep 2018 03:02:11 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp10QXlz9sDB; Tue, 25 Sep 2018 17:02:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858921; bh=XaHWa5UKXfcDo0OA1kSClHu1K3RkOX5fcnytPRqlmIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c3IOj8e+VTe61TovVxoDsa1HENI0YREE6sB1dpmx4fpUrExjxZgxthYchbYkyFgDU /yEOBNRABjKnAIZMo/WUffxkwOQ/Xx/iNzfpYTKPzAFnaJW4Ydk+2wI8pUqiGcJuP+ 5/MgeaAl9AQ7aTTJSnuQBjREsvcjG1chVHl2JIGk= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:50 +1000 Message-Id: <20180925070154.5812-11-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 10/14] scsi: add lsi53c8xx_handle_legacy_cmdline() function 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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: Mark Cave-Ayland This is the function that will soon be used to replace lsi53c895a_create() = and lsi53c810_create(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- hw/scsi/lsi53c895a.c | 7 +++++++ include/hw/pci/pci.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 955ba94800..8f5ab82d57 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2290,3 +2290,10 @@ void lsi53c810_create(PCIBus *bus, int devfn) =20 scsi_bus_legacy_handle_cmdline(&s->bus); } + +void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev) +{ + LSIState *s =3D LSI53C895A(lsi_dev); + + scsi_bus_legacy_handle_cmdline(&s->bus); +} diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 990d6fcbde..0d907dc084 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -709,6 +709,7 @@ PCIDevice *pci_create_simple(PCIBus *bus, int devfn, co= nst char *name); =20 void lsi53c895a_create(PCIBus *bus); void lsi53c810_create(PCIBus *bus, int devfn); +void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev); =20 qemu_irq pci_allocate_irq(PCIDevice *pci_dev); void pci_set_irq(PCIDevice *pci_dev, int level); --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859544298647.869872875305; Tue, 25 Sep 2018 00:12:24 -0700 (PDT) Received: from localhost ([::1]:51308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hWB-0007PN-8F for importer@patchew.org; Tue, 25 Sep 2018 03:12:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMT-00072j-LE for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMO-0006U4-R2 for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:21 -0400 Received: from ozlabs.org ([203.11.71.1]:60917) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMO-0006Op-4n; Tue, 25 Sep 2018 03:02:16 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp15K9gz9sDF; Tue, 25 Sep 2018 17:02:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858921; bh=BHa7CwNKzOrc+jtlGv2FW/hyqEf4Df2HnD6Smwx+ZtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NTNoufdstj+WtUUCqUr1D93l3Wk5/k4xKyjaQwi672UWrKdgA6YOrQAJttJ+sB9w3 Jh/Gr75ilJiOuPnAVSjv+Ys897F10sO3diHOhOfWfnIfUXgaPZyFgCBtabfCJfiBWb J7+Rb4xvDZ7AZqTNhMLCjcs5NemHnzsBiORWSlmA= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:51 +1000 Message-Id: <20180925070154.5812-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 11/14] scsi: move lsi53c8xx_create() callers to lsi53c8xx_handle_legacy_cmdline() 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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: Mark Cave-Ayland As part of commits a64aa5785d "hw: Deprecate -drive if=3Dscsi with non-onbo= ard HBAs" and b891538e81 "hw/ppc/prep: Fix implicit creation of "-drive if=3Dsc= si" devices" the lsi53c895a_create() and lsi53c810_create() functions were added to wrap pci_create_simple() and scsi_bus_legacy_handle_cmdline(). Unfortunately this prevents us from changing qdev properties on the device and/or changing the PCI configuration. By switching over to using the new lsi53c8xx_handle_legacy_cmdline() function then the caller can now configure and realize the LSI SCSI device exactly as required. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Peter Maydell [arm parts] Signed-off-by: David Gibson --- hw/arm/realview.c | 3 ++- hw/arm/versatilepb.c | 3 ++- hw/hppa/machine.c | 4 +++- hw/ppc/prep.c | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index ab8c14fde3..242f5a87b6 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -257,7 +257,8 @@ static void realview_init(MachineState *machine, } n =3D drive_get_max_bus(IF_SCSI); while (n >=3D 0) { - lsi53c895a_create(pci_bus); + dev =3D DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); + lsi53c8xx_handle_legacy_cmdline(dev); n--; } } diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 8b74857059..22b09a1e61 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -278,7 +278,8 @@ static void versatile_init(MachineState *machine, int b= oard_id) } n =3D drive_get_max_bus(IF_SCSI); while (n >=3D 0) { - lsi53c895a_create(pci_bus); + dev =3D DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); + lsi53c8xx_handle_legacy_cmdline(dev); n--; } =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index cf7c61c6cc..0fb8fb877e 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -59,6 +59,7 @@ static void machine_hppa_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; + DeviceState *dev; PCIBus *pci_bus; ISABus *isa_bus; qemu_irq rtc_irq, serial_irq; @@ -115,7 +116,8 @@ static void machine_hppa_init(MachineState *machine) } =20 /* SCSI disk setup. */ - lsi53c895a_create(pci_bus); + dev =3D DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); + lsi53c8xx_handle_legacy_cmdline(dev); =20 /* Network setup. e1000 is good enough, failing Tulip support. */ for (i =3D 0; i < nb_nics; i++) { diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 4bb831c3e6..7e2c70b92a 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -700,7 +700,9 @@ static void ibm_40p_init(MachineState *machine) qdev_prop_set_uint32(dev, "equipment", 0xc0); qdev_init_nofail(dev); =20 - lsi53c810_create(pci_bus, PCI_DEVFN(1, 0)); + dev =3D DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(1, 0), + "lsi53c810")); + lsi53c8xx_handle_legacy_cmdline(dev); =20 /* XXX: s3-trio at PCI_DEVFN(2, 0) */ pci_vga_init(pci_bus); --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 15378596647101000.2524017674199; Tue, 25 Sep 2018 00:14:24 -0700 (PDT) Received: from localhost ([::1]:51318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hY7-0000RD-K7 for importer@patchew.org; Tue, 25 Sep 2018 03:14:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMT-00072s-RP for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMO-0006TD-4I for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:21 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:56185) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMM-0006Nu-9q; Tue, 25 Sep 2018 03:02:15 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp071vQz9sCt; Tue, 25 Sep 2018 17:02:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=lvwIEVwY4aZGPv6iPdUzJW6b510jgNljx0ARFh0hlts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lBiwGhnwH7etItSRAD2cA4naCAaJYFVok/KgZrPjm/jqvKE170IBHU2txZbdEeQyE btw9aKGAxnvDrgSBjVBmLEWAL6BX6JKGE+RXkrDQI6Ycxxpt0ErrjBkWCRHoK1Fcqh v8PLiLsdNl8p5F0AoPrK0bax0H4pplOtiLapJ2JQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:52 +1000 Message-Id: <20180925070154.5812-13-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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] [PULL 12/14] scsi: remove unused lsi53c895a_create() and lsi53c810_create() functions 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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: Mark Cave-Ayland Now that these functions are no longer required they can be removed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- hw/scsi/lsi53c895a.c | 14 -------------- include/hw/pci/pci.h | 2 -- 2 files changed, 16 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 8f5ab82d57..f5cbbf653c 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2277,20 +2277,6 @@ static void lsi53c895a_register_types(void) =20 type_init(lsi53c895a_register_types) =20 -void lsi53c895a_create(PCIBus *bus) -{ - LSIState *s =3D LSI53C895A(pci_create_simple(bus, -1, "lsi53c895a")); - - scsi_bus_legacy_handle_cmdline(&s->bus); -} - -void lsi53c810_create(PCIBus *bus, int devfn) -{ - LSIState *s =3D LSI53C895A(pci_create_simple(bus, devfn, "lsi53c810")); - - scsi_bus_legacy_handle_cmdline(&s->bus); -} - void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev) { LSIState *s =3D LSI53C895A(lsi_dev); diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 0d907dc084..e6514bba23 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -707,8 +707,6 @@ PCIDevice *pci_create_simple_multifunction(PCIBus *bus,= int devfn, PCIDevice *pci_create(PCIBus *bus, int devfn, const char *name); PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name); =20 -void lsi53c895a_create(PCIBus *bus); -void lsi53c810_create(PCIBus *bus, int devfn); void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev); =20 qemu_irq pci_allocate_irq(PCIDevice *pci_dev); --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859820480672.3973624781811; Tue, 25 Sep 2018 00:17:00 -0700 (PDT) Received: from localhost ([::1]:51339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4had-0002cs-5a for importer@patchew.org; Tue, 25 Sep 2018 03:16:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMU-00073S-BS for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMO-0006Tp-JC for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:22 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:33775) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMO-0006P8-4h; Tue, 25 Sep 2018 03:02:16 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp31dHWz9sD4; Tue, 25 Sep 2018 17:02:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858923; bh=+BJg6pGJl7FEuOzThyH0ao7Gw3fcp7eFY7cJCJfS7A4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yk2K0ZUI7Hoi5bImTKaIqlV7Do/Lsvzt+dvIxYB355klkNA92cpLtN8FkLihAT1/6 msGQTwUkO8R5o10RNlCZrW8E3dHcS0WDHhZDLkaRrkKUNsrcby6FzJg/M4GEjYR+vW tU8rpNdJnuSbA4eV4QTiRb1m6iI231mt5poZkTzE= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:53 +1000 Message-Id: <20180925070154.5812-14-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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] [PULL 13/14] lsi53c895a: add optional external IRQ via qdev 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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: Mark Cave-Ayland On some early machines the on-board PCI devices IRQs are wired directly to the interrupt controller instead of via the PCI host bridge. Add an optional external IRQ that if wired up via qdev will replace the in-built PCI IRQ. Signed-off-by: Mark Cave-Ayland Reviewed-by: David Gibson Reviewed-by: Fam Zheng Reviewed-by: Herv=C3=A9 Poussineau Tested-by: Herv=C3=A9 Poussineau Signed-off-by: David Gibson --- hw/scsi/lsi53c895a.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index f5cbbf653c..996b40650d 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -207,6 +207,7 @@ typedef struct { PCIDevice parent_obj; /*< public >*/ =20 + qemu_irq ext_irq; MemoryRegion mmio_io; MemoryRegion ram_io; MemoryRegion io_io; @@ -443,9 +444,19 @@ static void lsi_stop_script(LSIState *s) s->istat1 &=3D ~LSI_ISTAT1_SRUN; } =20 -static void lsi_update_irq(LSIState *s) +static void lsi_set_irq(LSIState *s, int level) { PCIDevice *d =3D PCI_DEVICE(s); + + if (s->ext_irq) { + qemu_set_irq(s->ext_irq, level); + } else { + pci_set_irq(d, level); + } +} + +static void lsi_update_irq(LSIState *s) +{ int level; static int last_level; lsi_request *p; @@ -477,7 +488,7 @@ static void lsi_update_irq(LSIState *s) level, s->dstat, s->sist1, s->sist0); last_level =3D level; } - pci_set_irq(d, level); + lsi_set_irq(s, level); =20 if (!level && lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON)) { DPRINTF("Handled IRQs & disconnected, looking for pending " @@ -2213,6 +2224,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **= errp) "lsi-io", 256); =20 address_space_init(&s->pci_io_as, pci_address_space_io(dev), "lsi-pci-= io"); + qdev_init_gpio_out(d, &s->ext_irq, 1); =20 pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_io); pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio_io); --=20 2.17.1 From nobody Wed Nov 5 20:03:29 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 1537859248654719.9840437040976; Tue, 25 Sep 2018 00:07:28 -0700 (PDT) Received: from localhost ([::1]:51269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hRP-0002mB-DF for importer@patchew.org; Tue, 25 Sep 2018 03:07:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMP-0006y2-IV for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMO-0006Tf-Fz for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:17 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:52647) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMO-0006OE-2H; Tue, 25 Sep 2018 03:02:16 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp11xW1z9sD0; Tue, 25 Sep 2018 17:02:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858921; bh=S4j0LGVQ7xWMynVt83yqBMrdOFd3DpIZgWT1nv1lwSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LOrhoUT6Sy8N9jFWZ24floJ/v9dq+0biP7eSeicrGA3RoElq4Csnf0VUDZ+hJtA3j QyeJ+xrfjVPSbFeCzwd/XHpd7Towhzcod8xTa+5AXKLRy/3zHEZbzkd9MaiqXTUZuZ s7HeYM5LMYaEPITlETdXKBDoOn3KGZDDbdCRairI= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:54 +1000 Message-Id: <20180925070154.5812-15-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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] [PULL 14/14] 40p: add fixed IRQ routing for LSI SCSI device 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, 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: Mark Cave-Ayland Whilst the PReP specification describes how all PCI IRQs are routed via IRQ 15 on the interrupt controller, the real 40p machine has a routing quirk in that the LSI SCSI device is routed directly to IRQ 13. Enable the external IRQ for the LSI SCSI device by wiring up the IRQ with qdev to the relevant interrupt controller gpio. Signed-off-by: Mark Cave-Ayland Acked-by: David Gibson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Herv=C3=A9 Poussineau Tested-by: Herv=C3=A9 Poussineau Signed-off-by: David Gibson --- hw/ppc/prep.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 7e2c70b92a..2afb7f437e 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -621,7 +621,7 @@ static void ibm_40p_init(MachineState *machine) CPUPPCState *env =3D NULL; uint16_t cmos_checksum; PowerPCCPU *cpu; - DeviceState *dev; + DeviceState *dev, *i82378_dev; SysBusDevice *pcihost, *s; Nvram *m48t59 =3D NULL; PCIBus *pci_bus; @@ -666,11 +666,11 @@ static void ibm_40p_init(MachineState *machine) } =20 /* PCI -> ISA bridge */ - dev =3D DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(11, 0), "i82378")); - qdev_connect_gpio_out(dev, 0, + i82378_dev =3D DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(11, 0), "i8= 2378")); + qdev_connect_gpio_out(i82378_dev, 0, cpu->env.irq_inputs[PPC6xx_INPUT_INT]); - sysbus_connect_irq(pcihost, 0, qdev_get_gpio_in(dev, 15)); - isa_bus =3D ISA_BUS(qdev_get_child_bus(dev, "isa.0")); + sysbus_connect_irq(pcihost, 0, qdev_get_gpio_in(i82378_dev, 15)); + isa_bus =3D ISA_BUS(qdev_get_child_bus(i82378_dev, "isa.0")); =20 /* Memory controller */ dev =3D DEVICE(isa_create(isa_bus, "rs6000-mc")); @@ -703,6 +703,7 @@ static void ibm_40p_init(MachineState *machine) dev =3D DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(1, 0), "lsi53c810")); lsi53c8xx_handle_legacy_cmdline(dev); + qdev_connect_gpio_out(dev, 0, qdev_get_gpio_in(i82378_dev, 13)); =20 /* XXX: s3-trio at PCI_DEVFN(2, 0) */ pci_vga_init(pci_bus); --=20 2.17.1