From patchwork Thu Sep 14 17:52:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 112593 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1049121qgf; Thu, 14 Sep 2017 10:55:56 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDKZfMCPq3aut7heMQbf6qAQdVanFsud1PhlnHYoMue21Yu+gGARUIDk2/2YLASfeC+5tkr X-Received: by 10.55.188.131 with SMTP id m125mr3384814qkf.12.1505411756863; Thu, 14 Sep 2017 10:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505411756; cv=none; d=google.com; s=arc-20160816; b=ZdC3eiDQjW2gbwjhjS5EASmXK6di4iDuPia7a2heG6O2ehgBHyoFsAfB6ZDBvivls+ Ctf13ndvGqmq5wgBehDgJvoruuSPWHtbPmXRphYar0M+a7Or6whYt7kPhaiJ/Pnvc484 4rpDW9O+fEfPXConOn6UIZOAACho3I29TYKHCcrk43Tg2sN8Hyx+I7uwnTb03d3MADRb ysQXTpg5PI17c5AoXBcACrk6u9t8Mg7rFWdm72j0oT9BFUssO6uFNJAurbBFKXU/1FqA 3ZU7mqRk3kCc23hEiFYMce6f90dPL5t9vZyw2AWcBaF6/8zBz5mIwXHpTkbOqJCYB5mH D63g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=OU+aO2myF8dmTLB0SCs3ZTMYc8XnxP/TP3k22Oan6Ig=; b=eJnu//YnZgoE3wF4Z2KgEt5XAnpZzUDYM9WuwH0xQJ04tdeE8CUA75vBvBAggwEyc0 5E3e/MKkTkDmPBllGhi763IehB+dZDGuHsRwdxJR/S7lrYfjH93XJ/RbO/TMVXrmEv2o UntgGsQbKMAdXKDyuLQAkWz8pf7WXckhJJMqooIlgeBs8n4RADPwPlKsbzIiBi5/2CER Cq8KKNrO7qkCxw+HYv4QU+A0yba03hzXHO0nRjiUcSOIcV2cojGFT9W1DVNTerkN9xrg +3LmXDU1nYLuKwgOBUdyl+kBLAxRyieIzaHLVN0CzRa9rhv6UTbeGJOe9x+3eEsxE9Cw kSJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n70si17985654qkl.107.2017.09.14.10.55.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 14 Sep 2017 10:55:56 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsYMk-0002fi-OU for patch@linaro.org; Thu, 14 Sep 2017 13:55:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsYJY-00084s-W0 for qemu-devel@nongnu.org; Thu, 14 Sep 2017 13:52:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsYJY-0007xK-35 for qemu-devel@nongnu.org; Thu, 14 Sep 2017 13:52:37 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37366) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dsYJX-0007vb-Sc for qemu-devel@nongnu.org; Thu, 14 Sep 2017 13:52:36 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1dsYJW-0005tE-JJ for qemu-devel@nongnu.org; Thu, 14 Sep 2017 18:52:34 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 14 Sep 2017 18:52:50 +0100 Message-Id: <1505411573-27848-16-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505411573-27848-1-git-send-email-peter.maydell@linaro.org> References: <1505411573-27848-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 15/18] hw/pci-host/gpex: Set INTx index/gsi mapping 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Pranavkumar Sawargaonkar To implement INTx to gsi routing we need to pass the gpex host bridge the gsi associated to each INTx index. Let's introduce irq_num array and gpex_set_irq_num setter function. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Tushar Jagad Signed-off-by: Eric Auger Tested-by: Feng Kan Reviewed-by: Andrew Jones Message-id: 1505296004-6798-2-git-send-email-eric.auger@redhat.com Signed-off-by: Peter Maydell --- include/hw/pci-host/gpex.h | 3 +++ hw/pci-host/gpex.c | 10 ++++++++++ 2 files changed, 13 insertions(+) -- 2.7.4 diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index 68c9348..aef38b8 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -51,6 +51,9 @@ typedef struct GPEXHost { MemoryRegion io_ioport; MemoryRegion io_mmio; qemu_irq irq[GPEX_NUM_IRQS]; + int irq_num[GPEX_NUM_IRQS]; } GPEXHost; +int gpex_set_irq_num(GPEXHost *s, int index, int gsi); + #endif /* HW_GPEX_H */ diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c index 83084b9..41a884d 100644 --- a/hw/pci-host/gpex.c +++ b/hw/pci-host/gpex.c @@ -43,6 +43,16 @@ static void gpex_set_irq(void *opaque, int irq_num, int level) qemu_set_irq(s->irq[irq_num], level); } +int gpex_set_irq_num(GPEXHost *s, int index, int gsi) +{ + if (index >= GPEX_NUM_IRQS) { + return -EINVAL; + } + + s->irq_num[index] = gsi; + return 0; +} + static void gpex_host_realize(DeviceState *dev, Error **errp) { PCIHostState *pci = PCI_HOST_BRIDGE(dev);