From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:33:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEF851065678; Mon, 27 Feb 2012 17:33:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AED4F8FC19; Mon, 27 Feb 2012 17:33:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHXGa9029339; Mon, 27 Feb 2012 17:33:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHXGuA029337; Mon, 27 Feb 2012 17:33:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271733.q1RHXGuA029337@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 17:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232232 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 17:33:16 -0000 Author: jhb Date: Mon Feb 27 17:33:16 2012 New Revision: 232232 URL: http://svn.freebsd.org/changeset/base/232232 Log: - Panic up front if a kernel does not include 'device atpic' and an APIC is not found. - Don't panic if lapic_enable_cmc() is called and the APIC is not enabled. This can happen due to booting a kernel with APIC disabled on a CPU that supports CMCI. - Wrap a long line. Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Feb 27 17:31:38 2012 (r232231) +++ head/sys/x86/x86/local_apic.c Mon Feb 27 17:33:16 2012 (r232232) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_atpic.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -308,7 +309,8 @@ lapic_create(u_int apic_id, int boot_cpu lapics[apic_id].la_ioint_irqs[APIC_TIMER_INT - APIC_IO_INTS] = IRQ_TIMER; #ifdef KDTRACE_HOOKS - lapics[apic_id].la_ioint_irqs[IDT_DTRACE_RET - APIC_IO_INTS] = IRQ_DTRACE_RET; + lapics[apic_id].la_ioint_irqs[IDT_DTRACE_RET - APIC_IO_INTS] = + IRQ_DTRACE_RET; #endif @@ -890,6 +892,10 @@ lapic_enable_cmc(void) { u_int apic_id; +#ifdef DEV_ATPIC + if (lapic == NULL) + return; +#endif apic_id = PCPU_GET(apic_id); KASSERT(lapics[apic_id].la_present, ("%s: missing APIC %u", __func__, apic_id)); @@ -1286,6 +1292,9 @@ apic_init(void *dummy __unused) if (best_enum == NULL) { if (bootverbose) printf("APIC: Could not find any APICs.\n"); +#ifndef DEV_ATPIC + panic("running without device atpic requires a local APIC"); +#endif return; }