Re: [PATCH v2 06/14] KVM: selftests: Allow blocking vCPUs via HLT

Sean Christopherson
2026-04-01T20:03:03Z

On Tue, Mar 31, 2026, Josh Hilke wrote:
> Signed-off-by: David Matlack <dmatlack@google.com>
> Signed-off-by: Josh Hilke <jrhilke@google.com>
> Co-developed-by: Josh Hilke <jrhilke@google.com>

Checkpatch.

> @@ -162,6 +170,8 @@ int main(int argc, char **argv)
>
> kvm_assign_irqfd(vm, gsi, device->msi_eventfds[msi]);
>
> + sync_global_to_guest(vm, block);
> +
> for (i = 0; i < nr_vcpus; i++)
> pthread_create(&vcpu_threads[i], NULL, vcpu_thread_main, vcpus[i]);
>
> @@ -226,6 +236,11 @@ int main(int argc, char **argv)
> WRITE_TO_GUEST(vm, done, true);
>
> for (i = 0; i < nr_vcpus; i++) {

Please add a comment explaining what this is doing.

> + if (block) {
> + kvm_route_msi(vm, gsi, vcpus[i], vector);
> + send_msi(device, msi);
> + }
> +
> pthread_join(vcpu_threads[i], NULL);
> }
>
> --
> 2.53.0.1118.gaef5881109-goog
>