From: Thomas Gleixner <tglx@linutronix.de>
To: Andi Kleen <ak@linux.intel.com>, Tom Lendacky <thomas.lendacky@amd.com>
Cc: Dave Hansen <dave.hansen@intel.com>,
Tony Battersby <tonyb@cybernetics.com>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Mario Limonciello <mario.limonciello@amd.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC] x86/cpu: fix intermittent lockup on poweroff
Date: Thu, 27 Apr 2023 01:20:43 +0200 [thread overview]
Message-ID: <87a5yu5iyc.ffs@tglx> (raw)
In-Reply-To: <ZEmfYpOyyul4BaKP@tassilo>
Andi!
On Wed, Apr 26 2023 at 15:02, Andi Kleen wrote:
>> > > This is probably going to pull in a cache line and cause the problem the
>> > > native_wbinvd() is trying to avoid.
>> >
>> > Is one _more_ cacheline really the problem?
>>
>> The answer is it depends. If the cacheline ends up modified/dirty, then it
>> can be a problem.
>
> I haven't followed this all in detail, but if any dirty cache line a
> problem you probably would need to be sure that any possible NMI user
> (like perf or watchdogs) is disabled at this point, otherwise you could
> still get NMIs here.
>
> I don't think perf currently has a mechanism to do that other
> than to offline the CPU.
stop_this_cpu()
disable_local_APIC()
apic_soft_disable()
clear_local_APIC()
v = apic_read(APIC_LVTPC);
apic_write(APIC_LVTPC, v | APIC_LVT_MASKED);
So after that point the PMU can't raise NMIs anymore which includes the
default perf based NMI watchdog, no?
External NMIs are a different problem, but they kinda fall into the same
category as:
> Also there are of course machine checks and SMIs that could still happen,
> but I guess there's nothing you could do about them.
Though external NMIs could be disabled via outb(0x70,...) if paranoid
enough. Albeit if there is an external NMI based watchdog raising the
NMI during this kexec() scenario then the outcome is probably as
undefined as in the MCE case independent of the SEV dirty cacheline
concern.
Thanks,
tglx
next prev parent reply other threads:[~2023-04-26 23:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 19:26 [PATCH RFC] x86/cpu: fix intermittent lockup on poweroff Tony Battersby
2023-04-25 19:39 ` Borislav Petkov
2023-04-25 19:58 ` Tony Battersby
2023-04-25 20:03 ` Dave Hansen
2023-04-25 20:34 ` Dave Hansen
2023-04-25 21:06 ` Borislav Petkov
2023-04-25 21:05 ` Thomas Gleixner
2023-04-25 22:29 ` Dave Hansen
2023-04-25 23:00 ` Thomas Gleixner
2023-04-26 0:10 ` H. Peter Anvin
2023-04-26 14:45 ` Tony Battersby
2023-04-26 16:37 ` Thomas Gleixner
2023-04-26 17:37 ` Tony Battersby
2023-04-26 17:41 ` [PATCH v2] x86/cpu: fix SME test in stop_this_cpu() Tony Battersby
2023-05-22 14:07 ` [PATCH v2 RESEND] " Tony Battersby
2023-04-26 17:51 ` [PATCH RFC] x86/cpu: fix intermittent lockup on poweroff Tom Lendacky
2023-04-26 18:15 ` Dave Hansen
2023-04-26 19:18 ` Tom Lendacky
2023-04-26 22:02 ` Andi Kleen
2023-04-26 23:20 ` Thomas Gleixner [this message]
2023-04-26 20:00 ` Thomas Gleixner
2023-06-20 13:00 ` [tip: x86/core] x86/smp: Make stop_other_cpus() more robust tip-bot2 for Thomas Gleixner
2023-06-20 13:00 ` [tip: x86/core] x86/smp: Dont access non-existing CPUID leaf tip-bot2 for Tony Battersby
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=87a5yu5iyc.ffs@tglx \
--to=tglx@linutronix.de \
--cc=ak@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mingo@redhat.com \
--cc=thomas.lendacky@amd.com \
--cc=tonyb@cybernetics.com \
--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