On Thu, Feb 26, 2026 at 08:32:33AM +0000, Jiakai Xu wrote:
...
> +static void check_steal_time_uapi(struct kvm_vcpu *vcpu)
> +{
> +     struct kvm_vm *vm = vcpu->vm;
> +     struct kvm_vcpu *tmp_vcpu = vm_vcpu_add(vm, NR_VCPUS, guest_code);

We probably get away with adding NR_VCPUS+1 vcpus to a vm which was
created with NR_VCPUS because we don't run it and rlimits happen to
work out, but that's pretty fragile and not a correct use of the APIs.
So, we should also create a throw-away vm,

 vm_create_with_one_vcpu()
 ...
 kvm_vm_free()


And, even if some archs don't require the temporary vm/vcpu we can use
that same pattern for all of them. So, check_steal_time_uapi() doesn't
need to take any parameters.

Thanks,
drew

Reply via email to