]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Stop hardcoding vCPU IDs in vcpu_width_config
authorSean Christopherson <seanjc@google.com>
Wed, 20 Apr 2022 19:15:50 +0000 (12:15 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 15:47:18 +0000 (11:47 -0400)
commitb34f64728b53ac8971cfe36ad3b92a1d88f56a45
tree3450b99bb038639d92fc4d9bfcb6e7efa3868e42
parentced96baef8543f7e4b2f4687e67f5644fff51386
KVM: selftests: Stop hardcoding vCPU IDs in vcpu_width_config

In preparation for taking a vCPU pointer in vCPU-scoped functions, grab
the vCPU(s) created by __vm_vcpu_add() and use the ID from the vCPU
object instead of hardcoding the ID in ioctl() invocations.

Rename init1/init2 => init0/init1 to avoid having odd/confusing code
where vcpu0 consumes init1 and vcpu1 consumes init2.

Note, this change could easily be done when the functions are converted
in the future, and/or the vcpu{0,1} vs. init{1,2} discrepancy could be
ignored, but then there would be no opportunity to poke fun at the
1-based counting scheme.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/aarch64/vcpu_width_config.c