Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754078AbdLNWcY (ORCPT ); Thu, 14 Dec 2017 17:32:24 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:59163 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753864AbdLNWcT (ORCPT ); Thu, 14 Dec 2017 17:32:19 -0500 Date: Thu, 14 Dec 2017 23:32:17 +0100 From: Pavel Machek To: Andy Lutomirski Cc: X86 ML , Borislav Petkov , "linux-kernel@vger.kernel.org" , "Rafael J. Wysocki" , Zhang Rui , Jarkko Nikula , Linus Torvalds , Josh Poimboeuf Subject: Re: [PATCH urgent 3/3] x86/power: Make restore_processor_context() sane Message-ID: <20171214223217.GA10525@amd> References: <398ee68e5c0f766425a7b746becfc810840770ff.1513286253.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <398ee68e5c0f766425a7b746becfc810840770ff.1513286253.git.luto@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1848 Lines: 54 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > My previous attempt to fix a couple of bugs in > __restore_processor_context() introduced yet another bug. Rather > than trying to come up with a minimal fix, let's try to clean it up > for real. This patch fixes quite a few things: >=20 > - The old code saved a nonsensical subset of segment registers. > The only registers that need to be saved are those that contain > userspace state or those that can't be trivially restored without > percpu access working. (On x86_32, we can restore percpu access > by writing __KERNEL_PERCPU to %fs. On x86_64, it's easier to > save and restore the kernel's GSBASE.) With this patch, we > restore hardcoded values to the kernel state where applicable and > explicitly restore the user state after fixing all the descriptor > tables. >=20 > - We used to use an unholy mix of inline asm and C helpers for > segment register access. Let's get rid of the inline asm. >=20 > Tested-by: Jarkko Nikula > Fixes: 5b06bbcfc2c6 ("x86/power: Fix some ordering bugs in __restore_proc= essor_context()") > Signed-off-by: Andy Lutomirski Thanks! Tested-by: Pavel Machek Reported-by: Pavel Machek --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAloy+/EACgkQMOfwapXb+vIB7QCeJLUFblDJ/pw/7wojYnguZUQf N5YAnRSx9d2l9V6R1CX4Nx57D59+VYXF =aDdS -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--