From patchwork Thu Jul 26 13:37:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 949662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41btVC4G4bz9ryt for ; Thu, 26 Jul 2018 23:38:59 +1000 (AEST) Received: from localhost ([::1]:36085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1figTp-0000rp-7i for incoming@patchwork.ozlabs.org; Thu, 26 Jul 2018 09:38:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1figSd-0000Jf-Cx for qemu-devel@nongnu.org; Thu, 26 Jul 2018 09:37:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1figSa-0001OU-Dd for qemu-devel@nongnu.org; Thu, 26 Jul 2018 09:37:43 -0400 Received: from 1.mo173.mail-out.ovh.net ([178.33.111.180]:57578) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1figSa-0001NM-5S for qemu-devel@nongnu.org; Thu, 26 Jul 2018 09:37:40 -0400 Received: from player687.ha.ovh.net (unknown [10.109.160.226]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id 764C9C7265 for ; Thu, 26 Jul 2018 15:37:38 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-1-10605-110.w90-89.abo.wanadoo.fr [90.89.196.110]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id 1344E2C00B1; Thu, 26 Jul 2018 15:37:27 +0200 (CEST) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: David Gibson Date: Thu, 26 Jul 2018 15:37:20 +0200 Message-Id: <20180726133723.17041-1-clg@kaod.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Ovh-Tracer-Id: 14889181844098092006 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtiedrjeekgdeiiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.33.111.180 Subject: [Qemu-devel] [PATCH v5 0/3] spapr: introduce a fixed IRQ number space and an IRQ controller backend 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: =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Here is a proposal for a new IRQ number space layout using static numbers and a bitmap allocator for the MSIs. The previous layout is kept for compatibly in machines raising the 'legacy_irq_allocation' flag. The patchset also introduces a sPAPR IRQ interface which offers the possibility to provide different IRQ controller backend to the sPAPR machine. This is preparing ground for the new XIVE controller. The new XICS layout will only be activated when a new pseries-3.1 machine is introduced. Thanks, C. Changes since v4 : - assigned IRQ numbers to their default static values - improved the reg_to_irq conversion routine for the VIO devices Changes since v3 : - introduced a reg_to_irq conversion routine for the VIO devices Changes since v2 : - renamed 'xics_legacy' to 'legacy_irq_allocation' - introduced the sPAPR IRQ backend interface - increase the size of the IRQ number space for newer machines Changes since v1 : - removed block allocation - spaced the IRQ offsets - check for overlaps when allocating VIO irqs - removed 'Error *' arg from spapr_irq_msi_init() Cédric Le Goater (3): spapr: introduce a fixed IRQ number space spapr: introduce a IRQ controller backend to the machine spapr: increase the size of the IRQ number space include/hw/ppc/spapr.h | 16 +- include/hw/ppc/spapr_irq.h | 55 +++++++ hw/ppc/spapr.c | 203 ++++--------------------- hw/ppc/spapr_cpu_core.c | 1 + hw/ppc/spapr_events.c | 12 +- hw/ppc/spapr_irq.c | 296 +++++++++++++++++++++++++++++++++++++ hw/ppc/spapr_pci.c | 29 +++- hw/ppc/spapr_vio.c | 65 +++++++- hw/ppc/Makefile.objs | 2 +- 9 files changed, 480 insertions(+), 199 deletions(-) create mode 100644 include/hw/ppc/spapr_irq.h create mode 100644 hw/ppc/spapr_irq.c