From patchwork Sun Oct 29 18:12:12 2017 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: 10031583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3738E603B5 for ; Sun, 29 Oct 2017 18:17:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F14C285E2 for ; Sun, 29 Oct 2017 18:17:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23A18286F9; Sun, 29 Oct 2017 18:17:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C3EA7285E2 for ; Sun, 29 Oct 2017 18:17:35 +0000 (UTC) Received: from localhost ([::1]:37306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8s9O-0007Hr-Ug for patchwork-qemu-devel@patchwork.kernel.org; Sun, 29 Oct 2017 14:17:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8s4t-0004i6-89 for qemu-devel@nongnu.org; Sun, 29 Oct 2017 14:12:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8s4q-0005qJ-3X for qemu-devel@nongnu.org; Sun, 29 Oct 2017 14:12:55 -0400 Received: from 4.mo178.mail-out.ovh.net ([46.105.49.171]:55981) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e8s4p-0005q8-TR for qemu-devel@nongnu.org; Sun, 29 Oct 2017 14:12:52 -0400 Received: from player793.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id E33596379A for ; Sun, 29 Oct 2017 19:12:50 +0100 (CET) Received: from zorba.kaod.org (ken64-2-78-199-76-109.fbx.proxad.net [78.199.76.109]) (Authenticated sender: clg@kaod.org) by player793.ha.ovh.net (Postfix) with ESMTPSA id 792304007C; Sun, 29 Oct 2017 19:12:43 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson , Greg Kurz , Benjamin Herrenschmidt Date: Sun, 29 Oct 2017 19:12:12 +0100 Message-Id: <20171029181217.9927-4-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171029181217.9927-1-clg@kaod.org> References: <20171029181217.9927-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 1883067598106364755 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedttddrfeekgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.49.171 Subject: [Qemu-devel] [PATCH 3/8] pnv: introduce an irq_test() operation 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=20Le=20Goater?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On PowerNV, there is no need for a bitmap for the moment. The only interrupts handled are the ones from the PSI controller. Signed-off-by: Cédric Le Goater --- hw/ppc/pnv.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index c35c439d816b..8288940ef9d7 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1018,6 +1018,23 @@ static ICPState *pnv_icp_get(XICSFabric *xi, int pir) return cpu ? ICP(cpu->intc) : NULL; } +static bool pnv_irq_test(XICSFabric *xi, int irq) +{ + PnvMachineState *pnv = POWERNV_MACHINE(xi); + int i; + + /* We don't have a IRQ allocator for the PowerNV machine yet, so + * just check that the IRQ number is valid for the PSI source + */ + for (i = 0; i < pnv->num_chips; i++) { + ICSState *ics = &pnv->chips[i]->psi.ics; + if (ics_valid_irq(ics, irq)) { + return true; + } + } + return false; +} + static void pnv_pic_print_info(InterruptStatsProvider *obj, Monitor *mon) { @@ -1102,6 +1119,7 @@ static void powernv_machine_class_init(ObjectClass *oc, void *data) xic->icp_get = pnv_icp_get; xic->ics_get = pnv_ics_get; xic->ics_resend = pnv_ics_resend; + xic->irq_test = pnv_irq_test; ispc->print_info = pnv_pic_print_info; powernv_machine_class_props_init(oc);