Re: [PATCH] x86/kvm: Don't alloc __pv_cpu_mask when !CONFIG_SMP

From: Wanpeng Li
Date: Thu Apr 08 2021 - 23:03:21 EST


On Fri, 9 Apr 2021 at 04:20, Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Wed, Apr 07, 2021, Wanpeng Li wrote:
> > From: Wanpeng Li <wanpengli@xxxxxxxxxxx>
> >
> > Enable PV TLB shootdown when !CONFIG_SMP doesn't make sense. Let's move
> > it inside CONFIG_SMP. In addition, we can avoid alloc __pv_cpu_mask when
> > !CONFIG_SMP and get rid of 'alloc' variable in kvm_alloc_cpumask.
>
> ...
>
> > +static bool pv_tlb_flush_supported(void) { return false; }
> > +static bool pv_ipi_supported(void) { return false; }
> > +static void kvm_flush_tlb_others(const struct cpumask *cpumask,
> > + const struct flush_tlb_info *info) { }
> > +static void kvm_setup_pv_ipi(void) { }
>
> If you shuffle things around a bit more, you can avoid these stubs, and hide the
> definition of __pv_cpu_mask behind CONFIG_SMP, too.

Thanks, I will move around.

Wanpeng