From patchwork Wed Mar 8 10:52:45 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: 736523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.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 3vdVkz1VGFz9s8W for ; Wed, 8 Mar 2017 21:54:03 +1100 (AEDT) Received: from localhost ([::1]:55513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clZEG-0007cl-JP for incoming@patchwork.ozlabs.org; Wed, 08 Mar 2017 05:54:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clZDW-0007ah-00 for qemu-devel@nongnu.org; Wed, 08 Mar 2017 05:53:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clZDV-00037G-4M for qemu-devel@nongnu.org; Wed, 08 Mar 2017 05:53:14 -0500 Received: from 9.mo177.mail-out.ovh.net ([46.105.72.238]:57780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clZDU-00035G-UE for qemu-devel@nongnu.org; Wed, 08 Mar 2017 05:53:13 -0500 Received: from player714.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id BF9023BD53 for ; Wed, 8 Mar 2017 11:53:05 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-10647-27.w90-89.abo.wanadoo.fr [90.89.233.27]) (Authenticated sender: clg@kaod.org) by player714.ha.ovh.net (Postfix) with ESMTPSA id 7A9E73C0093; Wed, 8 Mar 2017 11:53:01 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Wed, 8 Mar 2017 11:52:45 +0100 Message-Id: <1488970371-8865-3-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488970371-8865-1-git-send-email-clg@kaod.org> References: <1488970371-8865-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 16325830124675894246 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelhedrgeeggddujecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.72.238 Subject: [Qemu-devel] [PATCH for-2.10 2/8] ppc/xics: add an ics_eoi() handler to XICSFabric X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This handler will be required by PowerPC machines using multiple ICS objects, like this is the case for PowerNV. Also update the sPAPR machine to use the new handler. Signed-off-by: Cédric Le Goater --- hw/intc/xics.c | 9 +++------ hw/ppc/spapr.c | 11 +++++++++++ include/hw/ppc/xics.h | 2 ++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 209e1a75ecb9..e6fecd6e1a89 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -169,7 +169,7 @@ void ics_resend(ICSState *ics) } } -static void ics_eoi(ICSState *ics, int nr) +void ics_eoi(ICSState *ics, int nr) { ICSStateClass *k = ICS_BASE_GET_CLASS(ics); @@ -268,7 +268,6 @@ void icp_eoi(ICPState *icp, uint32_t xirr) { XICSFabric *xi = icp->xics; XICSFabricClass *xic = XICS_FABRIC_GET_CLASS(xi); - ICSState *ics; uint32_t irq; /* Send EOI -> ICS */ @@ -276,10 +275,8 @@ void icp_eoi(ICPState *icp, uint32_t xirr) trace_xics_icp_eoi(icp->cs->cpu_index, xirr, icp->xirr); irq = xirr & XISR_MASK; - ics = xic->ics_get(xi, irq); - if (ics) { - ics_eoi(ics, irq); - } + xic->ics_eoi(xi, irq); + if (!XISR(icp)) { icp_resend(icp); } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c3bb99160545..043629cc5c54 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3024,6 +3024,16 @@ static void spapr_ics_resend(XICSFabric *dev) ics_resend(spapr->ics); } +static void spapr_ics_eoi(XICSFabric *xi, int irq) +{ + ICSState *ics; + + ics = spapr_ics_get(xi, irq); + if (ics) { + ics_eoi(ics, irq); + } +} + static ICPState *spapr_icp_get(XICSFabric *xi, int server) { sPAPRMachineState *spapr = SPAPR_MACHINE(xi); @@ -3094,6 +3104,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) vhc->get_patbe = spapr_get_patbe; xic->ics_get = spapr_ics_get; xic->ics_resend = spapr_ics_resend; + xic->ics_eoi = spapr_ics_eoi; xic->icp_get = spapr_icp_get; ispc->print_info = spapr_pic_print_info; } diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 42bd24e975cb..00b003b2392d 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -155,6 +155,7 @@ typedef struct XICSFabricClass { InterfaceClass parent; ICSState *(*ics_get)(XICSFabric *xi, int irq); void (*ics_resend)(XICSFabric *xi); + void (*ics_eoi)(XICSFabric *xi, int irq); ICPState *(*icp_get)(XICSFabric *xi, int server); } XICSFabricClass; @@ -189,6 +190,7 @@ void icp_pic_print_info(ICPState *icp, Monitor *mon); void ics_pic_print_info(ICSState *ics, Monitor *mon); void ics_resend(ICSState *ics); +void ics_eoi(ICSState *ics, int irq); void icp_resend(ICPState *ss); typedef struct sPAPRMachineState sPAPRMachineState;