From patchwork Thu Jan 15 13:05:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 43172 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 43F9020D60 for ; Thu, 15 Jan 2015 13:05:30 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id t10sf7299876eei.2 for ; Thu, 15 Jan 2015 05:05:29 -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=qqr+oBHMff3dekWZO8fvu+RGsMSekcD13Xp4p/CWKp8=; b=kMv4imwovbjpCv/+hAlx+fRPiWH+P+qP37ga4/dysSrT9b3ChZ4H3PD/Qw/zsX4A+Q NfAC2a45RSGiULAFNJpBxBt+zu4T5X2VsVuu98mjNSOQoCE0Dp/0a8ahp7icPL49McmI BcJowVJ/TicCFQsCZ/WPwwHjSaaEw24p/WlUWkhjANVn0Rvx2vSOBZWAoM+Rm2yzJqdp JfMigIy+iMDEKEUwAYzHsGoQfjBa7XedZ/JVMw918lhb/VyFhFOWDO7LWpggbtTr5bTk 9PARbPnKQOfNx4Pcsm/3VfqeRPtq1TvQLKGeiY72f0Zd5ZbGq4i5nJm0A7ZvA2+AWVKM vbzQ== X-Gm-Message-State: ALoCoQlGgjHfViQ+wGg7C2g2HVHbJeyR1hGe8zsUAg7JFiz83Nnzf8fb2KnxfhwN9iC6Pi5L2hx7 X-Received: by 10.112.114.162 with SMTP id jh2mr305609lbb.9.1421327129488; Thu, 15 Jan 2015 05:05:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.1 with SMTP id ku1ls238659lac.80.gmail; Thu, 15 Jan 2015 05:05:29 -0800 (PST) X-Received: by 10.152.20.98 with SMTP id m2mr9686221lae.49.1421327129352; Thu, 15 Jan 2015 05:05:29 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id yi9si1379443lab.58.2015.01.15.05.05.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 05:05:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id z11so13149446lbi.6 for ; Thu, 15 Jan 2015 05:05:28 -0800 (PST) X-Received: by 10.152.27.8 with SMTP id p8mr2715286lag.69.1421327128586; Thu, 15 Jan 2015 05:05:28 -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.9.200 with SMTP id c8csp2026669lbb; Thu, 15 Jan 2015 05:05:26 -0800 (PST) X-Received: by 10.180.38.66 with SMTP id e2mr18430920wik.55.1421327126352; Thu, 15 Jan 2015 05:05:26 -0800 (PST) Received: from mail-we0-f180.google.com (mail-we0-f180.google.com. [74.125.82.180]) by mx.google.com with ESMTPS id ea11si9313589wic.67.2015.01.15.05.05.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 05:05:26 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.180 as permitted sender) client-ip=74.125.82.180; Received: by mail-we0-f180.google.com with SMTP id w62so14550351wes.11 for ; Thu, 15 Jan 2015 05:05:26 -0800 (PST) X-Received: by 10.194.19.73 with SMTP id c9mr952135wje.124.1421327126008; Thu, 15 Jan 2015 05:05:26 -0800 (PST) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id w3sm2036665wjf.3.2015.01.15.05.05.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 05:05:25 -0800 (PST) From: Eric Auger To: eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, marc.zyngier@arm.com, peter.maydell@linaro.org, pbonzini@redhat.com, afaerber@suse.de Cc: eric.auger@linaro.org, kvmarm@lists.cs.columbia.edu, patches@linaro.org Subject: [RFC v2 2/2] hw/intc/arm_gic: Initialize the vgic in the realize function Date: Thu, 15 Jan 2015 13:05:11 +0000 Message-Id: <1421327111-1563-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1421327111-1563-1-git-send-email-eric.auger@linaro.org> References: <1421327111-1563-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.175 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. This earlier initialization allows, for example, to setup VFIO signaling and irqfd after vgic initialization, on a reset notifier. Signed-off-by: Eric Auger --- 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);