From patchwork Thu Jun 14 04:36:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 164802 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D2F49B702D for ; Thu, 14 Jun 2012 14:36:59 +1000 (EST) Received: from localhost ([::1]:45393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf1nl-0006J7-PF for incoming@patchwork.ozlabs.org; Thu, 14 Jun 2012 00:36:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf1ne-0006If-9r for qemu-devel@nongnu.org; Thu, 14 Jun 2012 00:36:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sf1nc-0000zO-DY for qemu-devel@nongnu.org; Thu, 14 Jun 2012 00:36:49 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:51758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf1nc-0000z4-7V for qemu-devel@nongnu.org; Thu, 14 Jun 2012 00:36:48 -0400 Received: by pbbro12 with SMTP id ro12so3363202pbb.4 for ; Wed, 13 Jun 2012 21:36:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=MoKKKD+7sOxi2Dw7ZYd07IsIKD+G0sVqJAfI4DIy3oI=; b=NENOp+zRai1SNm8COd7jo9sDGLl1AfNWxLKksKl7s9sz75xjhj0WKB78HYY1CgcbIS BuOVYhiLkZHo5yxybkooQ/nX+3inz9XTV5FD5CvCKOyM24Sy9Ww+zF+J5lmL1rl9wJdD /VAFhFSPVHex0lp4cpAx0rqmk3qyZk6hwMb+wwGw5FCbHOOe3UzpT1DPmPC9D7rvykQ4 W/LvaNoNd9JUlL1dU421fxGYYQDJ3agPD2WXcCndi5zsXDhy1EUeVn+0+7JtdL56Ou7q P3t9dCWQxSULPN9xxPsb2QZsvjqy7VuN9aLtRcKtTV5lreIyS5MuX9nqqCYUGckQ86DX Gm2Q== Received: by 10.68.219.41 with SMTP id pl9mr3568500pbc.61.1339648605980; Wed, 13 Jun 2012 21:36:45 -0700 (PDT) Received: from [10.61.2.175] (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPS id kt1sm8116230pbc.32.2012.06.13.21.36.44 (version=SSLv3 cipher=OTHER); Wed, 13 Jun 2012 21:36:45 -0700 (PDT) Message-ID: <4FD96A5A.5050605@ozlabs.ru> Date: Thu, 14 Jun 2012 14:36:42 +1000 From: Alexey Kardashevskiy User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: kvm-ppc@vger.kernel.org, "qemu-devel@nongnu.org" , Benjamin Herrenschmidt X-Gm-Message-State: ALoCoQm+i/irgQa0hK6arGTfcDAG0UWM/0PJ15Y0rbeWjHYAVqzVrJ5YC1u/61k7iYlLRYVTvap7 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Subject: [Qemu-devel] [PATCH] pseries pci: removed dt_irq from PCI host bus X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As it is a very quick operation to resolve qirq from IRQ number, it makes no sense to cache it anywhere but its original source i.e. XICS. Signed-off-by: Alexey Kardashevskiy --- hw/spapr_pci.c | 14 +++++--------- hw/spapr_pci.h | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c index 269dbbf..93017cd 100644 --- a/hw/spapr_pci.c +++ b/hw/spapr_pci.c @@ -162,7 +162,9 @@ static void pci_spapr_set_irq(void *opaque, int irq_num, int level) */ sPAPRPHBState *phb = opaque; - qemu_set_irq(phb->lsi_table[irq_num].qirq, level); + qemu_set_irq(xics_assign_irq(spapr->icp, + phb->lsi_table[irq_num].dt_irq, XICS_LSI), + level); } static uint64_t spapr_io_read(void *opaque, target_phys_addr_t addr, @@ -268,16 +270,10 @@ static int spapr_phb_init(SysBusDevice *s) /* Initialize the LSI table */ for (i = 0; i < PCI_NUM_PINS; i++) { - qemu_irq qirq; - uint32_t num; - - qirq = spapr_allocate_lsi(0, &num); - if (!qirq) { + if (!spapr_allocate_lsi(0, &phb->lsi_table[i].dt_irq)) { + fprintf(stderr, "Failed to allocate LSI IRQ pin %u\n", i); return -1; } - - phb->lsi_table[i].dt_irq = num; - phb->lsi_table[i].qirq = qirq; } return 0; diff --git a/hw/spapr_pci.h b/hw/spapr_pci.h index dd66f4b..11c3ee1 100644 --- a/hw/spapr_pci.h +++ b/hw/spapr_pci.h @@ -41,7 +41,6 @@ typedef struct sPAPRPHBState { struct { uint32_t dt_irq; - qemu_irq qirq; } lsi_table[PCI_NUM_PINS]; QLIST_ENTRY(sPAPRPHBState) list;