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: 9695071 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 4DC4D60245 for ; Sun, 23 Apr 2017 17:14:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39CF926530 for ; Sun, 23 Apr 2017 17:14:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E824267EC; Sun, 23 Apr 2017 17:14:51 +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 A74DB26530 for ; Sun, 23 Apr 2017 17:14:50 +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=kNhKLFN3UEcyhU6e9Lf4gm4BMy/ZqjiOivUFR9XsrKA=; b=pxWG/PD/l1l6Ol9AZqJ6SepUr+ cSUwji50WKpC3bmLwFRnYrwKawjQMWf8qaZcGNNoclgds0iompn5hh2AQEigruDjurgIqFHaFK79C 4ciw1iamDk8iAD5z4QAY0UP8NZesvqKcRo2K3twkGzRISteo6N+L3K+z4c6yauLEJjvss3KQFfFW9 493YW7wAIV/Cck0w5sZNyYiIS1d1LV5YuyFWvKHGXn+/s9dKejumhlhxYsPiJGBqdRt140H+2eQin mvrsR/auF7nyx0hYBAq7BPH1N5fnTJ/fVqgVcyshYyFLeAV1eSjE/OMlm/6kyfrXAQg7xaiTdaX4V XfES3j5Q==; 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 1d2L61-00021I-QR; Sun, 23 Apr 2017 17:14:49 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2L1f-0004Z9-DK for linux-arm-kernel@lists.infradead.org; Sun, 23 Apr 2017 17:10:23 +0000 Received: by mail-wm0-x22d.google.com with SMTP id r190so4711308wme.1 for ; Sun, 23 Apr 2017 10:09:58 -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=Cutf3cZkfqZ26kwQpfHiy8Y5cWqm2qfJ9Asg7mDTj6bkNsdwH/SRvRkr5fnk3KdJRM r77WiGp6qORfZYOHzZrJogfQfquDLAPnCaD2QZW9k9OpX3qINzvDnI7W2uS5O+hhEVDk IvQdrsoga97ZmOcaltmT2BV9JDtAd6pSFnlUg0xb51x8gQtnMDZWBwa+hUaHdb19DPkL N9Y1iS8UbhzyRMrGpJ9Drs1hrWcMRTnj+1f5Ns9W2/zjLSpoX+J08N7BtcNokq438ite NzoeYKdLvBfpmErKZ70qTVAmxGIszSZ0hFqVW0vIqo2+6MWovPgszwxXdf7VytqdLsMj FuNA== X-Gm-Message-State: AN3rC/6r/2GtuSq8g+Ilo61PT6vhaeyuf4hsECL3gDAROLQqCDHg2Qr+ UI7t0nnzcTeesror 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?= 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170423_101019_918753_6838D5B3 X-CRM114-Status: GOOD ( 11.26 ) 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 , Christoffer Dall , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 --- 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