linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Andy Lutomirski <luto@kernel.org>
Cc: X86 ML <x86@kernel.org>, Borislav Petkov <bpetkov@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Zhang Rui <rui.zhang@intel.com>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH urgent 3/3] x86/power: Make restore_processor_context() sane
Date: Thu, 14 Dec 2017 23:32:17 +0100	[thread overview]
Message-ID: <20171214223217.GA10525@amd> (raw)
In-Reply-To: <398ee68e5c0f766425a7b746becfc810840770ff.1513286253.git.luto@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

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:
> 
>  - 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.
> 
>  - 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.
> 
> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> Fixes: 5b06bbcfc2c6 ("x86/power: Fix some ordering bugs in __restore_processor_context()")
> Signed-off-by: Andy Lutomirski <luto@kernel.org>

Thanks!

Tested-by: Pavel Machek <pavel@ucw.cz>
Reported-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2017-12-14 22:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 21:19 [PATCH urgent 0/3] __restore_processor_state() fixes Andy Lutomirski
2017-12-14 21:19 ` [PATCH urgent 1/3] x86/power/64: Use struct desc_ptr for the IDT in struct saved_context Andy Lutomirski
2017-12-15 14:37   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2017-12-14 21:19 ` [PATCH urgent 2/3] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context() Andy Lutomirski
2017-12-15 14:38   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2017-12-14 21:19 ` [PATCH urgent 3/3] x86/power: Make restore_processor_context() sane Andy Lutomirski
2017-12-14 22:32   ` Pavel Machek [this message]
2017-12-15 14:38   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2017-12-15  1:28 ` [PATCH urgent 0/3] __restore_processor_state() fixes Rafael J. Wysocki
2017-12-15  1:35   ` Linus Torvalds
2017-12-15 11:21     ` Ingo Molnar
2017-12-15  9:18   ` Jarkko Nikula
2017-12-15 11:31     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171214223217.GA10525@amd \
    --to=pavel@ucw.cz \
    --cc=bpetkov@suse.de \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).