[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97bc2ca2-7d5b-c206-5c23-902ed3586256@linux.intel.com>
Date: Wed, 14 Feb 2018 18:01:41 -0800
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Dave Hansen <dave@...1.net>,
hpa@...or.com, tglx@...utronix.de, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, dwmw@...zon.co.uk,
linux-tip-commits@...r.kernel.org, Borislav Petkov <bp@...en8.de>,
Arjan van de Ven <arjan@...radead.org>
Subject: Re: [tip:x86/pti] x86/speculation: Use IBRS if available before
calling into firmware
On 02/14/2018 03:19 PM, Ingo Molnar wrote:
>
> * Tim Chen <tim.c.chen@...ux.intel.com> wrote:
>
>> On 02/14/2018 12:56 AM, Peter Zijlstra wrote:
>>
>>>
>>> At the very least this must disable and re-enable preemption, such that
>>> we guarantee we inc/dec the same counter. ISTR some firmware calls (EFI)
>>> actually are preemptible so that wouldn't work.
>>>
>>> Further, consider:
>>>
>>> this_cpu_inc_return() // 0->1
>>> <NMI>
>>> this_cpu_inc_return() // 1->2
>>> call_broken_arse_firmware()
>>> this_cpu_dec_return() // 2->1
>>> </NMI>
>>> wrmsr(SPEC_CTRL, IBRS);
>>>
>>> /* from dodgy firmware crap */
>>>
>>> this_cpu_dec_return() // 1->0
>>> wrmsr(SPEC_CTRL, 0);
>>>
>>
>> How about the following patch.
>
> These fragile complications of the interface should now be unnecessary, as the
> only driver that called firmware from NMI callbacks (hpwdt.c) is going to remove
> those firmware callbacks in the near future - solving the problem at the source.
>
> Thanks,
>
> Ingo
>
Sounds good. I sent this out before seeing the other mails on removing NMI callbacks
from hpwdt.c
Tim
Powered by blists - more mailing lists