Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:59202 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757045AbeAHUjs (ORCPT ); Mon, 8 Jan 2018 15:39:48 -0500 Message-ID: <1515443976.13978.53.camel@decadent.org.uk> Subject: Re: [kaiser-discuss] KPTI backport to 3.16 From: Ben Hutchings To: Juerg Haefliger , stable Date: Mon, 08 Jan 2018 20:39:36 +0000 In-Reply-To: References: <1515368108.13978.37.camel@decadent.org.uk> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-2tZBmDLXXkbrID9hqqxd" Mime-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: --=-2tZBmDLXXkbrID9hqqxd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2018-01-08 at 08:10 +0100, Juerg Haefliger wrote: > Ben, >=20 > 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. >=20 > 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 see, this makes sense. > 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') Thanks! This plus obvious changes to the patches using {clear,set}_in_cr4() gets me a kernel that boots on the SNB system. > I've backported 375074cc736a to 3.13 which seems to fix this particular > issue but I'm still seeing userspace segfaults. With the above changes I'm not seeing any user-space segfaults either (so far). > 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. I've just pushed 3.16.53-rc2 to https://git.kernel.org/pub/scm/linux/kernel/git/bwh/linux-stable-rc.git Ben. --=20 Ben Hutchings This sentence contradicts itself - no actually it doesn't. --=-2tZBmDLXXkbrID9hqqxd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAlpT1wgACgkQ57/I7JWG EQm+Tw/8DJrfeNcRMH65Z2zb7dDRFtXv6tYGt5fRegxoEX2dnCWSxBIP0TXvm8qW d4ud4lpQb98vh5syvifKC5Q3/5TiXI0VaZ6KYOTEiRKDE/6PPX1nCNI/kBDWa4Gr 87SsMYQRL4Oyt9wb8OPNFNNz6EmP45j0fpeLwuRr35TX0fHDeEeB8eZwZQjz24YH FapmQ0Ev0laNPCysacwAIRyHEiFmQQWj8NRd1pLnV2p1wxnt/P879dA2lpD46QGS jVGtmOVZl4XbU5c348JQ9chMb2yf91ELdym2MS+Joe7O5hq1n883fAcBcVsmxSWt qSiN06EqL9oW3Iofr3fQfr6J+4osai0YUmZJJtrve4qG6ABN80eqE7Y6uC68rrbA iuqKC9j18esplh7R2PkJFzPtpBBL+n9Wbzl5foNeYEsiKclN78sXgPMsUQwqpj0x IjRXlp1LTmNyJG/U3svZkWUT2qQaL2qaPmDZUZ9fQe3shkMrn/JY2nW3g4r/WiMt vKR6EbNjawuCS4fCBXhOlY3WN9YTvD+ydaIAAkaUDkfOwaYF8EZB+5L502zfoAvh jOJGAUpP2SQmKtDkDcBXqNSEXcgGwBOQDpmOl9d8MqX6zbqoVbYYH7WHOmbOlmzt VvTDip9MNgtbaaboKNCb/qMkfcsjHWE5mJ4tT65/kEiW6qCuATA= =kPQ4 -----END PGP SIGNATURE----- --=-2tZBmDLXXkbrID9hqqxd--