From patchwork Tue Mar 21 21:10:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9637639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A1FA60327 for ; Tue, 21 Mar 2017 21:13:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A4D825E13 for ; Tue, 21 Mar 2017 21:13:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D15D27D8D; Tue, 21 Mar 2017 21:13:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D008D25E13 for ; Tue, 21 Mar 2017 21:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1WHzl7QGIwIFAS0kMXUYLO0X7pRyenzZerJCDkYXmKA=; b=VV5DIQtEgLFVq+ZxHSXBJ8NAz0 1cbknKWB3KMOX0lr5HcYvodCQJj9ePbLKocdgqa8ANmmgqMSbEhEcWNIUkWGRppitKYmv8AERJ52h 2K30jWwqryEySArInvOIefGaROcNHpL5C6nJ4BQa+0Gat/NoD6vW5HLl3T+IDQI8R9atpR5lTc6UU AczAnuJzLCX1YRHm91CMUVe18gihLj5yurmWQh73Jl/iuC+4sz8WCx9g6k2+HwmPscM+A/th9FIjO 6qvRx7Pb4JBycqq/8vKRoyML+k2bTMEWVP8NoL2QIywe1A33X6oxdLcjKY/F3RcGiK5qzTdlNY6DC zlfkyzdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqR65-0007Cs-WD; Tue, 21 Mar 2017 21:13:42 +0000 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqR3z-0004n4-Lq for linux-arm-kernel@lists.infradead.org; Tue, 21 Mar 2017 21:11:36 +0000 Received: by mail-wr0-x22c.google.com with SMTP id l37so119744639wrc.1 for ; Tue, 21 Mar 2017 14:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qQpdQuvvBc9rbmHhkXMiHxZE8LEQYiJ3YcuyQP57EMA=; b=iw4g+/Wz7WUlWcj5ZKdzo25DlKDfaUh/8xySDobUpYootBMXiLF8p+V7HTtkGkWSMN XMEoayG1hMTZTNl2z7fOtmGgdFh14lafKs3OlXJ5equnHalzoS1oNeSygm9tFT1mKDZU faIbwMhW7yaE7rfjzJ3vlq0aiU7U5ULppn0/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qQpdQuvvBc9rbmHhkXMiHxZE8LEQYiJ3YcuyQP57EMA=; b=tQ2KLxCQCtkcifXsxdKS0tCfaiwAP6z1cXI/7vygcGYoLEp1LGOo4IO1Wi9d+ixG7x agiDXIrR2k9wT18569i7Kj4hixA3wpNI4wVFRBdsZoulWlHx0NlNn2KbdFvvR2lciHsj rsGQAmoalxIVbvAUc2SH2UmwY+BzQBdrohlpIk2oseiWs+b6XxlCGQDIQxZXXnHQV2yO SnYoGayEMiXVdxCLGLSga0C7Kc5pD8a22L5GbxW2to6tmhX/sHQGXuIeQeCIWeULCthd EnJv5YQpU0VVZWZNQIxZw6P80hd8lnRIp86ugzDMPtxNaCJYIbg2wYPMCRuQZMExVCqZ 70lA== X-Gm-Message-State: AFeK/H01q8YcQ07V8YWFV9WO69zxuN9EmW00lJVRgzZurPf9qRWRRoacv/Gd2sShOk58sjDg X-Received: by 10.223.152.215 with SMTP id w81mr35953608wrb.151.1490130669868; Tue, 21 Mar 2017 14:11:09 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id w130sm18953459wmg.0.2017.03.21.14.11.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Mar 2017 14:11:09 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 09/10] KVM: arm/arm64: vgic: Don't check vgic_initialized in sync/flush Date: Tue, 21 Mar 2017 22:10:58 +0100 Message-Id: <20170321211059.8719-10-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170321211059.8719-1-cdall@linaro.org> References: <20170321211059.8719-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170321_141132_123835_6A422299 X-CRM114-Status: GOOD ( 13.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Andre Przywara , Christoffer Dall , kvm@vger.kernel.org, Eric Auger MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now when we do an early init of the static parts of the VGIC data structures, we can do things like checking if the AP lists are empty directly without having to explicitly check if the vgic is initialized and reduce a bit of work in our critical path. Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall --- Changes since v1: - Moved note about checking list_empty to other patch commit message - Removed check in both sync/flush in this patch virt/kvm/arm/vgic/vgic.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c index b64b143..04a405a 100644 --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c @@ -633,9 +633,6 @@ void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) { struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; - if (unlikely(!vgic_initialized(vcpu->kvm))) - return; - vgic_fold_lr_state(vcpu); vgic_prune_ap_list(vcpu); @@ -646,9 +643,6 @@ void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) /* Flush our emulation state into the GIC hardware before entering the guest. */ void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) { - if (unlikely(!vgic_initialized(vcpu->kvm))) - return; - /* * If there are no virtual interrupts active or pending for this * VCPU, then there is no work to do and we can bail out without