From patchwork Tue Oct 3 13:21:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Poimboeuf X-Patchwork-Id: 9982833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A18C6029B for ; Tue, 3 Oct 2017 13:22:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59D0428759 for ; Tue, 3 Oct 2017 13:22:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E91E28876; Tue, 3 Oct 2017 13:22:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07CF028759 for ; Tue, 3 Oct 2017 13:22:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752048AbdJCNVe (ORCPT ); Tue, 3 Oct 2017 09:21:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43804 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751536AbdJCNVc (ORCPT ); Tue, 3 Oct 2017 09:21:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 215EAC04AC7E; Tue, 3 Oct 2017 13:21:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 215EAC04AC7E Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Received: from treble (ovpn-120-76.rdu2.redhat.com [10.10.120.76]) by smtp.corp.redhat.com (Postfix) with SMTP id C449360606; Tue, 3 Oct 2017 13:21:30 +0000 (UTC) Date: Tue, 3 Oct 2017 08:21:25 -0500 From: Josh Poimboeuf To: Fengguang Wu Cc: Linus Torvalds , LKP , linux-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, dma , linux-samsung-soc@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , USB list , Vinod Koul , LKML Subject: Re: 4879b7ae05 ("Merge tag 'dmaengine-4.12-rc1' of .."): WARNING: kernel stack regs at bd92bc2e in 01-cpu-hotplug:3811 has bad 'bp' value 000001be Message-ID: <20171003132125.ulj3nnmiimamsm6w@treble> References: <59d177a7.vsiddgOxdHRIlRvy%fengguang.wu@intel.com> <20171002212654.rsm4uj3hfioddldd@treble> <20171002213109.5n3skzy76edhwkvf@treble> <20171003034538.ntvuwtm2uha6wt6h@wfg-t540p.sh.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171003034538.ntvuwtm2uha6wt6h@wfg-t540p.sh.intel.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 03 Oct 2017 13:21:32 +0000 (UTC) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Oct 03, 2017 at 11:45:38AM +0800, Fengguang Wu wrote: > Hi Josh, > > On Mon, Oct 02, 2017 at 04:31:09PM -0500, Josh Poimboeuf wrote: > > On Mon, Oct 02, 2017 at 04:26:54PM -0500, Josh Poimboeuf wrote: > > > Fengguang, assuming it's reliably recreatable, any chance you could > > > recreate with the following patch? > > Sure, I'll try your patch on v4.14-rc3 since it looks the most > reproducible kernel. For the bisected 4879b7ae05, the warning only > shows up once out of 909 boots according to the below stats. So I'm > not sure whether it's the _first_ bad commit. To double confirm, I > just queued 5000 more boot tests for each of its parent commits. Fengguang, here's an improved version of the patch based on Linus' suggestions. If you can use it instead, that would be helpful because it has a better chance of dumping useful data. Thanks! --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kernel/unwind_frame.c b/arch/x86/kernel/unwind_frame.c index d145a0b1f529..191012762aa0 100644 --- a/arch/x86/kernel/unwind_frame.c +++ b/arch/x86/kernel/unwind_frame.c @@ -44,7 +44,8 @@ static void unwind_dump(struct unwind_state *state) state->stack_info.type, state->stack_info.next_sp, state->stack_mask, state->graph_idx); - for (sp = state->orig_sp; sp; sp = PTR_ALIGN(stack_info.next_sp, sizeof(long))) { + for (sp = PTR_ALIGN(state->orig_sp, sizeof(long)); sp; + sp = PTR_ALIGN(stack_info.next_sp, sizeof(long))) { if (get_stack_info(sp, state->task, &stack_info, &visit_mask)) break; @@ -178,7 +179,7 @@ static struct pt_regs *decode_frame_pointer(unsigned long *bp) { unsigned long regs = (unsigned long)bp; - if (!(regs & 0x1)) + if ((regs & (sizeof(long)-1)) != 1) return NULL; return (struct pt_regs *)(regs & ~0x1); @@ -221,6 +222,10 @@ static bool update_stack_state(struct unwind_state *state, &state->stack_mask)) return false; + /* Make sure the frame pointer is properly aligned: */ + if ((unsigned long)frame & (sizeof(long)-1)) + return false; + /* Make sure it only unwinds up and doesn't overlap the prev frame: */ if (state->orig_sp && state->stack_info.type == prev_type && frame < prev_frame_end)