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: 9637615 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 62E9460328 for ; Tue, 21 Mar 2017 21:12:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53A5F2830A for ; Tue, 21 Mar 2017 21:12:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4863E28306; Tue, 21 Mar 2017 21:12:30 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1E6D27D8D for ; Tue, 21 Mar 2017 21:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934054AbdCUVMQ (ORCPT ); Tue, 21 Mar 2017 17:12:16 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:34198 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933996AbdCUVL5 (ORCPT ); Tue, 21 Mar 2017 17:11:57 -0400 Received: by mail-wr0-f182.google.com with SMTP id l37so119744641wrc.1 for ; Tue, 21 Mar 2017 14:11:10 -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=uJ1Luif6GDUUljdvxUekX4Bkt/C6fBnKSmwMg2WqRVqW9B7Qovt9u9tzhNuB41kP/1 4qL2RkOjeGpd4PUUQ9ys0SoiMKpRrV0uaWsIWyCNlTllPGxqzkZd2nz8UEEOLnC13q/j mImGd59dpRdhBZt9AS/QT3WwC0/W8gqoLttG4Dd+GN9J0rqB1HZl8brVcp1jQgW8jz3B JcL6/VxjxTaUqpxsGXiW1umujwXQo5c2l8qKuRHpN18hy9R+0/TT3ZJUwKKi7VEk0P3K lNhvtPyJcoJrl64SCTmxmFdb3BIbTHXPFHCIgsLxWdlXe4bZ1aBzJeoU+lOOhi0+eGEm NIQw== X-Gm-Message-State: AFeK/H2xrilDOL40BOV06WGgSSoeKMJYqJtLWA22MJsD4gd2wy2+Za0tfqyGh9MECPX6KuP/ 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 Cc: kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Eric Auger , Christoffer Dall 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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