From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34527C31E45 for ; Thu, 13 Jun 2019 19:01:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 169F120B7C for ; Thu, 13 Jun 2019 19:01:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729146AbfFMTB2 (ORCPT ); Thu, 13 Jun 2019 15:01:28 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36126 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbfFMTB2 (ORCPT ); Thu, 13 Jun 2019 15:01:28 -0400 Received: from p5b06daab.dip0.t-ipconnect.de ([91.6.218.171] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hbUy1-0000Pv-7Q; Thu, 13 Jun 2019 21:00:57 +0200 Date: Thu, 13 Jun 2019 21:00:56 +0200 (CEST) From: Thomas Gleixner To: Vitaly Kuznetsov cc: Dmitry Safonov , linux-kernel@vger.kernel.org, Prasanna Panchamukhi , Andy Lutomirski , Borislav Petkov , Cathy Avery , Haiyang Zhang , "H. Peter Anvin" , Ingo Molnar , "K. Y. Srinivasan" , "Michael Kelley (EOSG)" , Mohammed Gamal , Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , Roman Kagan , Sasha Levin , Stephen Hemminger , devel@linuxdriverproject.org, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector In-Reply-To: <8736kff6q3.fsf@vitty.brq.redhat.com> Message-ID: References: <20190611212003.26382-1-dima@arista.com> <8736kff6q3.fsf@vitty.brq.redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Jun 2019, Vitaly Kuznetsov wrote: > Dmitry Safonov writes: > > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > > index 1608050e9df9..0bdd79ecbff8 100644 > > --- a/arch/x86/hyperv/hv_init.c > > +++ b/arch/x86/hyperv/hv_init.c > > @@ -91,7 +91,7 @@ EXPORT_SYMBOL_GPL(hv_max_vp_index); > > static int hv_cpu_init(unsigned int cpu) > > { > > u64 msr_vp_index; > > - struct hv_vp_assist_page **hvp = &hv_vp_assist_page[smp_processor_id()]; > > + struct hv_vp_assist_page **hvp = &hv_vp_assist_page[cpu]; > > void **input_arg; > > struct page *pg; > > > > @@ -103,7 +103,7 @@ static int hv_cpu_init(unsigned int cpu) > > > > hv_get_vp_index(msr_vp_index); > > > > - hv_vp_index[smp_processor_id()] = msr_vp_index; > > + hv_vp_index[cpu] = msr_vp_index; > > > > if (msr_vp_index > hv_max_vp_index) > > hv_max_vp_index = msr_vp_index; > > The above is unrelated cleanup (as cpu == smp_processor_id() for > CPUHP_AP_ONLINE_DYN callbacks), right? As I'm pretty sure these can'd be > preempted. They can be preempted, but they are guaranteed to run on the upcoming CPU, i.e. smp_processor_id() is allowed even in preemptible context as the task cannot migrate. Thanks, tglx