Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BE6CC433E0 for ; Fri, 7 Aug 2020 10:35:29 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 510272075D for ; Fri, 7 Aug 2020 10:35:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 510272075D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 21AD48870E; Fri, 7 Aug 2020 10:35:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VUoE8Ij0NI94; Fri, 7 Aug 2020 10:35:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id F3E77886F3; Fri, 7 Aug 2020 10:35:26 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D0C1AC0050; Fri, 7 Aug 2020 10:35:26 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 96859C004C for ; Fri, 7 Aug 2020 10:35:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7ECB5888E2 for ; Fri, 7 Aug 2020 10:35:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RpWjOqEhpc5N for ; Fri, 7 Aug 2020 10:35:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by hemlock.osuosl.org (Postfix) with ESMTPS id D1807888DF for ; Fri, 7 Aug 2020 10:35:23 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4E006AE53; Fri, 7 Aug 2020 10:35:40 +0000 (UTC) Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers To: Marco Elver References: <20200805141237.GS2674@hirez.programming.kicks-ass.net> <20200805141709.GD35926@hirez.programming.kicks-ass.net> <20200806074723.GA2364872@elver.google.com> <20200806113236.GZ2674@hirez.programming.kicks-ass.net> <20200806131702.GA3029162@elver.google.com> <20200807095032.GA3528289@elver.google.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <16671cf3-3885-eb06-79ff-4cbfaeeaea79@suse.com> Date: Fri, 7 Aug 2020 12:35:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200807095032.GA3528289@elver.google.com> Content-Language: en-US Cc: syzbot , fenghua.yu@intel.com, yu-cheng.yu@intel.com, "Luck, Tony" , "Paul E. McKenney" , Peter Zijlstra , Dave Hansen , syzkaller-bugs , LKML , kasan-dev , virtualization@lists.linux-foundation.org, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner , the arch/x86 maintainers X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="windows-1252"; Format="flowed" Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On 07.08.20 11:50, Marco Elver wrote: > On Fri, Aug 07, 2020 at 11:24AM +0200, J=FCrgen Gro=DF wrote: >> On 07.08.20 11:01, Marco Elver wrote: >>> On Thu, 6 Aug 2020 at 18:06, Marco Elver wrote: >>>> On Thu, 6 Aug 2020 at 15:17, Marco Elver 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 repro= ducer >>>>>>> below. This is at least 1 case I can think of that we're bound to h= it. >>>>> ... >>>>>> >>>>>> /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=3Dy (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=3Dn). Something else is going on with PARAVIRT=3Dy 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=3Dy > CONFIG_PARAVIRT_XXL=3Dy > # CONFIG_PARAVIRT_DEBUG is not set > CONFIG_PARAVIRT_SPINLOCKS=3Dy > # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set > CONFIG_PARAVIRT_CLOCK=3Dy 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