Skip to content

Commit b78f4a5

Browse files
Ricardo KollerMarc Zyngier
authored andcommitted
KVM: selftests: Rename vm_handle_exception
Rename the vm_handle_exception function to a name that indicates more clearly that it installs something: vm_install_exception_handler. Reported-by: kernel test robot <oliver.sang@intel.com> Suggested-by: Marc Zyngier <maz@kernel.org> Suggested-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Ricardo Koller <ricarkol@google.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210611011020.3420067-2-ricarkol@google.com
1 parent 8124c8a commit b78f4a5

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

tools/testing/selftests/kvm/include/x86_64/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ struct ex_regs {
391391

392392
void vm_init_descriptor_tables(struct kvm_vm *vm);
393393
void vcpu_init_descriptor_tables(struct kvm_vm *vm, uint32_t vcpuid);
394-
void vm_handle_exception(struct kvm_vm *vm, int vector,
394+
void vm_install_exception_handler(struct kvm_vm *vm, int vector,
395395
void (*handler)(struct ex_regs *));
396396

397397
/*

tools/testing/selftests/kvm/lib/x86_64/processor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,8 @@ void vcpu_init_descriptor_tables(struct kvm_vm *vm, uint32_t vcpuid)
12441244
*(vm_vaddr_t *)addr_gva2hva(vm, (vm_vaddr_t)(&exception_handlers)) = vm->handlers;
12451245
}
12461246

1247-
void vm_handle_exception(struct kvm_vm *vm, int vector,
1248-
void (*handler)(struct ex_regs *))
1247+
void vm_install_exception_handler(struct kvm_vm *vm, int vector,
1248+
void (*handler)(struct ex_regs *))
12491249
{
12501250
vm_vaddr_t *handlers = (vm_vaddr_t *)addr_gva2hva(vm, vm->handlers);
12511251

tools/testing/selftests/kvm/x86_64/evmcs_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ int main(int argc, char *argv[])
154154

155155
vm_init_descriptor_tables(vm);
156156
vcpu_init_descriptor_tables(vm, VCPU_ID);
157-
vm_handle_exception(vm, UD_VECTOR, guest_ud_handler);
158-
vm_handle_exception(vm, NMI_VECTOR, guest_nmi_handler);
157+
vm_install_exception_handler(vm, UD_VECTOR, guest_ud_handler);
158+
vm_install_exception_handler(vm, NMI_VECTOR, guest_nmi_handler);
159159

160160
pr_info("Running L1 which uses EVMCS to run L2\n");
161161

tools/testing/selftests/kvm/x86_64/kvm_pv_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int main(void)
227227

228228
vm_init_descriptor_tables(vm);
229229
vcpu_init_descriptor_tables(vm, VCPU_ID);
230-
vm_handle_exception(vm, GP_VECTOR, guest_gp_handler);
230+
vm_install_exception_handler(vm, GP_VECTOR, guest_gp_handler);
231231

232232
enter_guest(vm);
233233
kvm_vm_free(vm);

tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ static void test_msr_filter_allow(void) {
574574
vm_init_descriptor_tables(vm);
575575
vcpu_init_descriptor_tables(vm, VCPU_ID);
576576

577-
vm_handle_exception(vm, GP_VECTOR, guest_gp_handler);
577+
vm_install_exception_handler(vm, GP_VECTOR, guest_gp_handler);
578578

579579
/* Process guest code userspace exits. */
580580
run_guest_then_process_rdmsr(vm, MSR_IA32_XSS);
@@ -588,12 +588,12 @@ static void test_msr_filter_allow(void) {
588588
run_guest_then_process_wrmsr(vm, MSR_NON_EXISTENT);
589589
run_guest_then_process_rdmsr(vm, MSR_NON_EXISTENT);
590590

591-
vm_handle_exception(vm, UD_VECTOR, guest_ud_handler);
591+
vm_install_exception_handler(vm, UD_VECTOR, guest_ud_handler);
592592
run_guest(vm);
593-
vm_handle_exception(vm, UD_VECTOR, NULL);
593+
vm_install_exception_handler(vm, UD_VECTOR, NULL);
594594

595595
if (process_ucall(vm) != UCALL_DONE) {
596-
vm_handle_exception(vm, GP_VECTOR, guest_fep_gp_handler);
596+
vm_install_exception_handler(vm, GP_VECTOR, guest_fep_gp_handler);
597597

598598
/* Process emulated rdmsr and wrmsr instructions. */
599599
run_guest_then_process_rdmsr(vm, MSR_IA32_XSS);

tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ int main(int argc, char *argv[])
462462

463463
vm_init_descriptor_tables(vm);
464464
vcpu_init_descriptor_tables(vm, HALTER_VCPU_ID);
465-
vm_handle_exception(vm, IPI_VECTOR, guest_ipi_handler);
465+
vm_install_exception_handler(vm, IPI_VECTOR, guest_ipi_handler);
466466

467467
virt_pg_map(vm, APIC_DEFAULT_GPA, APIC_DEFAULT_GPA, 0);
468468

0 commit comments

Comments
 (0)