From patchwork Sat Dec 13 11:17:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 42205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C510D21772 for ; Sat, 13 Dec 2014 11:18:49 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf6091019eek.5 for ; Sat, 13 Dec 2014 03:18:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=9zRa7pzbRjPf/uWNKx831vLDIEOKri39o51KFQDi7EM=; b=Iu0Cu2I2TNDwpfN2KMoIaMS+Oaq5kdc0pweYOA9Lhq8xWfBhr99Vlgbdp7TIMr6wHL 8BY3qwTxspLEu+gG0tQF0RB/3+z9xdWJeDB0iZ2EeCt7ZPt6s3Bsl6uLHQ/ShvtbfMpP GIwja2ZPuuSAsTmGr9jJ3U1GyGxaopQ+kTMsia0Gc8gNqo/dTNXd6mNeJ/dv2fK+2qkc CUrj2J45QBkwngUuGDsa5Xim7/di+XBsf1bx49PpGqN2WYE2P5U9XlXwemu+jrA9d1J6 FWVhrtJ9H8FuU3C56/HTHNApuU07paEW0YbvplUQ7jlzQB6u/IvcKKsfKw/mGvHkAVna G35w== X-Gm-Message-State: ALoCoQlbafZy89sR/rpn39OeqVVvNPh9XHJOr1k4/8zU353bkZVkC+QNgURxo2paqzWvcAV9bcAW X-Received: by 10.180.24.131 with SMTP id u3mr1422234wif.4.1418469528981; Sat, 13 Dec 2014 03:18:48 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.170 with SMTP id d10ls471351lad.37.gmail; Sat, 13 Dec 2014 03:18:48 -0800 (PST) X-Received: by 10.152.21.66 with SMTP id t2mr19729307lae.27.1418469528595; Sat, 13 Dec 2014 03:18:48 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id og3si4224234lbb.6.2014.12.13.03.18.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 13 Dec 2014 03:18:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id gd6so7468085lab.1 for ; Sat, 13 Dec 2014 03:18:48 -0800 (PST) X-Received: by 10.112.162.106 with SMTP id xz10mr20242167lbb.91.1418469528412; Sat, 13 Dec 2014 03:18:48 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp231818lbb; Sat, 13 Dec 2014 03:18:47 -0800 (PST) X-Received: by 10.70.102.17 with SMTP id fk17mr34571976pdb.61.1418469526401; Sat, 13 Dec 2014 03:18:46 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id d5si5692257pdd.145.2014.12.13.03.18.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Dec 2014 03:18:46 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XzkhI-0006RI-Fx; Sat, 13 Dec 2014 11:17:16 +0000 Received: from mail-la0-f41.google.com ([209.85.215.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xzkgx-0006GZ-8O for linux-arm-kernel@lists.infradead.org; Sat, 13 Dec 2014 11:16:56 +0000 Received: by mail-la0-f41.google.com with SMTP id hv19so7259005lab.14 for ; Sat, 13 Dec 2014 03:16:33 -0800 (PST) X-Received: by 10.112.135.229 with SMTP id pv5mr20135108lbb.52.1418469393102; Sat, 13 Dec 2014 03:16:33 -0800 (PST) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id b4sm1096765lbp.17.2014.12.13.03.16.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Dec 2014 03:16:32 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/6] arm/arm64: KVM: Rename vgic_initialized to vgic_ready Date: Sat, 13 Dec 2014 12:17:25 +0100 Message-Id: <1418469449-13277-3-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1418469449-13277-1-git-send-email-christoffer.dall@linaro.org> References: <1418469449-13277-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141213_031655_536320_2193350D X-CRM114-Status: GOOD ( 13.91 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.41 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.41 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Christoffer Dall , kvm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@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.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The vgic_initialized() macro currently returns the state of the vgic->ready flag, which indicates if the vgic is ready to be used when running a VM, not specifically if its internal state has been initialized. Rename the macro accordingly in preparation for a more nuanced initialization flow. Acked-by: Marc Zyngier Reviewed-by: Eric Auger Signed-off-by: Christoffer Dall --- arch/arm/kvm/arm.c | 2 +- include/kvm/arm_vgic.h | 4 ++-- virt/kvm/arm/vgic.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index a56cbb5..a9d005f 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -430,7 +430,7 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) * Map the VGIC hardware resources before running a vcpu the first * time on this VM. */ - if (unlikely(!vgic_initialized(vcpu->kvm))) { + if (unlikely(!vgic_ready(vcpu->kvm))) { ret = kvm_vgic_map_resources(vcpu->kvm); if (ret) return ret; diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index fe9783b..3e262b9 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -287,7 +287,7 @@ bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, struct kvm_exit_mmio *mmio); #define irqchip_in_kernel(k) (!!((k)->arch.vgic.in_kernel)) -#define vgic_initialized(k) ((k)->arch.vgic.ready) +#define vgic_ready(k) ((k)->arch.vgic.ready) int vgic_v2_probe(struct device_node *vgic_node, const struct vgic_ops **ops, @@ -369,7 +369,7 @@ static inline int irqchip_in_kernel(struct kvm *kvm) return 0; } -static inline bool vgic_initialized(struct kvm *kvm) +static inline bool vgic_ready(struct kvm *kvm) { return true; } diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 146c35f..22c8304 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1693,7 +1693,7 @@ out: int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int irq_num, bool level) { - if (likely(vgic_initialized(kvm)) && + if (likely(vgic_ready(kvm)) && vgic_update_irq_pending(kvm, cpuid, irq_num, level)) vgic_kick_vcpus(kvm); @@ -1882,7 +1882,7 @@ int kvm_vgic_map_resources(struct kvm *kvm) mutex_lock(&kvm->lock); - if (vgic_initialized(kvm)) + if (vgic_ready(kvm)) goto out; if (IS_VGIC_ADDR_UNDEF(kvm->arch.vgic.vgic_dist_base) || @@ -2276,7 +2276,7 @@ static int vgic_set_attr(struct kvm_device *dev, struct kvm_device_attr *attr) mutex_lock(&dev->kvm->lock); - if (vgic_initialized(dev->kvm) || dev->kvm->arch.vgic.nr_irqs) + if (vgic_ready(dev->kvm) || dev->kvm->arch.vgic.nr_irqs) ret = -EBUSY; else dev->kvm->arch.vgic.nr_irqs = val;