From patchwork Mon Jul 7 12:27:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 33153 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B25120C88 for ; Mon, 7 Jul 2014 12:31:09 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id lx4sf14852224iec.5 for ; Mon, 07 Jul 2014 05:31:09 -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=oC4LcZRbvrk3TflfD4BZOShfvmL0eyU+M9ow9kb8bZI=; b=hsNu6tsXjLGcZAqOktRB7KkW13VJfxcXgPjxEmzb/czLf5aJuctJfjuiZy9Bbl01Z5 44ycL+dCgg8NhiNdFg+zkqvGya1fAshDY3OnfW47IcuYJ91ctZHvCJERkC8r3cRKTN4R Cu8vHOlFg3uStJwebt/MlhdXc4cWM8hzjl5kvLgjEY5zwNaj+Pwtzyowo7+lR8vj1mxR dYbd8yXK7gvrVa7dd5SzMj1Rc2kIPpH4bFa9w+p728/npanoM/uGm34Tu9+q9bLuU1By Oe5CN7pm5atiXLKlaRVA12csxpx0rLEbt+uxzFaPxuDP+zdGQ6M+XYHjaboNf/9GvU5A /KFQ== X-Gm-Message-State: ALoCoQlRGlRYogz9LbqaNL2lO3Zl3wPF9UD8JlQfGB+THIG+ZmAU5PntqNyKACzEiw2StX2Jj6iU X-Received: by 10.43.103.136 with SMTP id di8mr13904003icc.14.1404736268957; Mon, 07 Jul 2014 05:31:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.132 with SMTP id o4ls724434qga.40.gmail; Mon, 07 Jul 2014 05:31:08 -0700 (PDT) X-Received: by 10.221.49.200 with SMTP id vb8mr27549044vcb.17.1404736268885; Mon, 07 Jul 2014 05:31:08 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id q9si18745662vey.41.2014.07.07.05.31.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 05:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so4047822veb.27 for ; Mon, 07 Jul 2014 05:31:08 -0700 (PDT) X-Received: by 10.221.69.8 with SMTP id ya8mr1022431vcb.39.1404736268821; Mon, 07 Jul 2014 05:31:08 -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.221.37.5 with SMTP id tc5csp662469vcb; Mon, 7 Jul 2014 05:31:08 -0700 (PDT) X-Received: by 10.180.76.134 with SMTP id k6mr46975188wiw.49.1404736267703; Mon, 07 Jul 2014 05:31:07 -0700 (PDT) Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by mx.google.com with ESMTPS id ja10si40960441wic.105.2014.07.07.05.31.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 05:31:07 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.175 as permitted sender) client-ip=74.125.82.175; Received: by mail-we0-f175.google.com with SMTP id k48so4267470wev.20 for ; Mon, 07 Jul 2014 05:31:07 -0700 (PDT) X-Received: by 10.180.83.105 with SMTP id p9mr75112549wiy.8.1404736266922; Mon, 07 Jul 2014 05:31:06 -0700 (PDT) Received: from midway01-04-00.lavalab ([88.98.47.97]) by mx.google.com with ESMTPSA id ec8sm95805182wic.10.2014.07.07.05.31.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 05:31:06 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, kim.phillips@freescale.com, a.rigo@virtualopensystems.com Cc: eric.auger@linaro.org, will.deacon@arm.com, kvmarm@lists.cs.columbia.edu, alex.williamson@redhat.com, Bharat.Bhushan@freescale.com, agraf@suse.de, peter.maydell@linaro.org, stuart.yoder@freescale.com, a.motakis@virtualopensystems.com, patches@linaro.org Subject: [RFC v4 10/13] hw/intc/arm_gic_kvm: enable irqfd and set routing table Date: Mon, 7 Jul 2014 13:27:20 +0100 Message-Id: <1404736043-22900-11-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1404736043-22900-1-git-send-email-eric.auger@linaro.org> References: <1404736043-22900-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.128.182 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: , Makes possible to use KVM irqfd. An identity GSI routing table is defined so that virtual IRQ injection can happen. Signed-off-by: Eric Auger --- hw/intc/arm_gic_kvm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index 5038885..29b9236 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -576,6 +576,17 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp) KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_VGIC_V2_ADDR_TYPE_CPU, s->dev_fd); + + /* set up irq routing */ + kvm_init_irq_routing(kvm_state); + for (i = 0; i < s->num_irq - GIC_INTERNAL; ++i) { + kvm_irqchip_add_irq_route(kvm_state, i, 0, i); + } + + kvm_irqfds_allowed = true; + kvm_gsi_routing_allowed = true; + + kvm_irqchip_commit_routes(kvm_state); } static void kvm_arm_gic_class_init(ObjectClass *klass, void *data)