From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055AbeANUov (ORCPT + 1 other); Sun, 14 Jan 2018 15:44:51 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:38432 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752141AbeANUou (ORCPT ); Sun, 14 Jan 2018 15:44:50 -0500 Date: Sun, 14 Jan 2018 21:44:38 +0100 (CET) From: Thomas Gleixner To: Vitaly Kuznetsov cc: kvm@vger.kernel.org, x86@kernel.org, Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , Ingo Molnar , "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Andy Lutomirski , Mohammed Gamal , Cathy Avery , Roman Kagan , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org Subject: Re: [PATCH v2 4/7] x86/hyper-v: redirect reenlightment notifications on CPU offlining In-Reply-To: <20171213150945.24054-5-vkuznets@redhat.com> Message-ID: References: <20171213150945.24054-1-vkuznets@redhat.com> <20171213150945.24054-5-vkuznets@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, 13 Dec 2017, Vitaly Kuznetsov wrote: > +static int hv_cpu_die(unsigned int cpu) > +{ > + struct hv_reenlightenment_control re_ctrl; > + int i; > + static DEFINE_SPINLOCK(lock); > + > + if (hv_reenlightenment_cb == NULL) > + return 0; > + > + /* Make sure the CPU we migrate to is not going away too */ > + spin_lock(&lock); What kind of voodoo is this? CPU hotplug is serialized already... > + rdmsrl(HV_X64_MSR_REENLIGHTENMENT_CONTROL, *((u64 *)&re_ctrl)); > + if (re_ctrl.target_vp == hv_vp_index[cpu]) { > + /* Find some other online CPU */ > + for_each_online_cpu(i) { cpu = cpumask_any_but(cpu_online_mask); Hmm? Thanks, tglx