Skip to contentSkip to conversation

accel/kvm/kvm-all: Fixes the missing break in vCPU unpark logic

PATCH In review Salil Mehta 6 participants 8 messages Jul 25, 2024 – Jul 31, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accel/kvm/kvm-all: Fixes the missing break in vCPU unpark logic

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")

Message-ID: <CAFEAcA-3_d1c7XSXWkFubD-LsW5c5i95e6xxV09r2C9yGtzcdA@mail.gmail.com>

---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)
accel/kvm/kvm-all.c +1 -0
index 0aa4b4624a..c181297f00 100644
@@ -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;
         }
     }
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Salil Mehta

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")
Quoted 5 lines

Message-ID: <CAFEAcA-3_d1c7XSXWkFubD-LsW5c5i95e6xxV09r2C9yGtzcdA@mail.gmail.com>

---
  accel/kvm/kvm-all.c | 1 +
  1 file changed, 1 insertion(+)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Salil Mehta
Quoted 8 lines · Salil Mehta

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")
Quoted 6 lines

Message-ID: <CAFEAcA-3_d1c7XSXWkFubD-LsW5c5i95e6xxV09r2C9yGtzcdA@mail.gmail.com>

---
  accel/kvm/kvm-all.c | 1 +
  1 file changed, 1 insertion(+)
Reviewed-by on v1 1/1
#3 lore raw
In reply to Salil Mehta
Quoted 14 lines · Salil Mehta via

Date: Thu, 25 Jul 2024 15:51:32 +0100
From: Salil Mehta via <[email protected]>
Subject: [PATCH] accel/kvm/kvm-all: Fixes the missing break in vCPU unpark
logic
X-Mailer: git-send-email 2.34.1

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")
Quoted 5 lines

Message-ID: <CAFEAcA-3_d1c7XSXWkFubD-LsW5c5i95e6xxV09r2C9yGtzcdA@mail.gmail.com>

---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)
Reviewed-by on v1 1/1
#4 lore raw
In reply to Salil Mehta
Quoted 10 lines · On Thu, 25 Jul 2024 15:51:32 +0100 Salil Mehta <[email protected]> wrote:

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")

Message-ID: <CAFEAcA-3_d1c7XSXWkFubD-LsW5c5i95e6xxV09r2C9yGtzcdA@mail.gmail.com>

Quoted 16 lines
---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)
accel/kvm/kvm-all.c +1 -0
index 0aa4b4624a..c181297f00 100644
@@ -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;
         }
     }
 
#5 lore raw

Hello,

A quick check and a gentle reminder, has this patch been accepted?

Best regards
Salil.

Quoted 43 lines

From: Igor Mammedov <[email protected]>
Sent: Friday, July 26, 2024 10:34 AM
To: Salil Mehta <[email protected]>

Quoted 3 lines · On Thu, 25 Jul 2024 15:51:32 +0100 Salil Mehta <[email protected]> wrote:

Loop should exit prematurely on successfully finding out the parked vCPU (struct
KVMParkedVcpu) in the 'struct KVMState' maintained

'kvm_parked_vcpus'

Quoted 9 lines

list of parked vCPUs.

Fixes Coverity CID 1558552
Fixes 08c3286822 ("accel/kvm: Extract common KVM vCPU

{creation,parking} code")

Message-ID:
<CAFEAcA-3_d1c7XSXWkFubD-

[email protected]>

Quoted 1 line

accel/kvm/kvm-all.c int kvm_unpark_vcpu(KVMState *s, unsigned long

Quoted 9 lines
---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)
accel/kvm/kvm-all.c index renamed from accel/kvm/kvm-all.c +0 -0

0aa4b4624a..c181297f00 100644

accel/kvm/kvm-all.c +0 -0
@@ -362,6 +362,7 @@ int kvm_unpark_vcpu(KVMState *s, unsigned long

vcpu_id)

Quoted 7 lines
accel/kvm/kvm-all.c +1 -0
             QLIST_REMOVE(cpu, node);
             kvm_fd = cpu->kvm_fd;
             g_free(cpu);
+            break;
         }
     }
 
#6 lore raw
Quoted 4 lines · Salil Mehta

Hello,

A quick check and a gentle reminder, has this patch been accepted?

Thanks for the ping. I'm doing a target-arm pullreq tomorrow so I'll take it via my queue.

-- PMM

#7 lore raw
Quoted 4 lines

From: Peter Maydell <[email protected]>
Sent: Wednesday, July 31, 2024 12:39 PM
To: Salil Mehta <[email protected]>

Quoted 8 lines
Quoted 4 lines · Salil Mehta

Hello,

A quick check and a gentle reminder, has this patch been accepted?

Thanks for the ping. I'm doing a target-arm pullreq tomorrow so I'll take it via my queue.

Great. Thanks!

Best regards
Salil.

Quoted 2 lines

-- PMM