[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <07f61573-fef1-e07c-03f2-a415c88dec6f@suse.com>
Date: Tue, 11 Aug 2020 10:38:50 +0200
From: Jürgen Groß <jgross@...e.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Marco Elver <elver@...gle.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
fenghua.yu@...el.com, "H. Peter Anvin" <hpa@...or.com>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Luck, Tony" <tony.luck@...el.com>,
the arch/x86 maintainers <x86@...nel.org>,
yu-cheng.yu@...el.com, sdeep@...are.com,
virtualization@...ts.linux-foundation.org,
kasan-dev <kasan-dev@...glegroups.com>,
syzbot <syzbot+8db9e1ecde74e590a657@...kaller.appspotmail.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Wei Liu <wei.liu@...nel.org>
Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*()
helpers
On 11.08.20 10:12, Peter Zijlstra wrote:
> On Tue, Aug 11, 2020 at 09:57:55AM +0200, Jürgen Groß wrote:
>> On 11.08.20 09:41, Peter Zijlstra wrote:
>>> On Fri, Aug 07, 2020 at 05:19:03PM +0200, Marco Elver wrote:
>>>
>>>> My hypothesis here is simply that kvm_wait() may be called in a place
>>>> where we get the same case I mentioned to Peter,
>>>>
>>>> raw_local_irq_save(); /* or other IRQs off without tracing */
>>>> ...
>>>> kvm_wait() /* IRQ state tracing gets confused */
>>>> ...
>>>> raw_local_irq_restore();
>>>>
>>>> and therefore, using raw variants in kvm_wait() works. It's also safe
>>>> because it doesn't call any other libraries that would result in corrupt
>>>
>>> Yes, this is definitely an issue.
>>>
>>> Tracing, we also musn't call into tracing when using raw_local_irq_*().
>>> Because then we re-intoduce this same issue all over again.
>>>
>>> Both halt() and safe_halt() are more paravirt calls, but given we're in
>>> a KVM paravirt call already, I suppose we can directly use native_*()
>>> here.
>>>
>>> Something like so then... I suppose, but then the Xen variants need TLC
>>> too.
>>
>> Just to be sure I understand you correct:
>>
>> You mean that xen_qlock_kick() and xen_qlock_wait() and all functions
>> called by those should gain the "notrace" attribute, right?
>>
>> I am not sure why the kick variants need it, though. IMO those are
>> called only after the lock has been released, so they should be fine
>> without notrace.
>
> The issue happens when someone uses arch_spinlock_t under
> raw_local_irq_*().
>
>> And again: we shouldn't forget the Hyper-V variants.
>
> Bah, my grep failed :/ Also *groan*, that's calling apic->send_IPI().
In case you don't want to do it I can send the patch for the Xen
variants.
Juergen
Powered by blists - more mailing lists