From: Scott Wood Date: Fri, 10 Jan 2014 00:43:16 +0000 (-0600) Subject: kvm: Provide kvm_vcpu_eligible_for_directed_yield() stub X-Git-Tag: firefly_0821_release~3680^2~36^2~16^2^2~156 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=328c366d43fda9d85c758c455b5f522747fa3d7e;p=firefly-linux-kernel-4.4.55.git kvm: Provide kvm_vcpu_eligible_for_directed_yield() stub Commit 7940876e1330671708186ac3386aa521ffb5c182 ("kvm: make local functions static") broke KVM PPC builds due to removing (rather than moving) the stub version of kvm_vcpu_eligible_for_directed_yield(). This patch reintroduces it. Signed-off-by: Scott Wood Cc: Stephen Hemminger Cc: Alexander Graf [Move the #ifdef inside the function. - Paolo] Signed-off-by: Paolo Bonzini (cherry picked from commit 4a55dd7273c95b4a19fbcf0ae1bbd1cfd09dfc36) Signed-off-by: Christoffer Dall --- diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 2162bd5d17d7..2d57b23683a4 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1731,7 +1731,6 @@ bool kvm_vcpu_yield_to(struct kvm_vcpu *target) } EXPORT_SYMBOL_GPL(kvm_vcpu_yield_to); -#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT /* * Helper that checks whether a VCPU is eligible for directed yield. * Most eligible candidate to yield is decided by following heuristics: @@ -1756,6 +1755,7 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_yield_to); */ static bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu) { +#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT bool eligible; eligible = !vcpu->spin_loop.in_spin_loop || @@ -1766,8 +1766,10 @@ static bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu) kvm_vcpu_set_dy_eligible(vcpu, !vcpu->spin_loop.dy_eligible); return eligible; -} +#else + return true; #endif +} void kvm_vcpu_on_spin(struct kvm_vcpu *me) {