From 56d3c3edd58e1d020a87818b90379a1a4c2cf783 Mon Sep 17 00:00:00 2001 From: cperciva Date: Wed, 19 Jan 2011 21:03:22 +0000 Subject: [PATCH] MFS r217408: Don't use amdc1e on XEN && !XEN_PRIVILEGED. This fixes a panic when booting FreeBSD/XEN on recent AMD CPUs. Approved by: re (bz) git-svn-id: svn://svn.freebsd.org/base/releng/8.2@217598 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/i386/i386/machdep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 5841f83a..dd276e05 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1228,6 +1228,7 @@ cpu_idle_acpi(int busy) static int cpu_ident_amdc1e = 0; +#if !defined(XEN) || defined(XEN_PRIVILEGED) static int cpu_probe_amdc1e(void) { @@ -1254,6 +1255,7 @@ cpu_probe_amdc1e(void) #endif return (0); } +#endif /* * C1E renders the local APIC timer dead, so we disable it by @@ -2690,8 +2692,10 @@ init386(first) thread0.td_pcb->pcb_fsd = PCPU_GET(fsgs_gdt)[0]; thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1]; +#if defined(XEN_PRIVILEGED) if (cpu_probe_amdc1e()) cpu_idle_fn = cpu_idle_amdc1e; +#endif } #else -- 2.45.0