Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751147AbcDNTLU (ORCPT ); Thu, 14 Apr 2016 15:11:20 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35098 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbcDNTLT (ORCPT ); Thu, 14 Apr 2016 15:11:19 -0400 Message-ID: <1460661066.4560.19.camel@decadent.org.uk> Subject: Re: [PATCH 3.16.y-ckt 17/17] Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors From: Ben Hutchings To: "K. Y. Srinivasan" , Vitaly Kuznetsov Cc: Greg Kroah-Hartman , Chas Williams <3chas3@gmail.com>, Luis Henriques , linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Date: Thu, 14 Apr 2016 20:11:06 +0100 In-Reply-To: <1460484484-22395-18-git-send-email-luis.henriques@canonical.com> References: <1460484484-22395-1-git-send-email-luis.henriques@canonical.com> <1460484484-22395-18-git-send-email-luis.henriques@canonical.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-TQ+Nga5PLSRSXuMeGbyg" X-Mailer: Evolution 3.18.5.1-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3263 Lines: 88 --=-TQ+Nga5PLSRSXuMeGbyg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2016-04-12 at 19:08 +0100, Luis Henriques wrote: > 3.16.7-ckt27 -stable review patch.=C2=A0=C2=A0If anyone has any objection= s, please let me know. >=20 > ---8<------------------------------------------------------------ >=20 > From: Vitaly Kuznetsov >=20 > commit e513229b4c386e6c9f66298c13fde92f73e6e1ac upstream. >=20 > When an SMP Hyper-V guest is running on top of 2012R2 Server and secondar= y > cpus are sent offline (with echo 0 > /sys/devices/system/cpu/cpu$cpu/onli= ne) > the system freeze is observed. This happens due to the fact that on newer > hypervisors (Win8, WS2012R2, ...) vmbus channel handlers are distributed > across all cpus (see init_vp_index() function in drivers/hv/channel_mgmt.= c) > and on cpu offlining nobody reassigns them to CPU0. Prevent cpu offlining > when vmbus is loaded until the issue is fixed host-side. >=20 > This patch also disables hibernation but it is OK as it is also broken (M= CE > error is hit on resume). Suspend still works. [...] > +static void hv_cpu_hotplug_quirk(bool vmbus_loaded) > +{ > + static void *previous_cpu_disable; > + > + /* > + =C2=A0* Offlining a CPU when running on newer hypervisors (WS2012R2, Wi= n8, > + =C2=A0* ...) is not supported at this moment as channel interrupts are > + =C2=A0* distributed across all of them. > + =C2=A0*/ > + > + if ((vmbus_proto_version =3D=3D VERSION_WS2008) || > + =C2=A0=C2=A0=C2=A0=C2=A0(vmbus_proto_version =3D=3D VERSION_WIN7)) > + return; > + > + if (vmbus_loaded) { > + previous_cpu_disable =3D smp_ops.cpu_disable; > + smp_ops.cpu_disable =3D hyperv_cpu_disable; > + pr_notice("CPU offlining is not supported by hypervisor\n"); > + } else if (previous_cpu_disable) > + smp_ops.cpu_disable =3D previous_cpu_disable; [...] This is a really bad hack. =C2=A0What if two different drivers patched smp_ops and got unloaded in a different order? =C2=A0Perhaps the core support code for Hyper-V should define its own smp_ops. I don't want to stop this going into stable, but seriously, please clean this up. Ben. --=20 Ben Hutchings In a hierarchy, every employee tends to rise to his level of incompetence. --=-TQ+Nga5PLSRSXuMeGbyg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJXD+tKAAoJEOe/yOyVhhEJ9IYP/i8KaLtiU70fHQTeJc2G6FrK KAQJRaXcAVE+yz3RXkSE9FgcgLIjnHHo48zSUCJg9cFsqAUv2WhIpDkiAZR5J9XE cZsEb6cbznTUVlXz0QECPNeGl1FokLlHYEGIu6dKi/EQnMrTq30NEHEGJKpF1cNG cW4iyd6K0qs6MnGIGLT630Gt5+6EUeE8S/i/b0MTScOLnTcnEqXwa/46Y8GP58AX uWBLpstAcTibNRJsmvMFRrUxN1i3Q1dyCCZcYWdfh6PGc4mjrzAHFCcrDlhsBmDl GZ/9SESHe3Pifon6ige1XRvk0Q9ZZIVk8kjDfBiMY7QhOmuxx8wrlSR9dSRNNTDF cVbA7D1gQEv6zres2eSiTNEFct9Akb6jBHYWn86aIGivvqokg8JS0sRMZBFTEZqf Ngvz0EZSzyuErKEwAV5LWJP37skm8hFkmS26hhxGpTdnhv1dP54f0y3IdwOd7BK4 IQ+HAX8644BpFnsBnkBF8m1vJdIbvPC6zugW5VNf1tWWnTIuOepuuyvhWbqS4d0c gyWtmMj4baezp7Pcq9JL22WzSo4AjVdeeoBgj03ynuigfFF3PVamk8qrRBnLKjln WP6ysTlScvFOpZRJuxaiqopgs9bQS6GitZZB+ZPqx5dPYPur3FmkeL2/WvjNrDW5 1R/8BC2MlTlxJ3vIAyDI =OO7x -----END PGP SIGNATURE----- --=-TQ+Nga5PLSRSXuMeGbyg--