From patchwork Fri Apr 17 08:55:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 47260 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 64E802121F for ; Fri, 17 Apr 2015 09:01:23 +0000 (UTC) Received: by lamp14 with SMTP id p14sf23469373lam.3 for ; Fri, 17 Apr 2015 02:01:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=BW1qh1D1kd68NPY5G9FBllAHovb419Qw2VtXi2MG38M=; b=bym2SayWhjBak9U3iK8Hpp+SrTvweehau7PBNkpLR971a/9ajZMCu+fTz0ClDXPEb1 LYFx+0r6r/S/4cQwSxgXHgxnFTXdTYu9XL3SU9mBkJBiHgOQgy2lpO9fXvo5NIGHFvxm FUWXBvao9N9ytqIKbM4DTCof6tg0rIrVZv0yHcfkijLtj2MzY9M9hQgzkeJiJgZl7qJE QdGi+2JqepScn15NkCsJaeStZJRPuuRf2fVmNk6BBL1fP61u+O744AXnJ6a5p3gScXAc 0q26Rhx+Z0LbIG+o872SbtxDCOX+Wra6qRuRpLgJDPi8he0YW1K4XzAlz3yNkH3r5Z9B nhNg== X-Gm-Message-State: ALoCoQmacD/oZU7iVeYkEoLhUamCxqRQhEVqQihoLMZ+lMryXlpJO+sf/I3J0WFOetFl5u2Pe1AF X-Received: by 10.180.96.6 with SMTP id do6mr636020wib.4.1429261282138; Fri, 17 Apr 2015 02:01:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.162 with SMTP id l2ls13544lal.93.gmail; Fri, 17 Apr 2015 02:01:22 -0700 (PDT) X-Received: by 10.112.142.232 with SMTP id rz8mr1628835lbb.74.1429261281975; Fri, 17 Apr 2015 02:01:21 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id s2si8288412lbf.154.2015.04.17.02.01.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 02:01:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbuc2 with SMTP id uc2so77704103lbb.2 for ; Fri, 17 Apr 2015 02:01:21 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr1757597lbc.32.1429261281886; Fri, 17 Apr 2015 02:01:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp3605919lbt; Fri, 17 Apr 2015 02:01:21 -0700 (PDT) X-Received: by 10.140.201.4 with SMTP id w4mr1180696qha.11.1429261280643; Fri, 17 Apr 2015 02:01:20 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d93si652qgf.92.2015.04.17.02.01.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Apr 2015 02:01:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:40286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj29H-00043Z-HC for patch@linaro.org; Fri, 17 Apr 2015 05:01:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj247-0002gj-RD for qemu-devel@nongnu.org; Fri, 17 Apr 2015 04:56:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj244-0006vC-Vw for qemu-devel@nongnu.org; Fri, 17 Apr 2015 04:55:59 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:34352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj244-0006v2-RC for qemu-devel@nongnu.org; Fri, 17 Apr 2015 04:55:56 -0400 Received: by pdbqa5 with SMTP id qa5so121756224pdb.1 for ; Fri, 17 Apr 2015 01:55:56 -0700 (PDT) X-Received: by 10.68.192.74 with SMTP id he10mr3723819pbc.30.1429260956280; Fri, 17 Apr 2015 01:55:56 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id za6sm9463127pac.48.2015.04.17.01.55.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Apr 2015 01:55:55 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Fri, 17 Apr 2015 14:25:11 +0530 Message-Id: <1429260911-24021-3-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1429260911-24021-1-git-send-email-pranavkumar@linaro.org> References: <1429260911-24021-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.172 Cc: peter.maydell@linaro.org, patches@apm.com, agraf@suse.de, Tushar Jagad , pbonzini@redhat.com, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [PATCH 2/2] pci: GPEX: Add support to route legacy interrupts 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch adds routine to route legacy interrupts to VM. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Tushar Jagad --- hw/pci-host/gpex.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c index 9d8fb5a..35842e4 100644 --- a/hw/pci-host/gpex.c +++ b/hw/pci-host/gpex.c @@ -42,6 +42,17 @@ static void gpex_set_irq(void *opaque, int irq_num, int level) qemu_set_irq(s->irq[irq_num], level); } +static PCIINTxRoute gpex_route_intx_pin_to_irq(void *opaque, int pin) +{ + PCIINTxRoute route; + GPEXHost *s = opaque; + + route.mode = PCI_INTX_ENABLED; + route.irq = qemu_get_irq_num(s->irq[pin]); + + return route; +} + static void gpex_host_realize(DeviceState *dev, Error **errp) { PCIHostState *pci = PCI_HOST_BRIDGE(dev); @@ -66,6 +77,7 @@ static void gpex_host_realize(DeviceState *dev, Error **errp) &s->io_ioport, 0, 4, TYPE_PCIE_BUS); qdev_set_parent_bus(DEVICE(&s->gpex_root), BUS(pci->bus)); + pci_bus_set_route_irq_fn(pci->bus, gpex_route_intx_pin_to_irq); qdev_init_nofail(DEVICE(&s->gpex_root)); }