Return-Path: Received: from youngberry.canonical.com ([91.189.89.112]:49459 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755755AbeAHHK0 (ORCPT ); Mon, 8 Jan 2018 02:10:26 -0500 Received: from mail-wm0-f70.google.com ([74.125.82.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1eYRZh-0003xr-EV for stable@vger.kernel.org; Mon, 08 Jan 2018 07:10:25 +0000 Received: by mail-wm0-f70.google.com with SMTP id g1so5292937wmd.0 for ; Sun, 07 Jan 2018 23:10:25 -0800 (PST) Subject: Re: [kaiser-discuss] KPTI backport to 3.16 To: Ben Hutchings , stable References: <1515368108.13978.37.camel@decadent.org.uk> From: Juerg Haefliger Message-ID: Date: Mon, 8 Jan 2018 08:10:23 +0100 MIME-Version: 1.0 In-Reply-To: <1515368108.13978.37.camel@decadent.org.uk> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aFHrsn4VOPbhS38qE7vmlhNofxxIGgIzM" Sender: stable-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aFHrsn4VOPbhS38qE7vmlhNofxxIGgIzM Content-Type: multipart/mixed; boundary="tUtzCzk1yF6pIZO6yFEhW2lVPgvamA5hk"; protected-headers="v1" From: Juerg Haefliger To: Ben Hutchings , stable Message-ID: Subject: Re: [kaiser-discuss] KPTI backport to 3.16 References: <1515368108.13978.37.camel@decadent.org.uk> In-Reply-To: <1515368108.13978.37.camel@decadent.org.uk> --tUtzCzk1yF6pIZO6yFEhW2lVPgvamA5hk Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Ben, On 01/08/2018 12:35 AM, Ben Hutchings wrote: > I have a backport of KPTI/KAISER to 3.16, based on Hugh Dickins's work > for 3.18, some upstream changes between 3.16 and 3.18, and other > patches that went into 4.4.75. >=20 > I sent this out for review on the stable list after quite minimal > testing, but have done more since then. On bare metal (Sandy Bridge, > with pcid but not invpcid) it crashes at boot. In fact it > reboots without any panic message, suggesting a triple fault, as soon > as I apply the patch that turns on CR4.PCIDE, i.e. without KPTI itself.= I've seen this as well with my 3.13 tree. As soon as PCID is set on the first (non-boot) CPU, the kernel reboots. Note that it seems to work fine with maxcpus=3D1. I've checked the other versions, your 3.2 doesn't have this issue and Hugh's 3.18 doesn't have it either. After some bisecting, I found that the problem was introduced in 3.15 by: cda846f101fb ('x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline') and then later fixed again in 4.0 by: 375074cc736a ('x86: Clean up cr4 manipulation') I've backported 375074cc736a to 3.13 which seems to fix this particular issue but I'm still seeing userspace segfaults. FWIW: My tree: https://code.launchpad.net/~juergh/+git/linux-pti pti/3.13 is my 3.13 tree, pti/3.2.97-bwh and pti/3.16.52-bwh are yours and pti/3.18.72 is Hugh's. =2E..Juerg > Using the 'nopcid' kernel parameter gets it to boot but it's somewhat > unstable even after that - once I start another kernel build I see > programs segfaulting. So I'm guessing I've screwed up some of the TLB > stuff. >=20 > I'm going to continue investigating this myself before making a > release, but would really appreciate any time people can spare to > review this patch series. >=20 > (I haven't found any such regression in 3.2.98.) >=20 > Ben. >=20 --tUtzCzk1yF6pIZO6yFEhW2lVPgvamA5hk-- --aFHrsn4VOPbhS38qE7vmlhNofxxIGgIzM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQI7BAEBCAAlBQJaUxlfHhxqdWVyZy5oYWVmbGlnZXJAY2Fub25pY2FsLmNvbQAK CRB1TDqW+fi0jK0mD/4t/DGa2ZVAgKMPLuNwnJHkTOI/k0oO1HmSzcMGmgr2Kiv2 UHDmv/b2K3Vv1R1Pfik+sMtpf4FlTqTq61c36YzJRJUCdyArqHaXEk9ms95dZF0R bniugnEteGMUQh31O8pqjTvKreBX3tmFAuUlwawu7dJeQsLFZktZJUkB+p8Rox9M LhDB/ggLMv/mU4zy4YrB3YTPqjOxeUqktMy/X1djLQlswYZOcYWkCPNomS39/qOr 0KQjIvMsNEF+IZVZFc7pqhFQoGyE9eGDxFza7YXWlukzF+ynDADlVEG3aowdVcYF HsqKo2kiZ5a0llC3k1U07lvWE66HzBmrcRE7mprLLw6Ya6w5QtoAYHEecUL7ENgV KRkcgtKl6avNzbOMOS4TcVKowAZzbgirK6j5NieGcXRyapSvVpBRVY1KuWCtGMqW MJ41Ynm0lYHeQIng2WufYN6PjHKx27ZB84StqmSJZWi1pCQoULl+f+83ZuC+5hO7 0/fGebZpPT3Mxq2zE6CP0bFq70y/Mnxs4eKsNFGN3ETVMAGedhlLhy3jHJR8WRzN HV7x5IRzw3ZglqAZkPzTAZRYEmqPB0J2sX+uyn8MIAjiAZOSYxq/nkFFLMaoExsS GLctjUjxCcNrc9VfyrwCvEekUneBCbqQQ1iKni/08AsKCL6CyHjkL2voKQqxng== =e+N4 -----END PGP SIGNATURE----- --aFHrsn4VOPbhS38qE7vmlhNofxxIGgIzM--