Skip to content

Commit 7d1f869

Browse files
vittyvkbonzini
authored andcommitted
Revert "KVM: Check the allocation of pv cpu mask"
The commit 0f99022 ("KVM: Check the allocation of pv cpu mask") we have in 5.9-rc5 has two issue: 1) Compilation fails for !CONFIG_SMP, see: https://bugzilla.kernel.org/show_bug.cgi?id=209285 2) This commit completely disables PV TLB flush, see https://lore.kernel.org/kvm/[email protected]/ The allocation problem is likely a theoretical one, if we don't have memory that early in boot process we're likely doomed anyway. Let's solve it properly later. This reverts commit 0f99022. Signed-off-by: Vitaly Kuznetsov <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 37f66bb commit 7d1f869

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

arch/x86/kernel/kvm.c

+3-19
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ static void __init kvm_guest_init(void)
652652
}
653653

654654
if (pv_tlb_flush_supported()) {
655+
pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
655656
pv_ops.mmu.tlb_remove_table = tlb_remove_table;
656657
pr_info("KVM setup pv remote TLB flush\n");
657658
}
@@ -764,14 +765,6 @@ static __init int activate_jump_labels(void)
764765
}
765766
arch_initcall(activate_jump_labels);
766767

767-
static void kvm_free_pv_cpu_mask(void)
768-
{
769-
unsigned int cpu;
770-
771-
for_each_possible_cpu(cpu)
772-
free_cpumask_var(per_cpu(__pv_cpu_mask, cpu));
773-
}
774-
775768
static __init int kvm_alloc_cpumask(void)
776769
{
777770
int cpu;
@@ -790,20 +783,11 @@ static __init int kvm_alloc_cpumask(void)
790783

791784
if (alloc)
792785
for_each_possible_cpu(cpu) {
793-
if (!zalloc_cpumask_var_node(
794-
per_cpu_ptr(&__pv_cpu_mask, cpu),
795-
GFP_KERNEL, cpu_to_node(cpu))) {
796-
goto zalloc_cpumask_fail;
797-
}
786+
zalloc_cpumask_var_node(per_cpu_ptr(&__pv_cpu_mask, cpu),
787+
GFP_KERNEL, cpu_to_node(cpu));
798788
}
799789

800-
apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself;
801-
pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
802790
return 0;
803-
804-
zalloc_cpumask_fail:
805-
kvm_free_pv_cpu_mask();
806-
return -ENOMEM;
807791
}
808792
arch_initcall(kvm_alloc_cpumask);
809793

0 commit comments

Comments
 (0)