Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp279315pxa; Tue, 11 Aug 2020 02:49:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVjwbrSvi1SBxNsAfe14S5VlTXle+7/4lU0ByaXW8prfpuSjvNOdvcSMtDWWy8lvBQdgvY X-Received: by 2002:aa7:c983:: with SMTP id c3mr24747603edt.383.1597139361575; Tue, 11 Aug 2020 02:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597139361; cv=none; d=google.com; s=arc-20160816; b=gl8pMs8NLG/8rrFmo5PCdd0OThefz5EsxISKWVIl1MiJdS5TCLKZVKyvJnO+jV3UUX JgFbxL5QBnNvJNrieJaSWe8+skZ72yc1MGolvyzFBZP+hRs7XDnh7YOuFodXlt412xSQ hh1EHwYgCdbB7TBRpWHtDCtfyAiglRXw4IhbhrZnJkeqaMkuO5Z0gTkwrTZHtYU3WgwJ +StnQIr0JkMCQLhGfYZJ2ISQx9akhFRGoMX/Hukjs2LE4hWi8xIBvE2DxMRJRDrFFLnz tqNglgphMCj2ocTXylRTKnNKquf+iVGVyUGi1ziNHvc++5FFSBytL8kCN32sft9MhpU0 2veA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hSl2P/kJe9MOyfzAv0UR68V5yutSEkdzNefSktLECT8=; b=P3oP47JQgnADnBOBKeXNDIDqE5PIsjCX27h3/98ss16CHDYMpNuxqH6cXky52mR0jd CKrh1DiN4Zg5b2fIEFHfHRQjMFyunFtKOEwSYXVmMfdrmKi9nL2/vHW96LjJ8lywWgxC JrPyS2ysY3gDm+lJLiEn4v/yscsZdl06JKkI05etx++M3J/zf0zVtDIGtAmgJIequYv5 ZJdxw5i3UwKc0maRSv3qhMHkDEILuNAH+C1JXW3Z97DxZmikXbtJRSSDK8dLlxZPyczH pZvvLkgnSLLAMrBPhdSu5s0B1XD8AMKo5htif6dI93sLfOAaw3OWjc5aSlqA683ja5Kb QYFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=OsyDm2Ek; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si10159312edp.462.2020.08.11.02.48.57; Tue, 11 Aug 2020 02:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=OsyDm2Ek; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728461AbgHKJrY (ORCPT + 99 others); Tue, 11 Aug 2020 05:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728377AbgHKJrX (ORCPT ); Tue, 11 Aug 2020 05:47:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B4D1C06174A for ; Tue, 11 Aug 2020 02:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=hSl2P/kJe9MOyfzAv0UR68V5yutSEkdzNefSktLECT8=; b=OsyDm2Ekl0cDY46XG1Trr/nZIv T0IQ5JaztHBdVxL5XXH9DNINH/MIrXlxMEkrgKJl0T60oJZZQhUs5NUpsePlamimQZh40oU92tdjZ SflhU2YmExOJNnt4tTSi1xbqYtNY9Wkifuntj7WDW/3P4j1wp67Pby/4Mgn5sxsk7ndEahdJzsHt6 IJbDVrVJ72dQU84e72kiFYEnkFUf8ELU6T09P4eI8cyDlJMKNGfMS8mzedzS59IBlRjBQz8O1BT6+ dJwHN3W7SYhWZQAXCvRa7++KDXUwQUgvGa/bRKI5lcDfJx2lBUgZ82vp/tFZFpVx+/YKlaIYuKAR7 tWOrTqew==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5Qrs-000387-KS; Tue, 11 Aug 2020 09:46:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 660523003E5; Tue, 11 Aug 2020 11:46:51 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4D3E423FF6C69; Tue, 11 Aug 2020 11:46:51 +0200 (CEST) Date: Tue, 11 Aug 2020 11:46:51 +0200 From: peterz@infradead.org To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= Cc: Marco Elver , Borislav Petkov , Dave Hansen , fenghua.yu@intel.com, "H. Peter Anvin" , LKML , Ingo Molnar , syzkaller-bugs , Thomas Gleixner , "Luck, Tony" , the arch/x86 maintainers , yu-cheng.yu@intel.com, sdeep@vmware.com, virtualization@lists.linux-foundation.org, kasan-dev , syzbot , "Paul E. McKenney" , Wei Liu , Steven Rostedt Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers Message-ID: <20200811094651.GH35926@hirez.programming.kicks-ass.net> References: <16671cf3-3885-eb06-79ff-4cbfaeeaea79@suse.com> <20200807113838.GA3547125@elver.google.com> <20200807151903.GA1263469@elver.google.com> <20200811074127.GR3982@worktop.programming.kicks-ass.net> <20200811081205.GV3982@worktop.programming.kicks-ass.net> <07f61573-fef1-e07c-03f2-a415c88dec6f@suse.com> <20200811092054.GB2674@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200811092054.GB2674@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 11:20:54AM +0200, peterz@infradead.org wrote: > On Tue, Aug 11, 2020 at 10:38:50AM +0200, J?rgen Gro? wrote: > > In case you don't want to do it I can send the patch for the Xen > > variants. > > I might've opened a whole new can of worms here. I'm not sure we > can/want to fix the entire fallout this release :/ > > Let me ponder this a little, because the more I look at things, the more > problems I keep finding... bah bah bah. That is, most of these irq-tracking problem are new because commit: 859d069ee1dd ("lockdep: Prepare for NMI IRQ state tracking") changed irq-tracking to ignore the lockdep recursion count. This then allows: lock_acquire() raw_local_irq_save(); current->lockdep_recursion++; trace_lock_acquire() ... tracing ... #PF under raw_local_irq_*() __lock_acquire() arch_spin_lock(&graph_lock) pv-spinlock-wait() local_irq_save() under raw_local_irq_*() However afaict that just made a bad situation worse. There already were issues, take for example: trace_clock_global() raw_local_irq_save(); arch_spin_lock() pv-spinlock-wait local_irq_save() And that has no lockdep_recursion to 'save' the say. The tracing recursion does however avoid some of the obvious fails there, like trace_clock calling into paravirt which then calls back into tracing. But still, that would've caused IRQ tracking problems even with the old code. And in that respect, this is all the exact same problem as that other set of patches has ( 20200807192336.405068898@infradead.org ). Now, on the flip side, it does find actual problems, the trace_lock_*() things were using RCU in RCU-disabled code, and here I found that trace_clock_global() thinkg (and I suspect there's more of that). But at this point I'm not entirelty sure how best to proceed... tracing uses arch_spinlock_t, which means all spinlock implementations should be notrace, but then that drops into paravirt and all hell breaks loose because Hyper-V then calls into the APIC code etc.. etc.. At that rate we'll have the entire kernel marked notrace, and I'm fairly sure that's not a solution either. So let me once again see if I can't find a better solution for this all. Clearly it needs one :/