From patchwork Fri Feb 13 03:37:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 44645 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8F47E21527 for ; Fri, 13 Feb 2015 03:37:39 +0000 (UTC) Received: by labge10 with SMTP id ge10sf8843216lab.3 for ; Thu, 12 Feb 2015 19:37:37 -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=MWeQbPSL7POFBsKrk49ymeuNOeuAoiUrA9DD1MsM4ot/us6RJTQ3ApuO7P9+Tb8vHW YdzM2//rp9Y6/GKcWhbntao7AyZqruj61UWvrQXA4NfJe5c5lBkUJHB7kJ40JBYNZSLk LGY8l+TkC+/B0b8Lw4hIqbsHsql2fWjXPul66P6nk/qfZwC0IhmG89U3AY3UWuWW4bKG OfC1GKVyZMYYLRd0K6iRuiKnjIYFyX33OcAGTtZEijOHLfGHn9RY5Y5vdYs9ImrQ0ZUk sCfRXziul1hprOz2rBcYyunsI7tb+jChN/DB3zkkPfb/Ue3VEnKu9bBWyEWXDQAVDwYv vvqA== X-Gm-Message-State: ALoCoQlOmBZjWCU8xvXUuVWJhfNXg3ajcds0ZW1um5SfFkWZ8gRnPJl7aepx+TYXIC+BbPilB/mb X-Received: by 10.152.45.7 with SMTP id i7mr11546lam.9.1423798657843; Thu, 12 Feb 2015 19:37:37 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.193 with SMTP id g1ls246446laf.14.gmail; Thu, 12 Feb 2015 19:37:37 -0800 (PST) X-Received: by 10.112.158.199 with SMTP id ww7mr6068345lbb.104.1423798657638; Thu, 12 Feb 2015 19:37:37 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id u3si621646laj.100.2015.02.12.19.37.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 19:37:37 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labgq15 with SMTP id gq15so13998587lab.3 for ; Thu, 12 Feb 2015 19:37:37 -0800 (PST) X-Received: by 10.112.67.41 with SMTP id k9mr6126625lbt.35.1423798657495; Thu, 12 Feb 2015 19:37:37 -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 h5csp820983lbj; Thu, 12 Feb 2015 19:37:37 -0800 (PST) X-Received: by 10.194.201.103 with SMTP id jz7mr14665735wjc.14.1423798656827; Thu, 12 Feb 2015 19:37:36 -0800 (PST) Received: from mail-we0-f170.google.com (mail-we0-f170.google.com. [74.125.82.170]) by mx.google.com with ESMTPS id vo9si1632825wjc.19.2015.02.12.19.37.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 19:37:36 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.170 as permitted sender) client-ip=74.125.82.170; Received: by mail-we0-f170.google.com with SMTP id q59so14135013wes.1 for ; Thu, 12 Feb 2015 19:37:36 -0800 (PST) X-Received: by 10.180.88.193 with SMTP id bi1mr8667258wib.70.1423798656168; Thu, 12 Feb 2015 19:37:36 -0800 (PST) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id a5sm1031181wib.20.2015.02.12.19.37.35 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 19:37:35 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: kvmarm@lists.cs.columbia.edu, patches@linaro.org Subject: [PATCH v3 2/2] hw/intc/arm_gic: Initialize the vgic in the realize function Date: Fri, 13 Feb 2015 03:37:20 +0000 Message-Id: <1423798640-10499-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1423798640-10499-1-git-send-email-eric.auger@linaro.org> References: <1423798640-10499-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.215.49 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);