From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbdK3PRW (ORCPT ); Thu, 30 Nov 2017 10:17:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50026 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbdK3PRV (ORCPT ); Thu, 30 Nov 2017 10:17:21 -0500 Date: Thu, 30 Nov 2017 16:17:16 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Zijlstra , Wanpeng Li Subject: Re: [PATCH v7 2/4] KVM: X86: Add Paravirt TLB Shootdown Message-ID: <20171130151715.GB1399@flask> References: <1512021674-9880-1-git-send-email-wanpeng.li@hotmail.com> <1512021674-9880-3-git-send-email-wanpeng.li@hotmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1512021674-9880-3-git-send-email-wanpeng.li@hotmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 30 Nov 2017 15:17:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-29 22:01-0800, Wanpeng Li: > From: Wanpeng Li > --- > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > @@ -498,6 +498,34 @@ static void __init kvm_apf_trap_init(void) > update_intr_gate(X86_TRAP_PF, async_page_fault); > } > > +static DEFINE_PER_CPU(cpumask_var_t, __pv_tlb_mask); > + > +static void kvm_flush_tlb_others(const struct cpumask *cpumask, > + const struct flush_tlb_info *info) > +{ > + u8 state; > + int cpu; > + struct kvm_steal_time *src; > + struct cpumask *flushmask = this_cpu_cpumask_var_ptr(__pv_tlb_mask); > + > + cpumask_copy(flushmask, cpumask); Is it impossible to call this function before the allocation? I was guessing that early_initcall might allow us to avoid a (static) condition as there is no point in calling when there are no others, but expected the worst ... thanks.