Is an unlock needed on line 1380? julia ---------- Forwarded message ---------- Date: Sat, 3 Apr 2021 09:55:24 +0800 From: kernel test robot <lkp@xxxxxxxxx> To: kbuild@xxxxxxxxxxxx Cc: lkp@xxxxxxxxx, Julia Lawall <julia.lawall@xxxxxxx> Subject: [kvm:queue 120/120] arch/x86/kvm/svm/sev.c:1380:2-8: preceding lock on line 1375 CC: kbuild-all@xxxxxxxxxxxx CC: kvm@xxxxxxxxxxxxxxx CC: Robert Hu <robert.hu@xxxxxxxxx> CC: Farrah Chen <farrah.chen@xxxxxxxxx> CC: Danmei Wei <danmei.wei@xxxxxxxxx> TO: Nathan Tempelman <natet@xxxxxxxxxx> CC: Paolo Bonzini <pbonzini@xxxxxxxxxx> tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue head: f96be2deac9bca3ef5a2b0b66b71fcef8bad586d commit: f96be2deac9bca3ef5a2b0b66b71fcef8bad586d [120/120] KVM: x86: Support KVM VMs sharing SEV context :::::: branch date: 10 hours ago :::::: commit date: 10 hours ago config: i386-allmodconfig (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> Reported-by: Julia Lawall <julia.lawall@xxxxxxx> cocci warnings: (new ones prefixed by >>) >> arch/x86/kvm/svm/sev.c:1380:2-8: preceding lock on line 1375 vim +1380 arch/x86/kvm/svm/sev.c f96be2deac9bca Nathan Tempelman 2021-03-16 1365 eaf78265a4ab33 Joerg Roedel 2020-03-24 1366 void sev_vm_destroy(struct kvm *kvm) eaf78265a4ab33 Joerg Roedel 2020-03-24 1367 { eaf78265a4ab33 Joerg Roedel 2020-03-24 1368 struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info; eaf78265a4ab33 Joerg Roedel 2020-03-24 1369 struct list_head *head = &sev->regions_list; eaf78265a4ab33 Joerg Roedel 2020-03-24 1370 struct list_head *pos, *q; eaf78265a4ab33 Joerg Roedel 2020-03-24 1371 eaf78265a4ab33 Joerg Roedel 2020-03-24 1372 if (!sev_guest(kvm)) eaf78265a4ab33 Joerg Roedel 2020-03-24 1373 return; eaf78265a4ab33 Joerg Roedel 2020-03-24 1374 eaf78265a4ab33 Joerg Roedel 2020-03-24 @1375 mutex_lock(&kvm->lock); eaf78265a4ab33 Joerg Roedel 2020-03-24 1376 f96be2deac9bca Nathan Tempelman 2021-03-16 1377 /* If this is a mirror_kvm release the enc_context_owner and skip sev cleanup */ f96be2deac9bca Nathan Tempelman 2021-03-16 1378 if (is_mirroring_enc_context(kvm)) { f96be2deac9bca Nathan Tempelman 2021-03-16 1379 kvm_put_kvm(sev->enc_context_owner); f96be2deac9bca Nathan Tempelman 2021-03-16 @1380 return; f96be2deac9bca Nathan Tempelman 2021-03-16 1381 } f96be2deac9bca Nathan Tempelman 2021-03-16 1382 eaf78265a4ab33 Joerg Roedel 2020-03-24 1383 /* eaf78265a4ab33 Joerg Roedel 2020-03-24 1384 * Ensure that all guest tagged cache entries are flushed before eaf78265a4ab33 Joerg Roedel 2020-03-24 1385 * releasing the pages back to the system for use. CLFLUSH will eaf78265a4ab33 Joerg Roedel 2020-03-24 1386 * not do this, so issue a WBINVD. eaf78265a4ab33 Joerg Roedel 2020-03-24 1387 */ eaf78265a4ab33 Joerg Roedel 2020-03-24 1388 wbinvd_on_all_cpus(); eaf78265a4ab33 Joerg Roedel 2020-03-24 1389 eaf78265a4ab33 Joerg Roedel 2020-03-24 1390 /* eaf78265a4ab33 Joerg Roedel 2020-03-24 1391 * if userspace was terminated before unregistering the memory regions eaf78265a4ab33 Joerg Roedel 2020-03-24 1392 * then lets unpin all the registered memory. eaf78265a4ab33 Joerg Roedel 2020-03-24 1393 */ eaf78265a4ab33 Joerg Roedel 2020-03-24 1394 if (!list_empty(head)) { eaf78265a4ab33 Joerg Roedel 2020-03-24 1395 list_for_each_safe(pos, q, head) { eaf78265a4ab33 Joerg Roedel 2020-03-24 1396 __unregister_enc_region_locked(kvm, eaf78265a4ab33 Joerg Roedel 2020-03-24 1397 list_entry(pos, struct enc_region, list)); 7be74942f184fd David Rientjes 2020-08-25 1398 cond_resched(); eaf78265a4ab33 Joerg Roedel 2020-03-24 1399 } eaf78265a4ab33 Joerg Roedel 2020-03-24 1400 } eaf78265a4ab33 Joerg Roedel 2020-03-24 1401 eaf78265a4ab33 Joerg Roedel 2020-03-24 1402 mutex_unlock(&kvm->lock); eaf78265a4ab33 Joerg Roedel 2020-03-24 1403 eaf78265a4ab33 Joerg Roedel 2020-03-24 1404 sev_unbind_asid(kvm, sev->handle); eaf78265a4ab33 Joerg Roedel 2020-03-24 1405 sev_asid_free(sev->asid); eaf78265a4ab33 Joerg Roedel 2020-03-24 1406 } eaf78265a4ab33 Joerg Roedel 2020-03-24 1407 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip