From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752496AbdFLSBW (ORCPT ); Mon, 12 Jun 2017 14:01:22 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49352 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752050AbdFLSBV (ORCPT ); Mon, 12 Jun 2017 14:01:21 -0400 Date: Mon, 12 Jun 2017 20:01:08 +0200 From: Peter Zijlstra To: Hans de Goede Cc: Thomas Gleixner , Linus Torvalds , Ingo Molnar , Linux Kernel Mailing List , the arch/x86 maintainers , Frank Mehnert , Michael Thayer Subject: Re: 4.12 REGRESSION, 4.12 does not boot as VirtualBox guest Message-ID: <20170612180108.w4vgu2ckucmllf3a@hirez.programming.kicks-ass.net> References: <20170612115246.lbj23umwaycztvb6@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 12, 2017 at 06:51:17PM +0200, Hans de Goede wrote: > Yes it does, with this patch the oops is back (unrelated problem) and > the kernel boots again :) Cheers! Full patch below. --- Subject: Re: 4.12 REGRESSION, 4.12 does not boot as VirtualBox guest From: Peter Zijlstra Date: Mon, 12 Jun 2017 13:52:46 +0200 Hans managed to trigger a WARN very early in the boot which killed his (Virtual) box. Turns out we need to also consider fixup_bug() in early_fixup_exception(). Cc: Ingo Molnar Cc: Linus Torvalds Cc: Thomas Gleixner Fixes: 9a93848fe787 ("x86/debug: Implement __WARN() using UD0") Reported-by: Hans de Goede Tested-by: Hans de Goede Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/extable.h | 1 + arch/x86/kernel/traps.c | 2 +- arch/x86/mm/extable.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) --- a/arch/x86/include/asm/extable.h +++ b/arch/x86/include/asm/extable.h @@ -29,6 +29,7 @@ struct pt_regs; } while (0) extern int fixup_exception(struct pt_regs *regs, int trapnr); +extern int fixup_bug(struct pt_regs *regs, int trapnr); extern bool ex_has_fault_handler(unsigned long ip); extern void early_fixup_exception(struct pt_regs *regs, int trapnr); --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -182,7 +182,7 @@ int is_valid_bugaddr(unsigned long addr) return ud == INSN_UD0 || ud == INSN_UD2; } -static int fixup_bug(struct pt_regs *regs, int trapnr) +int fixup_bug(struct pt_regs *regs, int trapnr) { if (trapnr != X86_TRAP_UD) return 0; --- a/arch/x86/mm/extable.c +++ b/arch/x86/mm/extable.c @@ -162,6 +162,9 @@ void __init early_fixup_exception(struct if (fixup_exception(regs, trapnr)) return; + if (fixup_bug(regs, trapnr)) + return; + fail: early_printk("PANIC: early exception 0x%02x IP %lx:%lx error %lx cr2 0x%lx\n", (unsigned)trapnr, (unsigned long)regs->cs, regs->ip,