From patchwork Fri Jun 26 15:30:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50363 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 6C00A228FD for ; Fri, 26 Jun 2015 15:30:54 +0000 (UTC) Received: by wguu7 with SMTP id u7sf28176890wgu.0 for ; Fri, 26 Jun 2015 08:30:53 -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=TAhv1AsHQOLb0vFYBSIm8HQFuhnCauJyFukYhW7cMRc=; b=howx0O6U3SJ29KfBxJzHFspgZvHat7hmL/GxPVKCCL7oiouqKpUSIEr3Wye//VBWWr gCd1g//tCxPvNUB93KLJ5Z2AiKbcrlQF3KvMYx9DQnaQKfulYV7xyx0+DcdY2rogeCZG aABdTUxgdcvvCcF7vMP6IAULYCnelRvq6L4VXWOzUyYPBbCuyn07KLOBSa2m0d2A6Q52 wy1+AVP/Vm9Gx8egjXwlirPJCvCGgysKGmUfLY0C1DsM0KCAL1j/c12QFmffqQmLRpwt VDzqd1/vf8ZI3F/iFri9oQZ4J2QXWYrRnrolrab+2BHzwoGF4bpn/SrrVY7D/Aftax89 C31A== X-Gm-Message-State: ALoCoQk9zDSLLW/T6azrNA/btj2zQNS2+RmEJR/nY32elyK+iig+fPjosQCI1VedWUz7mDwlJhaW X-Received: by 10.152.120.69 with SMTP id la5mr832554lab.7.1435332653666; Fri, 26 Jun 2015 08:30:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.65 with SMTP id r1ls533660lag.61.gmail; Fri, 26 Jun 2015 08:30:53 -0700 (PDT) X-Received: by 10.112.50.230 with SMTP id f6mr2101999lbo.17.1435332653522; Fri, 26 Jun 2015 08:30:53 -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 p1si27671663lag.52.2015.06.26.08.30.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 08:30:53 -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 lbbvz5 with SMTP id vz5so66722713lbb.0 for ; Fri, 26 Jun 2015 08:30:53 -0700 (PDT) X-Received: by 10.153.5.38 with SMTP id cj6mr2131896lad.36.1435332653287; Fri, 26 Jun 2015 08:30:53 -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 hn6csp4793lbb; Fri, 26 Jun 2015 08:30:52 -0700 (PDT) X-Received: by 10.194.246.105 with SMTP id xv9mr3946273wjc.135.1435332650230; Fri, 26 Jun 2015 08:30:50 -0700 (PDT) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com. [209.85.212.169]) by mx.google.com with ESMTPS id pa6si48642257wjb.84.2015.06.26.08.30.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 08:30:50 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.169 as permitted sender) client-ip=209.85.212.169; Received: by wicnd19 with SMTP id nd19so20669890wic.1 for ; Fri, 26 Jun 2015 08:30:50 -0700 (PDT) X-Received: by 10.180.89.66 with SMTP id bm2mr6115084wib.6.1435332649943; Fri, 26 Jun 2015 08:30:49 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id b5sm2688575wic.3.2015.06.26.08.30.48 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jun 2015 08:30:48 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, alex.williamson@redhat.com, pbonzini@redhat.com Cc: peter.crosthwaite@xilinx.com, christoffer.dall@linaro.org, patches@linaro.org Subject: [PATCH v17 3/6] intc: arm_gic_kvm: set the qemu_irq/gsi mapping Date: Fri, 26 Jun 2015 16:30:31 +0100 Message-Id: <1435332634-10721-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1435332634-10721-1-git-send-email-eric.auger@linaro.org> References: <1435332634-10721-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.181 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 Acked-by: Paolo Bonzini --- v16 -> v17: - add Paolo's A-b 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. */