From patchwork Thu Apr 23 08:49:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 463912 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 57CA014012C for ; Thu, 23 Apr 2015 18:51:39 +1000 (AEST) Received: from localhost ([::1]:38949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlCrB-0007zQ-3n for incoming@patchwork.ozlabs.org; Thu, 23 Apr 2015 04:51:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlCpT-0005ex-2C for qemu-devel@nongnu.org; Thu, 23 Apr 2015 04:49:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlCpP-0001xC-JC for qemu-devel@nongnu.org; Thu, 23 Apr 2015 04:49:51 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:33135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlCpP-0001wq-Dh for qemu-devel@nongnu.org; Thu, 23 Apr 2015 04:49:47 -0400 Received: by wgin8 with SMTP id n8so10957856wgi.0 for ; Thu, 23 Apr 2015 01:49:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o0oQ71wNWn5Gv58qaISrphMHm72fxnXcEXcMwEhRrHs=; b=GbkG6MdyGFwP07TOepqSC1giTQe9veXodqVDhi81etiMu+Hmf/O/XGjt3pxFREVjt8 +MeYLuTQ+bOc8VjFVsuWYVQtuVXhriftWGAcQ121zbDZBgYNhd1zgIKFIC8Yol11lm1p f6t53BswS9BtlhRPG7kMzv99c0EG0fQt9VI9qWM/ZZ0jkbEOlloxtFDsKwaOafF8gEG+ UKs0ZubFsAQNi8cPOylR+xBpgpBRYV9LMG9lcMDc+PzPag3QrLRAOBhlhcTqBN+UYKqb WOXAP1d5UizWqLks3YlJjN6k5cqYyKfU/W7BENMsFjQjDn9OUVqfGyfSSOLCYptI0hKp Mvlg== X-Gm-Message-State: ALoCoQmwfLo0o109KPB3JQMAKAQpdGt/pJko1piqN8cqYKOBC5TTR9FJkJJk/54AHi1x1cn/stVy X-Received: by 10.180.7.169 with SMTP id k9mr13510011wia.70.1429778986808; Thu, 23 Apr 2015 01:49:46 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id k9sm28007649wia.6.2015.04.23.01.49.45 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Apr 2015 01:49:45 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, alex.williamson@redhat.com, peter.maydell@linaro.org, agraf@suse.de, pbonzini@redhat.com Date: Thu, 23 Apr 2015 09:49:37 +0100 Message-Id: <1429778977-1632-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1429778977-1632-1-git-send-email-eric.auger@linaro.org> References: <1429778977-1632-1-git-send-email-eric.auger@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.41 Cc: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, patches@linaro.org Subject: [Qemu-devel] [PATCH 2/2] intc: arm_gic_kvm: set the get_gsi callback 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 The arm_gic_kvm now sets the get_gsi_cb callback so that the global system interrupt of a qemu_irq can be retrieved. This enables VFIO platform signaling to be setup. Signed-off-by: Eric Auger --- hw/intc/arm_gic_kvm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index e1952ad..8a97a5b 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -87,6 +87,11 @@ static void kvm_arm_gic_set_irq(void *opaque, int irq, int level) kvm_set_irq(kvm_state, kvm_irq, !!level); } +static int kvm_gic_get_gsi(int pin) +{ + return pin; +} + static bool kvm_arm_gic_can_save_restore(GICState *s) { return s->dev_fd >= 0; @@ -554,6 +559,11 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp) */ i += (GIC_INTERNAL * s->num_cpu); qdev_init_gpio_in(dev, kvm_arm_gic_set_irq, i); + + for (i = 0; i < s->num_irq - GIC_INTERNAL; i++) { + qemu_irq irq = qdev_get_gpio_in(dev, i); + qemu_irq_set_get_gsi_cb(irq, kvm_gic_get_gsi); + } /* We never use our outbound IRQ lines but provide them so that * we maintain the same interface as the non-KVM GIC. */