From patchwork Sun Apr 23 17:08:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9694953 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 7FD0260245 for ; Sun, 23 Apr 2017 17:11:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68B1326530 for ; Sun, 23 Apr 2017 17:11:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D801265B9; Sun, 23 Apr 2017 17:11:20 +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 E864C26530 for ; Sun, 23 Apr 2017 17:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163086AbdDWRLS (ORCPT ); Sun, 23 Apr 2017 13:11:18 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:33977 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162366AbdDWRKE (ORCPT ); Sun, 23 Apr 2017 13:10:04 -0400 Received: by mail-wm0-f53.google.com with SMTP id r190so4711310wme.1 for ; Sun, 23 Apr 2017 10:09:59 -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=K9Fz/XpfMRc+pTY8PqB1HQfv4YE5E3dpKPIcYyg8j/U=; b=KSmqfVJoM0H5Ac2tKZDivaBhGyD6qwOApVaVFXYqFyLf1UIhSY0CT6AgirL0PvFS2y d89GRLUosD56Bg/crdtWdKKR+F0PkvC4ksRCuo+h1FBb9jBGNC99214tscATpPS9Y6in y6sCAGQXIRUfILYQUR/SX8rDL6usLv8cQskzE= 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=K9Fz/XpfMRc+pTY8PqB1HQfv4YE5E3dpKPIcYyg8j/U=; b=jWCYLH5Jt1Uox8vkRZSaCvp1Dvr7fO1wN5o6isjkhL5ZXJ40SpTCS4pVq2YQhaBJJi 7lpHj65i8zf7msM5YpKfk5exJTNb1Jfv3zRbTwHkKlD+Za2d18BNdGXhkf8FnqB9cmeS fE1kwtmIkrbXZ01Po8a1/VbZSh3iMw2qXOM0dTLq/IQQQbvvbrSY5id5Tu+4M9RGkL3j 4hjWFC0A1nHTFXn5fgi/S6e/khN2Yb+xaLgQPt6hVkKPdyUPIvpkXfQHx0vXYWgaMy88 2nCo816Szm5/v+ADI6GznWjcBMXP/JROw3/kuNEoCrbZrTfA1g21FCnsEXXqL1/lPCoi Nz0Q== X-Gm-Message-State: AN3rC/6xBK9aT/9yd0R11iBRWZIK/1qSfAlA2zen4bH7hNbOCVNm0oel 7xHHwy9CDzfRawlP X-Received: by 10.80.183.198 with SMTP id i6mr136362ede.33.1492967397508; Sun, 23 Apr 2017 10:09:57 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id 58sm2803521edz.2.2017.04.23.10.09.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:09:56 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Christoffer Dall Subject: [PULL 25/79] KVM: arm/arm64: vgic: Don't check vgic_initialized in sync/flush Date: Sun, 23 Apr 2017 19:08:35 +0200 Message-Id: <20170423170929.27334-26-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170423170929.27334-1-cdall@linaro.org> References: <20170423170929.27334-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 --- 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