From patchwork Wed May 27 09:11:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 49007 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1D70214B4 for ; Wed, 27 May 2015 09:11:45 +0000 (UTC) Received: by wgez8 with SMTP id z8sf1093984wge.2 for ; Wed, 27 May 2015 02:11:45 -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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=0STn2DTgDSORrMJjYXgSCdotpTQ+uvZEDD6L7Yu/p6Q=; b=ORms+obuxfYiRuT8rb5DanmTp20TDSWFtGiRzTKojm/NZ5Qtnt60+dzfsKpbofuRX4 BjMiVMoFiA+yI6LCgItgj8nizmZj86cln+H4LmsgtvnjbCvXiKLq5A+/jPhD+NbJg+UU KO+4fO+9zecTlFpIr2uRHjvBPRrWwyA3VMrokr7q8yrm1jvzP+NEINfxzjJravFenhju oqWm9LrGrWt4kiJ1psnoa+uDzsP92LpUaB0FOy9gXJ/5DZRpKatl+3AzXH4EhYn6AcZX 7VsD1WjAQWfauN1iDKChAhcAHa8YaYn/fSVQXatn2OycRTevxrvkbS7KPymF3JwavJo7 Ro5A== X-Gm-Message-State: ALoCoQlRuibzAfTM7XSjHBwpmSBGlS8NyZ6kKeepwMHU7pKsPU82Hvyzg2C/LKpyDRf5dAvIxhr5 X-Received: by 10.152.26.134 with SMTP id l6mr31354451lag.10.1432717905093; Wed, 27 May 2015 02:11:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.227 with SMTP id lf3ls15756lab.93.gmail; Wed, 27 May 2015 02:11:44 -0700 (PDT) X-Received: by 10.152.5.98 with SMTP id r2mr13369663lar.8.1432717904935; Wed, 27 May 2015 02:11:44 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id l7si13160780lae.121.2015.05.27.02.11.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 02:11:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbqq2 with SMTP id qq2so2721405lbb.3 for ; Wed, 27 May 2015 02:11:44 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr22291250lbb.112.1432717904588; Wed, 27 May 2015 02:11:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp206211lbb; Wed, 27 May 2015 02:11:44 -0700 (PDT) X-Received: by 10.194.47.231 with SMTP id g7mr55671791wjn.140.1432717895288; Wed, 27 May 2015 02:11:35 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com. [209.85.212.172]) by mx.google.com with ESMTPS id d7si22771788wij.93.2015.05.27.02.11.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 02:11:35 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.172 as permitted sender) client-ip=209.85.212.172; Received: by wicmc15 with SMTP id mc15so87379584wic.1 for ; Wed, 27 May 2015 02:11:35 -0700 (PDT) X-Received: by 10.180.219.42 with SMTP id pl10mr4039935wic.70.1432717895042; Wed, 27 May 2015 02:11:35 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id ej5sm25828061wjd.22.2015.05.27.02.11.33 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 May 2015 02:11:33 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, alex.williamson@redhat.com Cc: christoffer.dall@linaro.org, kvmarm@lists.cs.columbia.edu, patches@linaro.org, peter.maydell@linaro.org, agraf@suse.de, pbonzini@redhat.com, b.reynal@virtualopensystems.com, vikrams@codeaurora.org Subject: [PATCH v16 7/9] intc: arm_gic_kvm: set the qemu_irq/gsi mapping Date: Wed, 27 May 2015 10:11:09 +0100 Message-Id: <1432717871-2393-8-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1432717871-2393-1-git-send-email-eric.auger@linaro.org> References: <1432717871-2393-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@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.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The arm_gic_kvm now calls kvm_irqchip_set_qemuirq_gsi to build the hash table storing qemu_irq/gsi mappings. From that point on irqfd can be setup directly from the qemu_irq using kvm_irqchip_add_irqfd_notifier. Signed-off-by: Eric Auger Tested-by: Vikram Sethi --- v15 -> v16: - added Vikram's T-b - Resolve rebase conflict v2 -> v3: - kvm_irqchip_add_qemuirq_irqfd_notifier renamed into kvm_irqchip_add_irqfd_notifier --- hw/intc/arm_gic_kvm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index 2cb7d25..f56bff1 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -570,6 +570,12 @@ 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); + kvm_irqchip_set_qemuirq_gsi(kvm_state, irq, i); + } + /* We never use our outbound IRQ/FIQ lines but provide them so that * we maintain the same interface as the non-KVM GIC. */