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: 9982835 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 E6F236029B for ; Tue, 3 Oct 2017 13:22:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5AEB286CF for ; Tue, 3 Oct 2017 13:22:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA3BE2884A; Tue, 3 Oct 2017 13:22:18 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A75F286CF for ; Tue, 3 Oct 2017 13:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Mv/ChURHV9BMTvO6HjC4MG/yIDSgx+huYNiA54SA0/U=; b=TIBp+PZK5YK6tk nGW6OfECwp9zVhWvQLu4mH7Sbm1+gCMSF0aN7zB7iXOEWH2E3XZCYBxktLQyKd7fCmcfCiepnLvR5 jA0RM2oaysR4v1khrYsR0jaQzyy28hDwf1co9vgV9BE/LfY7/bMZcjNJ2vTEyzmkdHcqTdAcjPOJc 7jww9GQJ6U/h3jz9R1TVoe8RMfJwTdZVyxnyixodABFT26LOwpFh//ah8j9QZWLROCMr5OW4vZ/Hc ZIeKsmIzjuWzYdhhKG6mT0jQpl1ADBLI3b6D2Fh+nl05wZJrvgtktsYVN6Y9dY3iXwGiquf3FJjVv MqN6sa0y8WkZkmV1FaeQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dzN9J-0002Wz-Pm; Tue, 03 Oct 2017 13:22:13 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dzN8y-0002DS-Jt for linux-arm-kernel@lists.infradead.org; Tue, 03 Oct 2017 13:21:55 +0000 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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171003_062152_829158_FDCB60DB X-CRM114-Status: GOOD ( 16.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devicetree@vger.kernel.org" , linux-samsung-soc@vger.kernel.org, Vinod Koul , linux-soc@vger.kernel.org, USB list , LKML , Linus Torvalds , linux-arm-msm@vger.kernel.org, dma , LKP , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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! 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)