Commit f44efa5a authored by Radim Krčmář's avatar Radim Krčmář

Merge tag 'kvm-arm-fixes-for-v4.15-3-v2' of...

Merge tag 'kvm-arm-fixes-for-v4.15-3-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm

KVM/ARM Fixes for v4.15, Round 3 (v2)

Three more fixes for v4.15 fixing incorrect huge page mappings on systems using
the contigious hint for hugetlbfs; supporting an alternative GICv4 init
sequence; and correctly implementing the ARM SMCC for HVC and SMC handling.
parents a8750ddc acfb3b88
...@@ -45,7 +45,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) ...@@ -45,7 +45,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
ret = kvm_psci_call(vcpu); ret = kvm_psci_call(vcpu);
if (ret < 0) { if (ret < 0) {
kvm_inject_undefined(vcpu); vcpu_set_reg(vcpu, 0, ~0UL);
return 1; return 1;
} }
...@@ -54,7 +54,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) ...@@ -54,7 +54,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run) static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run)
{ {
kvm_inject_undefined(vcpu); vcpu_set_reg(vcpu, 0, ~0UL);
return 1; return 1;
} }
......
...@@ -1310,7 +1310,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, ...@@ -1310,7 +1310,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
return -EFAULT; return -EFAULT;
} }
if (is_vm_hugetlb_page(vma) && !logging_active) { if (vma_kernel_pagesize(vma) == PMD_SIZE && !logging_active) {
hugetlb = true; hugetlb = true;
gfn = (fault_ipa & PMD_MASK) >> PAGE_SHIFT; gfn = (fault_ipa & PMD_MASK) >> PAGE_SHIFT;
} else { } else {
......
...@@ -285,9 +285,11 @@ int vgic_init(struct kvm *kvm) ...@@ -285,9 +285,11 @@ int vgic_init(struct kvm *kvm)
if (ret) if (ret)
goto out; goto out;
ret = vgic_v4_init(kvm); if (vgic_has_its(kvm)) {
if (ret) ret = vgic_v4_init(kvm);
goto out; if (ret)
goto out;
}
kvm_for_each_vcpu(i, vcpu, kvm) kvm_for_each_vcpu(i, vcpu, kvm)
kvm_vgic_vcpu_enable(vcpu); kvm_vgic_vcpu_enable(vcpu);
......
...@@ -118,7 +118,7 @@ int vgic_v4_init(struct kvm *kvm) ...@@ -118,7 +118,7 @@ int vgic_v4_init(struct kvm *kvm)
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
int i, nr_vcpus, ret; int i, nr_vcpus, ret;
if (!vgic_supports_direct_msis(kvm)) if (!kvm_vgic_global_state.has_gicv4)
return 0; /* Nothing to see here... move along. */ return 0; /* Nothing to see here... move along. */
if (dist->its_vm.vpes) if (dist->its_vm.vpes)
......
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