From patchwork Mon Jul 6 18:35:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 50775 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B9A17218EA for ; Mon, 6 Jul 2015 18:36:55 +0000 (UTC) Received: by wipp2 with SMTP id p2sf34704388wip.2 for ; Mon, 06 Jul 2015 11:36:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding: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=644mUOY6rqlxPUtEf0jyyr8uCBpJy42iXfJhRDcILXs=; b=aw256DTPHieLX83Ly0nu75f0z4ua1Yi3iuKn7b+jl8rTKe+lFBgfqSoLjDD/edkJjM TH4F0rbgo1uq+epj7T47ZZEnxgcpRsOSZ3Ha/kNjkiJTg3yS4yppLtF9I/nZUT4cxtvr U7/GqSwLC8iejr7PoenwOvlqE+2jSymhr9zAu2+t4IJBTvIrO1PWuR+zlEKgHLTFby+h cWHmAlfogl/CE54SLwBHhpFgfc1+sDBA0LMAXh/iWMSlvYKETqTvgtr5q87uCfu36oF4 Q1gzwsIhpqV0+xgUW/ZQWfSUwIfMst5B0hDHsBmVMpLZ+ZWHRcN8S2RNQbSTpP8JW1LC 557A== X-Gm-Message-State: ALoCoQkiVEYHPbkQl+N9LyFVAl88zoi7KiiNGbVGKacljayX2HYsp+V8VWvsWm9XjgAKU5bqGOdl X-Received: by 10.152.37.101 with SMTP id x5mr117704laj.5.1436207815050; Mon, 06 Jul 2015 11:36:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.67 with SMTP id q3ls654062laq.78.gmail; Mon, 06 Jul 2015 11:36:54 -0700 (PDT) X-Received: by 10.112.142.232 with SMTP id rz8mr243588lbb.74.1436207814715; Mon, 06 Jul 2015 11:36:54 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id lo2si15935419lbb.57.2015.07.06.11.36.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 11:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labgy5 with SMTP id gy5so13941171lab.2 for ; Mon, 06 Jul 2015 11:36:54 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr211644lbc.41.1436207814571; Mon, 06 Jul 2015 11:36:54 -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.108.230 with SMTP id hn6csp1896119lbb; Mon, 6 Jul 2015 11:36:53 -0700 (PDT) X-Received: by 10.68.181.163 with SMTP id dx3mr447785pbc.5.1436207811955; Mon, 06 Jul 2015 11:36:51 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id to4si30369956pab.40.2015.07.06.11.36.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 06 Jul 2015 11:36:51 -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]:52432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCBG6-0005o9-0d for patch@linaro.org; Mon, 06 Jul 2015 14:36:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCBEh-0004Jz-R8 for qemu-devel@nongnu.org; Mon, 06 Jul 2015 14:35:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCBEc-0003AM-Vd for qemu-devel@nongnu.org; Mon, 06 Jul 2015 14:35:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCBEc-0003AE-Q5 for qemu-devel@nongnu.org; Mon, 06 Jul 2015 14:35:18 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 6F5FC91596 for ; Mon, 6 Jul 2015 18:35:18 +0000 (UTC) Received: from gimli.home (ovpn-113-190.phx2.redhat.com [10.3.113.190]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t66IZHUx004416; Mon, 6 Jul 2015 14:35:18 -0400 From: Alex Williamson To: qemu-devel@nongnu.org Date: Mon, 06 Jul 2015 12:35:17 -0600 Message-ID: <20150706183517.15635.72316.stgit@gimli.home> In-Reply-To: <20150706183311.15635.76314.stgit@gimli.home> References: <20150706183311.15635.76314.stgit@gimli.home> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/11] sysbus: add irq_routing_notifier 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: alex.williamson@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 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 From: Eric Auger Add a new connect_irq_notifier notifier in the SysBusDeviceClass. This notifier, if populated, is called after sysbus_connect_irq. This mechanism is used to setup VFIO signaling once VFIO platform devices get attached to their platform bus, on a machine init done notifier. Signed-off-by: Eric Auger Reviewed-by: Peter Crosthwaite Tested-by: Vikram Sethi Reviewed-by: Peter Maydell Signed-off-by: Alex Williamson --- hw/core/sysbus.c | 6 ++++++ include/hw/sysbus.h | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 278a2d1..3c58629 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -109,7 +109,13 @@ qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n) void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq) { + SysBusDeviceClass *sbd = SYS_BUS_DEVICE_GET_CLASS(dev); + qdev_connect_gpio_out_named(DEVICE(dev), SYSBUS_DEVICE_GPIO_IRQ, n, irq); + + if (sbd->connect_irq_notifier) { + sbd->connect_irq_notifier(dev, irq); + } } /* Check whether an MMIO region exists */ diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 34f93c3..cc1dba4 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -58,6 +58,7 @@ typedef struct SysBusDeviceClass { * omitted then. (This is not considered a fatal error.) */ char *(*explicit_ofw_unit_address)(const SysBusDevice *dev); + void (*connect_irq_notifier)(SysBusDevice *dev, qemu_irq irq); } SysBusDeviceClass; struct SysBusDevice {