From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392AbbGKINd (ORCPT ); Sat, 11 Jul 2015 04:13:33 -0400 Received: from www.linutronix.de ([62.245.132.108]:49024 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752946AbbGKINc (ORCPT ); Sat, 11 Jul 2015 04:13:32 -0400 Date: Sat, 11 Jul 2015 10:13:22 +0200 (CEST) From: Thomas Gleixner To: Dave Jones cc: x86@kernel.org, Linus Torvalds , Linux Kernel Subject: Re: CONFIG_DEBUG_VIRTUAL instant reboot. In-Reply-To: <20150710145047.GA16804@codemonkey.org.uk> Message-ID: References: <20150710145047.GA16804@codemonkey.org.uk> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Jul 2015, Dave Jones wrote: > I bought a Haswell Xeon E3-1225 v3 box, and found that > my self-built kernel would instantly reboot the machine once > grub had loaded it. > > Through trial and error I found the following options matter.. > > if I _enable_ DEBUG_PAGEALLOC, it boots fine. > disabling it again, instant death. > > further narrowing down revealed that if I have DEBUG_PAGEALLOC off, > I also _must_ also have CONFIG_DEBUG_VIRTUAL turned off. > With both disabled, it also boots fine. > > I tried earlyprintk, but this happens so soon I don't think > we're even at the point of initializing that code. > > Any ideas how I can further narrow this down ? I assume that VIRTUAL_BUG_ON() triggers very early. Changing it to WARN_ON() should keep the machine alive and give you a hint which of those checks explodes. Thanks, tglx --- diff --git a/arch/x86/mm/physaddr.c b/arch/x86/mm/physaddr.c index e666cbbb9261..e41c1227337f 100644 --- a/arch/x86/mm/physaddr.c +++ b/arch/x86/mm/physaddr.c @@ -76,7 +76,7 @@ unsigned long __phys_addr(unsigned long x) /* max_low_pfn is set early, but not _that_ early */ if (max_low_pfn) { VIRTUAL_BUG_ON((phys_addr >> PAGE_SHIFT) > max_low_pfn); - BUG_ON(slow_virt_to_phys((void *)x) != phys_addr); + VIRTUAL_BUG_ON(slow_virt_to_phys((void *)x) != phys_addr); } return phys_addr; } diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index 877ef226f90f..d7ff4c2ffd69 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h @@ -50,7 +50,7 @@ void dump_mm(const struct mm_struct *mm); #endif #ifdef CONFIG_DEBUG_VIRTUAL -#define VIRTUAL_BUG_ON(cond) BUG_ON(cond) +#define VIRTUAL_BUG_ON(cond) WARN_ON(cond) #else #define VIRTUAL_BUG_ON(cond) do { } while (0) #endif