qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@linaro.org>
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: peter.maydell@linaro.org, alex.williamson@redhat.com,
	patches@linaro.org, kvmarm@lists.cs.columbia.edu,
	eric.auger@linaro.org
Subject: [Qemu-devel] [PATCH v4 3/3] hw/intc/arm_gic: Initialize the vgic in the realize function
Date: Wed,  4 Mar 2015 14:16:17 +0000	[thread overview]
Message-ID: <1425478577-32556-4-git-send-email-eric.auger@linaro.org> (raw)
In-Reply-To: <1425478577-32556-1-git-send-email-eric.auger@linaro.org>

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 <eric.auger@linaro.org>
---
 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);
-- 
1.8.3.2

  parent reply	other threads:[~2015-03-04 14:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 14:16 [Qemu-devel] [PATCH v4 0/3] explicit VGIC initialization in finalize function Eric Auger
2015-03-04 14:16 ` [Qemu-devel] [PATCH v4 1/3] update-linux-headers.sh: export virtio_types.h Eric Auger
2015-03-04 15:37   ` Michael S. Tsirkin
2015-03-04 15:40     ` Eric Auger
2015-03-09  9:26     ` Christian Borntraeger
2015-03-04 14:16 ` [Qemu-devel] [PATCH v4 2/3] linux-headers: update to 4.0-rc2 Eric Auger
2015-03-04 14:16 ` Eric Auger [this message]
2015-03-11 14:56   ` [Qemu-devel] [PATCH v4 3/3] hw/intc/arm_gic: Initialize the vgic in the realize function Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425478577-32556-4-git-send-email-eric.auger@linaro.org \
    --to=eric.auger@linaro.org \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=b.reynal@virtualopensystems.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@st.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=mst@redhat.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).