virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Marco Elver <elver@google.com>
Cc: syzbot <syzbot+8db9e1ecde74e590a657@syzkaller.appspotmail.com>,
	fenghua.yu@intel.com, yu-cheng.yu@intel.com, "Luck,
	Tony" <tony.luck@intel.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	virtualization@lists.linux-foundation.org,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
Date: Fri, 7 Aug 2020 12:35:21 +0200	[thread overview]
Message-ID: <16671cf3-3885-eb06-79ff-4cbfaeeaea79@suse.com> (raw)
In-Reply-To: <20200807095032.GA3528289@elver.google.com>

On 07.08.20 11:50, Marco Elver wrote:
> On Fri, Aug 07, 2020 at 11:24AM +0200, Jürgen Groß wrote:
>> On 07.08.20 11:01, Marco Elver wrote:
>>> On Thu, 6 Aug 2020 at 18:06, Marco Elver <elver@google.com> wrote:
>>>> On Thu, 6 Aug 2020 at 15:17, Marco Elver <elver@google.com> wrote:
>>>>> On Thu, Aug 06, 2020 at 01:32PM +0200, peterz@infradead.org wrote:
>>>>>> On Thu, Aug 06, 2020 at 09:47:23AM +0200, Marco Elver wrote:
>>>>>>> Testing my hypothesis that raw then nested non-raw
>>>>>>> local_irq_save/restore() breaks IRQ state tracking -- see the reproducer
>>>>>>> below. This is at least 1 case I can think of that we're bound to hit.
>>>>> ...
>>>>>>
>>>>>> /me goes ponder things...
>>>>>>
>>>>>> How's something like this then?
>>>>>>
>>>>>> ---
>>>>>>    include/linux/sched.h |  3 ---
>>>>>>    kernel/kcsan/core.c   | 62 ++++++++++++++++++++++++++++++++++++---------------
>>>>>>    2 files changed, 44 insertions(+), 21 deletions(-)
>>>>>
>>>>> Thank you! That approach seems to pass syzbot (also with
>>>>> CONFIG_PARAVIRT) and kcsan-test tests.
>>>>>
>>>>> I had to modify it some, so that report.c's use of the restore logic
>>>>> works and not mess up the IRQ trace printed on KCSAN reports (with
>>>>> CONFIG_KCSAN_VERBOSE).
>>>>>
>>>>> I still need to fully convince myself all is well now and we don't end
>>>>> up with more fixes. :-) If it passes further testing, I'll send it as a
>>>>> real patch (I want to add you as Co-developed-by, but would need your
>>>>> Signed-off-by for the code you pasted, I think.)
>>>
>>> I let it run on syzbot through the night, and it's fine without
>>> PARAVIRT (see below). I have sent the patch (need your Signed-off-by
>>> as it's based on your code, thank you!):
>>> https://lkml.kernel.org/r/20200807090031.3506555-1-elver@google.com
>>>
>>>> With CONFIG_PARAVIRT=y (without the notrace->noinstr patch), I still
>>>> get lockdep DEBUG_LOCKS_WARN_ON(!lockdep_hardirqs_enabled()), although
>>>> it takes longer for syzbot to hit them. But I think that's expected
>>>> because we can still get the recursion that I pointed out, and will
>>>> need that patch.
>>>
>>> Never mind, I get these warnings even if I don't turn on KCSAN
>>> (CONFIG_KCSAN=n). Something else is going on with PARAVIRT=y that
>>> throws off IRQ state tracking. :-/
>>
>> What are the settings of CONFIG_PARAVIRT_XXL and
>> CONFIG_PARAVIRT_SPINLOCKS in this case?
> 
> I attached a config.
> 
> 	$> grep PARAVIRT .config
> 	CONFIG_PARAVIRT=y
> 	CONFIG_PARAVIRT_XXL=y
> 	# CONFIG_PARAVIRT_DEBUG is not set
> 	CONFIG_PARAVIRT_SPINLOCKS=y
> 	# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
> 	CONFIG_PARAVIRT_CLOCK=y

Anything special I need to do to reproduce the problem? Or would you be
willing to do some more rounds with different config settings?

I think CONFIG_PARAVIRT_XXL shouldn't matter, but I'm not completely
sure about that. CONFIG_PARAVIRT_SPINLOCKS would be my primary suspect.


Juergen
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2020-08-07 10:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0000000000007d3b2d05ac1c303e@google.com>
     [not found] ` <20200805132629.GA87338@elver.google.com>
2020-08-05 13:42   ` [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers peterz
     [not found]     ` <20200805135940.GA156343@elver.google.com>
2020-08-05 14:12       ` peterz
2020-08-05 14:17         ` Jürgen Groß
2020-08-05 14:17         ` peterz
     [not found]           ` <CANpmjNN6FWZ+MsAn3Pj+WEez97diHzqF8hjONtHG15C2gSpSgw@mail.gmail.com>
     [not found]             ` <CANpmjNNy3XKQqgrjGPPKKvXhAoF=mae7dk8hmoS4k4oNnnB=KA@mail.gmail.com>
     [not found]               ` <20200806074723.GA2364872@elver.google.com>
2020-08-06 11:32                 ` peterz
     [not found]                   ` <20200806131702.GA3029162@elver.google.com>
     [not found]                     ` <CANpmjNNqt8YrCad4WqgCoXvH47pRXtSLpnTKhD8W8+UpoYJ+jQ@mail.gmail.com>
     [not found]                       ` <CANpmjNO860SHpNve+vaoAOgarU1SWy8o--tUWCqNhn82OLCiew@mail.gmail.com>
2020-08-07  9:24                         ` Jürgen Groß
     [not found]                           ` <20200807095032.GA3528289@elver.google.com>
2020-08-07 10:35                             ` Jürgen Groß [this message]
     [not found]                               ` <20200807113838.GA3547125@elver.google.com>
2020-08-07 12:04                                 ` Jürgen Groß
     [not found]                                   ` <CANpmjNPau_DEYadey9OL+iFZKEaUTqnFnyFs1dU12o00mg7ofA@mail.gmail.com>
     [not found]                                     ` <20200807151903.GA1263469@elver.google.com>
     [not found]                                       ` <CANpmjNM1jASqCFYZpteVrZCa2V2D_DbXaqvoCV_Ac2boYfDXnQ@mail.gmail.com>
2020-08-11  7:04                                         ` Jürgen Groß
2020-08-11  7:41                                       ` Peter Zijlstra
2020-08-11  7:57                                         ` Jürgen Groß
2020-08-11  8:12                                           ` Peter Zijlstra
2020-08-11  8:18                                             ` Jürgen Groß
2020-08-11  8:38                                             ` Jürgen Groß
2020-08-11  9:20                                               ` peterz
2020-08-11  9:46                                                 ` peterz
2020-08-11 20:17                                                   ` peterz
     [not found]                                                     ` <20200812080650.GA3894595@elver.google.com>
2020-08-12  8:18                                                       ` peterz
2020-08-12  8:57                                                         ` peterz

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=16671cf3-3885-eb06-79ff-4cbfaeeaea79@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=elver@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=syzbot+8db9e1ecde74e590a657@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=yu-cheng.yu@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;
as well as URLs for NNTP newsgroup(s).