[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220311055056.57265-99-seanjc@google.com>
Date: Fri, 11 Mar 2022 05:50:49 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: linux-kernel@...r.kernel.org
Cc: Sean Christopherson <seanjc@...gle.com>
Subject: [RFC PATCH 098/105] KVM: selftests: Convert get-reg-list away from VCPU_ID
Signed-off-by: Sean Christopherson <seanjc@...gle.com>
---
tools/testing/selftests/kvm/aarch64/get-reg-list.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
index f486223ac98c..56da85f3851b 100644
--- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
+++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
@@ -406,6 +406,7 @@ static void run_test(struct vcpu_config *c)
struct kvm_vcpu_init init = { .target = -1, };
int new_regs = 0, missing_regs = 0, i, n;
int failed_get = 0, failed_set = 0, failed_reject = 0;
+ struct kvm_vcpu *vcpu;
struct kvm_vm *vm;
struct reg_sublist *s;
@@ -413,10 +414,10 @@ static void run_test(struct vcpu_config *c)
vm = vm_create(DEFAULT_GUEST_PHY_PAGES);
prepare_vcpu_init(c, &init);
- aarch64_vcpu_add(vm, 0, &init, NULL);
- finalize_vcpu(vm, 0, c);
+ vcpu = aarch64_vcpu_add(vm, 0, &init, NULL);
+ finalize_vcpu(vm, vcpu->id, c);
- reg_list = vcpu_get_reg_list(vm, 0);
+ reg_list = vcpu_get_reg_list(vm, vcpu->id);
if (fixup_core_regs)
core_reg_fixup();
@@ -452,7 +453,7 @@ static void run_test(struct vcpu_config *c)
bool reject_reg = false;
int ret;
- ret = __vcpu_ioctl(vm, 0, KVM_GET_ONE_REG, ®);
+ ret = __vcpu_ioctl(vm, vcpu->id, KVM_GET_ONE_REG, ®);
if (ret) {
printf("%s: Failed to get ", config_name(c));
print_reg(c, reg.id);
@@ -464,7 +465,7 @@ static void run_test(struct vcpu_config *c)
for_each_sublist(c, s) {
if (s->rejects_set && find_reg(s->rejects_set, s->rejects_set_n, reg.id)) {
reject_reg = true;
- ret = __vcpu_ioctl(vm, 0, KVM_SET_ONE_REG, ®);
+ ret = __vcpu_ioctl(vm, vcpu->id, KVM_SET_ONE_REG, ®);
if (ret != -1 || errno != EPERM) {
printf("%s: Failed to reject (ret=%d, errno=%d) ", config_name(c), ret, errno);
print_reg(c, reg.id);
@@ -476,7 +477,7 @@ static void run_test(struct vcpu_config *c)
}
if (!reject_reg) {
- ret = __vcpu_ioctl(vm, 0, KVM_SET_ONE_REG, ®);
+ ret = __vcpu_ioctl(vm, vcpu->id, KVM_SET_ONE_REG, ®);
if (ret) {
printf("%s: Failed to set ", config_name(c));
print_reg(c, reg.id);
--
2.35.1.723.g4982287a31-goog
Powered by blists - more mailing lists