KVM: arm/arm64: Remove redundant preemptible checks

"Linux Kernel Mailing List" <[email protected]> Sat, 10 Feb 2018 22:00:23 +0000 (UTC)
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/5a24575032971c5a9a4580417a791c427ebdb8e5
Commit:     5a24575032971c5a9a4580417a791c427ebdb8e5
Parent:     4404b336cf32bf709942067fe71d8b5cf70fb2b2
Refname:    refs/heads/master
Author:     Christoffer Dall <[email protected]>
AuthorDate: Fri Sep 8 07:07:13 2017 -0700
Committer:  Christoffer Dall <[email protected]>
CommitDate: Tue Jan 2 10:05:45 2018 +0100

    KVM: arm/arm64: Remove redundant preemptible checks
    
    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 <[email protected]>
    Reviewed-by: Andre Przywara <[email protected]>
    Signed-off-by: Christoffer Dall <[email protected]>
---
 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 6b60c98a6e22..3610e132df8b 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);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html