qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] accel/kvm/kvm-all: Fixes the missing break in vCPU unpark logic
@ 2024-07-25 14:51 Salil Mehta via
  2024-07-25 19:57 ` Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Salil Mehta via @ 2024-07-25 14:51 UTC (permalink / raw)
  To: qemu-devel, qemu-arm, mst, peter.maydell
  Cc: salil.mehta, maz, jean-philippe, jonathan.cameron, lpieralisi,
	richard.henderson, imammedo, andrew.jones, david, philmd,
	eric.auger, oliver.upton, pbonzini, will, gshan, rafael,
	alex.bennee, linux, darren, ilkka, vishnu, karl.heubaum,
	miguel.luis, salil.mehta, zhukeqian1, wangxiongfeng2, wangyanan55,
	jiakernel2, maobibo, lixianglai, npiggin, harshpb, linuxarm

Loop should exit prematurely on successfully finding out the parked vCPU (struct
KVMParkedVcpu) in the 'struct KVMState' maintained 'kvm_parked_vcpus' list of
parked vCPUs.

Fixes: Coverity CID 1558552
Fixes: 08c3286822 ("accel/kvm: Extract common KVM vCPU {creation,parking} code")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <CAFEAcA-3_d1c7XSXWkFubD-LsW5c5i95e6xxV09r2C9yGtzcdA@mail.gmail.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 0aa4b4624a..c181297f00 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -362,6 +362,7 @@ int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
             QLIST_REMOVE(cpu, node);
             kvm_fd = cpu->kvm_fd;
             g_free(cpu);
+            break;
         }
     }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-07-31 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 14:51 [PATCH] accel/kvm/kvm-all: Fixes the missing break in vCPU unpark logic Salil Mehta via
2024-07-25 19:57 ` Philippe Mathieu-Daudé
2024-07-26  0:27 ` Gavin Shan
2024-07-26  8:47 ` Zhao Liu
2024-07-26  9:33 ` Igor Mammedov
2024-07-31  8:48   ` Salil Mehta via
2024-07-31 11:39     ` Peter Maydell
2024-07-31 12:32       ` Salil Mehta via

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).