Skip to content

Commit ece32a7

Browse files
committed
Merge tag 'kvmarm-fixes-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 fixes for 5.17, take #4 - Correctly synchronise PMR and co on PSCI CPU_SUSPEND - Skip tests that depend on GICv3 when the HW isn't available
2 parents 1a71581 + 456f89e commit ece32a7

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

arch/arm64/kvm/psci.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ static unsigned long kvm_psci_vcpu_suspend(struct kvm_vcpu *vcpu)
4646
* specification (ARM DEN 0022A). This means all suspend states
4747
* for KVM will preserve the register state.
4848
*/
49-
kvm_vcpu_halt(vcpu);
50-
kvm_clear_request(KVM_REQ_UNHALT, vcpu);
49+
kvm_vcpu_wfi(vcpu);
5150

5251
return PSCI_RET_SUCCESS;
5352
}

tools/testing/selftests/kvm/aarch64/arch_timer.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ static struct kvm_vm *test_vm_create(void)
366366
{
367367
struct kvm_vm *vm;
368368
unsigned int i;
369+
int ret;
369370
int nr_vcpus = test_args.nr_vcpus;
370371

371372
vm = vm_create_default_with_vcpus(nr_vcpus, 0, 0, guest_code, NULL);
@@ -382,7 +383,11 @@ static struct kvm_vm *test_vm_create(void)
382383

383384
ucall_init(vm, NULL);
384385
test_init_timer_irq(vm);
385-
vgic_v3_setup(vm, nr_vcpus, 64, GICD_BASE_GPA, GICR_BASE_GPA);
386+
ret = vgic_v3_setup(vm, nr_vcpus, 64, GICD_BASE_GPA, GICR_BASE_GPA);
387+
if (ret < 0) {
388+
print_skip("Failed to create vgic-v3");
389+
exit(KSFT_SKIP);
390+
}
386391

387392
/* Make all the test's cmdline args visible to the guest */
388393
sync_global_to_guest(vm, test_args);

tools/testing/selftests/kvm/aarch64/vgic_irq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,10 @@ static void test_vgic(uint32_t nr_irqs, bool level_sensitive, bool eoi_split)
761761

762762
gic_fd = vgic_v3_setup(vm, 1, nr_irqs,
763763
GICD_BASE_GPA, GICR_BASE_GPA);
764+
if (gic_fd < 0) {
765+
print_skip("Failed to create vgic-v3, skipping");
766+
exit(KSFT_SKIP);
767+
}
764768

765769
vm_install_exception_handler(vm, VECTOR_IRQ_CURRENT,
766770
guest_irq_handlers[args.eoi_split][args.level_sensitive]);

tools/testing/selftests/kvm/lib/aarch64/vgic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs,
5252
nr_vcpus, nr_vcpus_created);
5353

5454
/* Distributor setup */
55-
gic_fd = kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3, false);
55+
if (_kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3,
56+
false, &gic_fd) != 0)
57+
return -1;
5658

5759
kvm_device_access(gic_fd, KVM_DEV_ARM_VGIC_GRP_NR_IRQS,
5860
0, &nr_irqs, true);

0 commit comments

Comments
 (0)