From patchwork Fri Jun 26 17:29:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50369 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BA0BC22902 for ; Fri, 26 Jun 2015 17:29:44 +0000 (UTC) Received: by laar3 with SMTP id r3sf28569188laa.1 for ; Fri, 26 Jun 2015 10:29:43 -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=kl3hZVPY85MFXz7Gr6vL8KsH4da1A2sl4udWoxEcuEU0BqyrORa3xug24/OUdlNwnL Z9TYqwEe2N5vgtK5pwNV5R/YaVEo94hIPbcifzrag3FzN5KDN7VccPb5/1esAb5JGGYh xtHfsW3/+jC9iQeJPYH+Vs6LrH2f/+jVPmQHc2YQG1piTQ6OxyldMZLy3iw0sL1wvcDF xSk1zqklPctbFrJEUKS9Fqi7Vstd4j09eSMsxqsOzQlVGoVcCteo4l0y4zQ4oH4p5xUB TGTQTT0C4JkZ7yOieWI/CRwhdWg/Ct0aJN887HeEfDAIevnAq1fDefovbbDSHaPWFT9m 0KAg== X-Gm-Message-State: ALoCoQnoOan6lkTCB8ANs8K7U8gRVI2vtMyeahaxbhjNi7I9o4P2BlnhTG6fNtXoODTu9Giw8KgY X-Received: by 10.112.53.102 with SMTP id a6mr1830843lbp.16.1435339783810; Fri, 26 Jun 2015 10:29:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.98 with SMTP id i2ls552407laa.50.gmail; Fri, 26 Jun 2015 10:29:43 -0700 (PDT) X-Received: by 10.152.30.34 with SMTP id p2mr2534950lah.89.1435339783414; Fri, 26 Jun 2015 10:29:43 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id l6si27926204lbd.114.2015.06.26.10.29.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 10:29:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbvz5 with SMTP id vz5so68608662lbb.0 for ; Fri, 26 Jun 2015 10:29:43 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr2582077lbc.86.1435339782872; Fri, 26 Jun 2015 10:29:42 -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 hn6csp69976lbb; Fri, 26 Jun 2015 10:29:42 -0700 (PDT) X-Received: by 10.180.211.196 with SMTP id ne4mr6864028wic.23.1435339780614; Fri, 26 Jun 2015 10:29:40 -0700 (PDT) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com. [209.85.212.181]) by mx.google.com with ESMTPS id i15si4026432wiv.82.2015.06.26.10.29.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 10:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.181 as permitted sender) client-ip=209.85.212.181; Received: by wiga1 with SMTP id a1so23337171wig.0 for ; Fri, 26 Jun 2015 10:29:40 -0700 (PDT) X-Received: by 10.180.189.209 with SMTP id gk17mr6718820wic.93.1435339780296; Fri, 26 Jun 2015 10:29:40 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id m10sm3088489wib.17.2015.06.26.10.29.38 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jun 2015 10:29:39 -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 v18 3/6] intc: arm_gic_kvm: set the qemu_irq/gsi mapping Date: Fri, 26 Jun 2015 18:29:24 +0100 Message-Id: <1435339767-2301-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1435339767-2301-1-git-send-email-eric.auger@linaro.org> References: <1435339767-2301-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.172 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 Reviewed-by: Peter Maydell --- 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. */