All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Dall <cdall@linaro.org>
To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Christoffer Dall <cdall@linaro.org>,
	kvm@vger.kernel.org
Subject: [PATCH 8/9] KVM: arm/arm64: vgic: Don't check vgic_initialized in flush_hwstate
Date: Mon, 20 Mar 2017 11:58:17 +0100	[thread overview]
Message-ID: <20170320105818.20481-9-cdall@linaro.org> (raw)
In-Reply-To: <20170320105818.20481-1-cdall@linaro.org>

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 criticial path.

Note: list_empty is a single atomic read (uses READ_ONCE) and can
therefore check if a list is empty or not without the need to take the
spinlock protecting the list.

Signed-off-by: Christoffer Dall <cdall@linaro.org>
---
 virt/kvm/arm/vgic/vgic.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c
index f5b3c25..093873e 100644
--- a/virt/kvm/arm/vgic/vgic.c
+++ b/virt/kvm/arm/vgic/vgic.c
@@ -653,9 +653,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 (list_empty(&vcpu->arch.vgic_cpu.ap_list_head))
 		return;
 
-- 
2.9.0

WARNING: multiple messages have this Message-ID (diff)
From: cdall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/9] KVM: arm/arm64: vgic: Don't check vgic_initialized in flush_hwstate
Date: Mon, 20 Mar 2017 11:58:17 +0100	[thread overview]
Message-ID: <20170320105818.20481-9-cdall@linaro.org> (raw)
In-Reply-To: <20170320105818.20481-1-cdall@linaro.org>

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 criticial path.

Note: list_empty is a single atomic read (uses READ_ONCE) and can
therefore check if a list is empty or not without the need to take the
spinlock protecting the list.

Signed-off-by: Christoffer Dall <cdall@linaro.org>
---
 virt/kvm/arm/vgic/vgic.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c
index f5b3c25..093873e 100644
--- a/virt/kvm/arm/vgic/vgic.c
+++ b/virt/kvm/arm/vgic/vgic.c
@@ -653,9 +653,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 (list_empty(&vcpu->arch.vgic_cpu.ap_list_head))
 		return;
 
-- 
2.9.0

  parent reply	other threads:[~2017-03-20 10:58 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 10:58 [PATCH 0/9] KVM: arm/arm64: vgic: Improvements and optimizations Christoffer Dall
2017-03-20 10:58 ` Christoffer Dall
2017-03-20 10:58 ` [PATCH 1/9] KVM: arm/arm64: vgic: Defer touching GICH_VMCR to vcpu_load/put Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 10:29   ` Marc Zyngier
2017-03-21 10:29     ` Marc Zyngier
2017-03-21 11:16     ` Christoffer Dall
2017-03-21 11:16       ` Christoffer Dall
2017-03-20 10:58 ` [PATCH 2/9] KVM: arm/arm64: vgic: Avoid flushing vgic state when there's no pending IRQ Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 10:57   ` Marc Zyngier
2017-03-21 10:57     ` Marc Zyngier
2017-03-21 11:17     ` Christoffer Dall
2017-03-21 11:17       ` Christoffer Dall
2017-03-20 10:58 ` [PATCH 3/9] KVM: arm/arm64: vgic: Get rid of live_lrs Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 11:06   ` Marc Zyngier
2017-03-21 11:06     ` Marc Zyngier
2017-03-20 10:58 ` [PATCH 4/9] KVM: arm/arm64: vgic: Get rid of unnecessary process_maintenance operation Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 11:36   ` Marc Zyngier
2017-03-21 11:36     ` Marc Zyngier
2017-03-21 12:26     ` [PATCH 4/9] KVM: arm/arm64: vgic: Get rid of unnecessary process_maintenance operationjjjj Christoffer Dall
2017-03-21 12:26       ` Christoffer Dall
2017-03-21 13:26       ` Marc Zyngier
2017-03-21 13:26         ` Marc Zyngier
2017-03-21 14:10         ` Christoffer Dall
2017-03-21 14:10           ` Christoffer Dall
2017-03-20 10:58 ` [PATCH 5/9] KVM: arm/arm64: vgic: Get rid of unnecessary save_maint_int_state Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 11:44   ` Marc Zyngier
2017-03-21 11:44     ` Marc Zyngier
2017-03-20 10:58 ` [PATCH 6/9] KVM: arm/arm64: vgic: Get rid of MISR and EISR fields Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 11:45   ` Marc Zyngier
2017-03-21 11:45     ` Marc Zyngier
2017-03-20 10:58 ` [PATCH 7/9] KVM: arm/arm64: vgic: Implement early VGIC init functionality Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 12:05   ` Marc Zyngier
2017-03-21 12:05     ` Marc Zyngier
2017-03-21 12:29     ` Christoffer Dall
2017-03-21 12:29       ` Christoffer Dall
2017-03-21 13:30       ` Marc Zyngier
2017-03-21 13:30         ` Marc Zyngier
2017-03-20 10:58 ` Christoffer Dall [this message]
2017-03-20 10:58   ` [PATCH 8/9] KVM: arm/arm64: vgic: Don't check vgic_initialized in flush_hwstate Christoffer Dall
2017-03-21 12:08   ` Marc Zyngier
2017-03-21 12:08     ` Marc Zyngier
2017-03-21 12:30     ` Christoffer Dall
2017-03-21 12:30       ` Christoffer Dall
2017-03-20 10:58 ` [PATCH 9/9] KVM: arm/arm64: vgic: Improve sync_hwstate performance Christoffer Dall
2017-03-20 10:58   ` Christoffer Dall
2017-03-21 13:29   ` Marc Zyngier
2017-03-21 13:29     ` Marc Zyngier
2017-03-21 14:13     ` Christoffer Dall
2017-03-21 14:13       ` Christoffer Dall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170320105818.20481-9-cdall@linaro.org \
    --to=cdall@linaro.org \
    --cc=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.