Re: [tip:x86/pti] x86/speculation: Use IBRS if available before calling into firmware
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [tip:x86/pti] x86/speculation: Use IBRS if available before calling into firmware
- From: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
- Date: Wed, 14 Feb 2018 18:01:41 -0800
- Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Dave Hansen <dave@xxxxxxxx>, hpa@xxxxxxxxx, tglx@xxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, dwmw@xxxxxxxxxxxx, linux-tip-commits@xxxxxxxxxxxxxxx, Borislav Petkov <bp@xxxxxxxxx>, Arjan van de Ven <arjan@xxxxxxxxxxxxx>
- In-reply-to: <20180214231904.ww46gjnytbx3jqef@gmail.com>
- References: <1518362359-1005-1-git-send-email-dwmw@amazon.co.uk> <tip-670c3e8da87fa4046a55077b1409cf250865a203@git.kernel.org> <20180212102211.cdrrqqd4hdw7xu5y@gmail.com> <a85c28b8-1255-3264-bb4a-89e85e3c6009@sr71.net> <20180212165835.GO25181@hirez.programming.kicks-ass.net> <20180213075540.3lkikkpgjoe6ocjk@gmail.com> <5c3ba123-abbe-f153-7b75-a89d31d25c72@linux.intel.com> <20180214085614.GT25181@hirez.programming.kicks-ass.net> <1fd7c8ef-a50c-53d8-7159-d992e669c2f2@linux.intel.com> <20180214231904.ww46gjnytbx3jqef@gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0
On 02/14/2018 03:19 PM, Ingo Molnar wrote:
>
> * Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]