public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@linaro.org>
To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org
Cc: kvm@vger.kernel.org, Marc Zyngier <marc.zyngier@arm.com>,
	Eric Auger <eric.auger@redhat.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: [PATCH v5 1/8] KVM: arm/arm64: Remove redundant preemptible checks
Date: Mon, 20 Nov 2017 20:16:42 +0100	[thread overview]
Message-ID: <20171120191649.17290-2-christoffer.dall@linaro.org> (raw)
In-Reply-To: <20171120191649.17290-1-christoffer.dall@linaro.org>

The __this_cpu_read() and __this_cpu_write() functions already implement
checks for the required preemption levels when using
CONFIG_DEBUG_PREEMPT which gives you nice error messages and such.
Therefore there is no need to explicitly check this using a BUG_ON() in
the code (which we don't do for other uses of per cpu variables either).

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 virt/kvm/arm/arm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index c13d74c083fe..28548aeaf164 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -71,7 +71,6 @@ static DEFINE_PER_CPU(unsigned char, kvm_arm_hardware_enabled);
 
 static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
 {
-	BUG_ON(preemptible());
 	__this_cpu_write(kvm_arm_running_vcpu, vcpu);
 }
 
@@ -81,7 +80,6 @@ static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
  */
 struct kvm_vcpu *kvm_arm_get_running_vcpu(void)
 {
-	BUG_ON(preemptible());
 	return __this_cpu_read(kvm_arm_running_vcpu);
 }
 
-- 
2.14.2

  reply	other threads:[~2017-11-20 19:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 19:16 [PATCH v5 0/8] Handle forwarded level-triggered interrupts Christoffer Dall
2017-11-20 19:16 ` Christoffer Dall [this message]
2017-12-01 18:04   ` [PATCH v5 1/8] KVM: arm/arm64: Remove redundant preemptible checks Andre Przywara
2017-11-20 19:16 ` [PATCH v5 2/8] KVM: arm/arm64: Factor out functionality to get vgic mmio requester_vcpu Christoffer Dall
2017-12-01 18:04   ` Andre Przywara
2017-12-04 19:21     ` Christoffer Dall
2017-11-20 19:16 ` [PATCH v5 3/8] KVM: arm/arm64: Don't cache the timer IRQ level Christoffer Dall
2017-12-01 18:04   ` Andre Przywara
2017-11-20 19:16 ` [PATCH v5 4/8] KVM: arm/arm64: vgic: Support level-triggered mapped interrupts Christoffer Dall
2017-11-20 19:16 ` [PATCH v5 5/8] KVM: arm/arm64: Support a vgic interrupt line level sample function Christoffer Dall
2017-11-20 19:16 ` [PATCH v5 6/8] KVM: arm/arm64: Support VGIC dist pend/active changes for mapped IRQs Christoffer Dall
2017-11-29 15:13   ` Andrew Jones
2017-12-04 19:31     ` Christoffer Dall
2017-11-20 19:16 ` [PATCH v5 7/8] KVM: arm/arm64: Provide a get_input_level for the arch timer Christoffer Dall
2017-11-29 15:13   ` Andrew Jones
2017-11-20 19:16 ` [PATCH v5 8/8] KVM: arm/arm64: Avoid work when userspace iqchips are not used 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=20171120191649.17290-2-christoffer.dall@linaro.org \
    --to=christoffer.dall@linaro.org \
    --cc=andre.przywara@arm.com \
    --cc=eric.auger@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox