mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Dave Young <dyoung@redhat.com>
Cc: Yu Chen <yu.c.chen@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Juergen Gross <jgross@suse.com>, Tony Luck <tony.luck@intel.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Borislav Petkov <bp@alien8.de>, Rui Zhang <rui.zhang@intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Ingo Molnar <mingo@kernel.org>,
	Kexec Mailing List <kexec@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	ebiederm@redhat.com, Baoquan He <bhe@redhat.com>
Subject: Re: kexec reboot fails with extra wbinvd introduced for AME SME
Date: Wed, 17 Jan 2018 16:53:32 -0600	[thread overview]
Message-ID: <d60aa430-e9ce-d9f1-d66c-977a3559e338@amd.com> (raw)
In-Reply-To: <09bd24bd-480b-8075-a1c4-c5040401195a@amd.com>

On 1/17/2018 2:01 PM, Tom Lendacky wrote:
> On 1/17/2018 1:42 PM, Linus Torvalds wrote:
>> On Tue, Jan 16, 2018 at 11:22 PM, Dave Young <dyoung@redhat.com> wrote:
>>>
>>> For the kexec reboot hang, if I remove the wbinvd in stop_this_cpu()
>>> then kexec works fine. like this:
>>
>> Honestly, I think we should apply that patch regardless.
>>
>> Using 'wbinvd' should not be some "just because of random reasons".
>> There are CPU's with errata on wbinvd, and the thing in general is
>> slow and nasty.
>>
>> Doing the wbinvd in a loop sounds even stranger.
>>
>> If we're only doing it because of some SME issue, why isn't it
>> dependent on SME? And why is it inside that loop at all?
> 
> My original patches did check for X86_FEATURE_SME and only do the
> wbinvd if SME was supported (although still in the loop).  The general
> consensus was to just do the wbinvd no matter what and so it is as it is
> today.
> 
> It can probably be outside of the loop.  The issue I was seeing was
> memory corruption from the stack when using halt() with paravirt ops
> enabled.  So a native_halt() should be used.
> 
>>
>> Anyway, does it work for you if you just do the wbinvd() once, outside
>> the loop? Admittedly the loop shouldn't actually loop (hlt with
>> interrupts disabled), but who the hell knows.. Some of the errata
>> around SME have been about machine check exceptions or something.
> 
> I think that should work as long as it's a native_wbinvd() call and it
> can also be conditional on boot_cpu_has(X86_FEATURE_SME).
> 
> I'll do some testing.

Looks like everything is good with the suggested changes.  Patch to follow
shortly.

Thanks,
Tom

> 
> Thanks,
> Tom
> 
>>
>> See commit a68e5c94f7d3 ("x86, hotplug: Move WBINVD back outside the
>> play_dead loop") for another example where wbinvd was inside a loop
>> and apparently caused some odd issues.
>>
>>               Linus
>>

  reply	other threads:[~2018-01-17 22:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  2:52 Regression: kexec/kdump boot hangs with x86/vector commits Dave Young
2017-12-13 15:57 ` Yu Chen
2017-12-14  9:24   ` Dave Young
2018-01-04  3:15     ` Dave Young
2018-01-17  7:22       ` kexec reboot fails with extra wbinvd introduced for AME SME Dave Young
2018-01-17 15:06         ` Tom Lendacky
2018-01-18  1:50           ` Dave Young
2018-01-17 19:42         ` Linus Torvalds
2018-01-17 20:01           ` Tom Lendacky
2018-01-17 22:53             ` Tom Lendacky [this message]
2018-01-17 20:10           ` Linus Torvalds
2018-01-18  1:47           ` Dave Young
2018-01-18  2:14             ` Linus Torvalds
2018-01-18  2:29               ` Dave Young
2018-01-18  5:14                 ` Tom Lendacky
2018-01-18  2:47               ` Dave Young
2018-01-18  2:56                 ` Linus Torvalds
2018-01-18  2:53               ` Arjan van de Ven
2018-01-18  2:57                 ` Dave Young
2018-01-18  3:00                   ` Linus Torvalds
2018-01-18  3:04                     ` Dave Young
2018-01-18  3:31                       ` Dave Young
2018-01-18  3:00               ` Arjan van de Ven

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=d60aa430-e9ce-d9f1-d66c-977a3559e338@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=arjan@linux.intel.com \
    --cc=bhe@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dan.j.williams@intel.com \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@redhat.com \
    --cc=jgross@suse.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=yu.c.chen@intel.com \
    /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

Powered by JetHome