Commit ece32a75 authored by Paolo Bonzini's avatar Paolo Bonzini

Merge tag 'kvmarm-fixes-5.17-4' of...

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
parents 1a715810 456f89e0
...@@ -46,8 +46,7 @@ static unsigned long kvm_psci_vcpu_suspend(struct kvm_vcpu *vcpu) ...@@ -46,8 +46,7 @@ static unsigned long kvm_psci_vcpu_suspend(struct kvm_vcpu *vcpu)
* specification (ARM DEN 0022A). This means all suspend states * specification (ARM DEN 0022A). This means all suspend states
* for KVM will preserve the register state. * for KVM will preserve the register state.
*/ */
kvm_vcpu_halt(vcpu); kvm_vcpu_wfi(vcpu);
kvm_clear_request(KVM_REQ_UNHALT, vcpu);
return PSCI_RET_SUCCESS; return PSCI_RET_SUCCESS;
} }
......
...@@ -366,6 +366,7 @@ static struct kvm_vm *test_vm_create(void) ...@@ -366,6 +366,7 @@ static struct kvm_vm *test_vm_create(void)
{ {
struct kvm_vm *vm; struct kvm_vm *vm;
unsigned int i; unsigned int i;
int ret;
int nr_vcpus = test_args.nr_vcpus; int nr_vcpus = test_args.nr_vcpus;
vm = vm_create_default_with_vcpus(nr_vcpus, 0, 0, guest_code, NULL); 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) ...@@ -382,7 +383,11 @@ static struct kvm_vm *test_vm_create(void)
ucall_init(vm, NULL); ucall_init(vm, NULL);
test_init_timer_irq(vm); test_init_timer_irq(vm);
vgic_v3_setup(vm, nr_vcpus, 64, GICD_BASE_GPA, GICR_BASE_GPA); ret = vgic_v3_setup(vm, nr_vcpus, 64, GICD_BASE_GPA, GICR_BASE_GPA);
if (ret < 0) {
print_skip("Failed to create vgic-v3");
exit(KSFT_SKIP);
}
/* Make all the test's cmdline args visible to the guest */ /* Make all the test's cmdline args visible to the guest */
sync_global_to_guest(vm, test_args); sync_global_to_guest(vm, test_args);
......
...@@ -761,6 +761,10 @@ static void test_vgic(uint32_t nr_irqs, bool level_sensitive, bool eoi_split) ...@@ -761,6 +761,10 @@ static void test_vgic(uint32_t nr_irqs, bool level_sensitive, bool eoi_split)
gic_fd = vgic_v3_setup(vm, 1, nr_irqs, gic_fd = vgic_v3_setup(vm, 1, nr_irqs,
GICD_BASE_GPA, GICR_BASE_GPA); GICD_BASE_GPA, GICR_BASE_GPA);
if (gic_fd < 0) {
print_skip("Failed to create vgic-v3, skipping");
exit(KSFT_SKIP);
}
vm_install_exception_handler(vm, VECTOR_IRQ_CURRENT, vm_install_exception_handler(vm, VECTOR_IRQ_CURRENT,
guest_irq_handlers[args.eoi_split][args.level_sensitive]); guest_irq_handlers[args.eoi_split][args.level_sensitive]);
......
...@@ -52,7 +52,9 @@ int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs, ...@@ -52,7 +52,9 @@ int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs,
nr_vcpus, nr_vcpus_created); nr_vcpus, nr_vcpus_created);
/* Distributor setup */ /* Distributor setup */
gic_fd = kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3, false); if (_kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3,
false, &gic_fd) != 0)
return -1;
kvm_device_access(gic_fd, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, kvm_device_access(gic_fd, KVM_DEV_ARM_VGIC_GRP_NR_IRQS,
0, &nr_irqs, true); 0, &nr_irqs, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment