Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp269818ybt; Fri, 19 Jun 2020 01:18:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3G8Hu8GilZTm3Nqmiw/Y30Tm53SWrvCmjigmO9k3DZBjx4pdEFxeMik5altDrlzygN2xu X-Received: by 2002:a17:906:cc58:: with SMTP id mm24mr2703582ejb.134.1592554702021; Fri, 19 Jun 2020 01:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592554702; cv=none; d=google.com; s=arc-20160816; b=C8pAg3n93l1FmdIvZFi3ug3ZLeuBLrwB9S3oCyeh2i7QWf5pplXLVqCJCyyy5H3/Io O9bBsOCGHUt0+61oOGIESKWjZa5Z5U5BRLL5nL3I9Sb3qteZo6Lxoy9SD0s8HeIrVp/Z WvqePoKdP+DGg8WIMYC5PPTEXFqQ/vfkwpVNEXTB/tW45iJvl8fF6Ld3f/3EWmfzcMve 0TWVlVG4qnc+4h4a1janPG0waNnZVZ5MPdOyXMDCkOxWm0d+PQXAs+4cTMU4HXj0Xw9A u8BKlxEgWycdiFmaOaIfhD9ushz3t7Dw3Qs/SquCa58kqAHt+Mss+Gx4vAriKzdXBbiR O48A== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Zra1TRLfT2HgyHORAMYB+NVY7zN0RlMSIw5efiMlxrg=; b=pgPfc6ezLDtgOT2bEs5KUZbCrOFaXlaUCfIIuVe9pCNNIjNiKh6uTqfh3eOwbRxn9u Wl5bo95tbxQpecHLLV0rLwp00RQKsXfVuiPvbljPkhRxbGEFlz4cbseS4/bWQ3lv8FP9 rlTBKIaVLewa8aohiVjDP1xY0tci3pb1CCq5xGMZnYRu4wJ3wKl4lMGkGQ9tAWluMXbA MW5tYLZHFfJjbQObEEt3JWIy+hJs8GHlLtWYlhB3WQZVsGnlP8cDbUOl7memCABALfGM g6f9IXfBJT3HNRtEsMBbVK0CbblK3VRp+WP5ylzLvxXZ6Saw6DZQyqZu+aTiSOsuGZTc RmEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=I9jCiD32; 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 u7si3281118ejo.692.2020.06.19.01.18.00; Fri, 19 Jun 2020 01:18:22 -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=merlin.20170209 header.b=I9jCiD32; 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 S1731241AbgFSIPG (ORCPT + 99 others); Fri, 19 Jun 2020 04:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730651AbgFSIOA (ORCPT ); Fri, 19 Jun 2020 04:14:00 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34C4CC06174E for ; Fri, 19 Jun 2020 01:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Zra1TRLfT2HgyHORAMYB+NVY7zN0RlMSIw5efiMlxrg=; b=I9jCiD32gNtOfwPNbkhd9ZPhkN xJb4rpXl1BnsGI8IDo8u9mQC+v4NZVisWUUWvlc/bK+t0PsY5zTRSQHxlxzXP61DxDpvB8j6O5umd bHAPSWSjTf0oJMu6fgvrlAV/vE9Pqu5rXA5Jq8ihrjHGEHi/YezkbxrygmeXD0FS7fbMrhSE3abPY jr5EE7hUmaTT5EYx6DmbdrSIvJ0NxZdFGtyx1C1lSvTreaZX/B/P48/qEUputYF+K3N4peesJnhwr +M1OCpa3mxeeobZd439iQm75s6OFFwxATn5ZgY3zmvx1mjEeBHCsXJlE/GnofLvJrcTnGd9cq4pi/ 4Raqq0iw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmC9b-0002Rj-FI; Fri, 19 Jun 2020 08:13:39 +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 C5701302753; Fri, 19 Jun 2020 10:13:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B1B01203B7CA1; Fri, 19 Jun 2020 10:13:36 +0200 (CEST) Date: Fri, 19 Jun 2020 10:13:36 +0200 From: Peter Zijlstra To: Andi Kleen Cc: Song Liu , linux-kernel , Kan Liang , Alexander Shishkin , Josh Poimboeuf , Tejun Heo , Andrii Nakryiko , Francis Ricci Subject: Re: WARNING with LBR + precise_ip=2 + bpf_get_stackid() Message-ID: <20200619081336.GQ576905@hirez.programming.kicks-ass.net> References: <20200618223555.GB793265@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200618223555.GB793265@tassilo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 18, 2020 at 03:35:55PM -0700, Andi Kleen wrote: > > We noticed that this only happens with precise_ip >= 2. This is caused by > > setup_pebs_fixed_sample_data() using pens->real_ip: > > > > set_linear_ip(regs, pebs->real_ip); > > With precise_ip == 1 the IP will be one instruction behind. > That's the only difference to 2 or 3. > > So something about the actual instruction confuses the unwinder. It's trying to do an unwind with the PEBS IP (or worse the whole PEBS regset), which doesn't match the interrupt IP or the stack layout at that time. Of course it doesn't work.