Hello Paul Mackerras, The patch 898b25b202f3: "KVM: PPC: Book3S HV: Simplify dynamic micro-threading code" from Jun 22, 2017, leads to the following static checker warning: arch/powerpc/kvm/book3s_hv.c:3096 kvmppc_run_vcpu() error: double lock 'spin_lock:&vc->lock' arch/powerpc/kvm/book3s_hv.c:3183 kvmppc_run_vcpu() error: double unlock 'spin_lock:&vc->lock' arch/powerpc/kvm/book3s_hv.c 3062 static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) 3063 { 3064 int n_ceded, i; 3065 struct kvmppc_vcore *vc; 3066 struct kvm_vcpu *v; 3067 3068 trace_kvmppc_run_vcpu_enter(vcpu); 3069 3070 kvm_run->exit_reason = 0; 3071 vcpu->arch.ret = RESUME_GUEST; 3072 vcpu->arch.trap = 0; 3073 kvmppc_update_vpas(vcpu); 3074 3075 /* 3076 * Synchronize with other threads in this virtual core 3077 */ 3078 vc = vcpu->arch.vcore; 3079 spin_lock(&vc->lock); ^^^^^^^^^^^^^^^^^^^^ Lock 3080 vcpu->arch.ceded = 0; 3081 vcpu->arch.run_task = current; 3082 vcpu->arch.kvm_run = kvm_run; 3083 vcpu->arch.stolen_logged = vcore_stolen_time(vc, mftb()); 3084 vcpu->arch.state = KVMPPC_VCPU_RUNNABLE; 3085 vcpu->arch.busy_preempt = TB_NIL; 3086 WRITE_ONCE(vc->runnable_threads[vcpu->arch.ptid], vcpu); 3087 ++vc->n_runnable; 3088 3089 /* 3090 * This happens the first time this is called for a vcpu. 3091 * If the vcore is already running, we may be able to start 3092 * this thread straight away and have it join in. 3093 */ 3094 if (!signal_pending(current)) { 3095 if (vc->vcore_state == VCORE_PIGGYBACK) { 3096 if (spin_trylock(&vc->lock)) { ^^^^^^^^^^^^^^^^^^^^^^ Can't ever succeed? 3097 if (vc->vcore_state == VCORE_RUNNING && 3098 !VCORE_IS_EXITING(vc)) { 3099 kvmppc_create_dtl_entry(vcpu, vc); 3100 kvmppc_start_thread(vcpu, vc); 3101 trace_kvm_guest_enter(vcpu); 3102 } 3103 spin_unlock(&vc->lock); 3104 } 3105 } else if (vc->vcore_state == VCORE_RUNNING && 3106 !VCORE_IS_EXITING(vc)) { regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html