From patchwork Wed Mar 4 14:16:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 45416 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A54E421486 for ; Wed, 4 Mar 2015 14:16:59 +0000 (UTC) Received: by lbvp9 with SMTP id p9sf7041738lbv.0 for ; Wed, 04 Mar 2015 06:16:58 -0800 (PST) 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=GoWZGvEUa8X+QTsmJyJsALh2m5VmH8ATfsR9fYsPHe4=; b=KcEGdExhJgSdUa9yHssEa3pNWWyc4rfqo8o1gS+XsgYR/uA4w0GI3G2qyT27bKhpV8 zukIHHLaKrxn2UpYKLEpp2NofJPAKejLRjyGWtpkhS4XMQt1JSOy6er1mYstiiayZIUL nNELA9FLiIa56Eo4iKjjggG4ny9gT+waizXjN39vKcDWjAIbS7l132jhqodXu7vqyBmR uej1jPyLvmI0ViY+vWSY9wurcrycYH5B35VHZLqXDRfvOYXlxuM7nPw1FJ30ZZ+JgdYZ sc4+01oZ76Y53kW7aX7ikudqL4XzAJqFYbYoedcBpo1rthdWRwOsfxhcp3ECgwXwXSnU 6YEw== X-Gm-Message-State: ALoCoQl4cWHMp4xO1Wfa2pzaiVgGvJIN/gmxdYPkUlym/WqxSXgWwo5ZRiS+lg2KO4MsXcLbBWIf X-Received: by 10.112.199.69 with SMTP id ji5mr709140lbc.0.1425478618596; Wed, 04 Mar 2015 06:16:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.163 with SMTP id x3ls95118lad.56.gmail; Wed, 04 Mar 2015 06:16:58 -0800 (PST) X-Received: by 10.152.180.202 with SMTP id dq10mr3505992lac.74.1425478618459; Wed, 04 Mar 2015 06:16:58 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id qs6si2620262lbb.49.2015.03.04.06.16.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 06:16:58 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbvn10 with SMTP id n10so44496174lbv.6 for ; Wed, 04 Mar 2015 06:16:58 -0800 (PST) X-Received: by 10.152.1.135 with SMTP id 7mr3505227lam.41.1425478618333; Wed, 04 Mar 2015 06:16:58 -0800 (PST) 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.35.133 with SMTP id h5csp1247053lbj; Wed, 4 Mar 2015 06:16:57 -0800 (PST) X-Received: by 10.194.210.103 with SMTP id mt7mr8383917wjc.103.1425478617565; Wed, 04 Mar 2015 06:16:57 -0800 (PST) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com. [74.125.82.46]) by mx.google.com with ESMTPS id r5si8592650wix.76.2015.03.04.06.16.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 06:16:57 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.46 as permitted sender) client-ip=74.125.82.46; Received: by wghk14 with SMTP id k14so3109391wgh.7 for ; Wed, 04 Mar 2015 06:16:57 -0800 (PST) X-Received: by 10.180.19.9 with SMTP id a9mr13108573wie.85.1425478617190; Wed, 04 Mar 2015 06:16:57 -0800 (PST) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id dq1sm4095310wib.20.2015.03.04.06.16.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 06:16:56 -0800 (PST) From: Eric Auger To: eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, agraf@suse.de, pbonzini@redhat.com, mst@redhat.com, b.reynal@virtualopensystems.com Cc: eric.auger@linaro.org, kvmarm@lists.cs.columbia.edu, patches@linaro.org, alex.williamson@redhat.com, peter.maydell@linaro.org Subject: [PATCH v4 3/3] hw/intc/arm_gic: Initialize the vgic in the realize function Date: Wed, 4 Mar 2015 14:16:17 +0000 Message-Id: <1425478577-32556-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1425478577-32556-1-git-send-email-eric.auger@linaro.org> References: <1425478577-32556-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.173 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: , This patch forces vgic initialization in the vgic realize function. It uses a new group/attribute that allows such operation: KVM_DEV_ARM_VGIC_GRP_CTRL/KVM_DEV_ARM_VGIC_CTRL_INIT This earlier initialization allows, for example, to setup VFIO signaling and irqfd after vgic initialization, on a reset notifier. Signed-off-by: Eric Auger Reviewed-by: Peter Maydell --- 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 1ad3eb0..1395c9e 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -573,6 +573,12 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp) kvm_gic_access(s, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, 0, 0, &numirqs, 1); } + if (kvm_gic_supports_attr(s, KVM_DEV_ARM_VGIC_GRP_CTRL, + KVM_DEV_ARM_VGIC_CTRL_INIT)) { + kvm_gic_access(s, KVM_DEV_ARM_VGIC_GRP_CTRL, + KVM_DEV_ARM_VGIC_CTRL_INIT, 0, 0, 1); + } + /* Distributor */ memory_region_init_reservation(&s->iomem, OBJECT(s), "kvm-gic_dist", 0x1000);