From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 19:46:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 609E8BCC; Mon, 16 Feb 2015 19:46:34 +0000 (UTC) Received: from fep31.mx.upcmail.net (fep31.mx.upcmail.net [62.179.121.49]) by mx1.freebsd.org (Postfix) with ESMTP id 6602875B; Mon, 16 Feb 2015 19:46:32 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep31-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150216194625.ILJI3302.viefep31-int.chello.at@edge03.upcmail.net>; Mon, 16 Feb 2015 20:46:25 +0100 Received: from [192.168.0.23] ([178.84.134.112]) by edge03.upcmail.net with edge id t7mP1p00U2Rg3Ey017mP3T; Mon, 16 Feb 2015 20:46:24 +0100 X-SourceIP: 178.84.134.112 Message-ID: <54E24907.9030400@rainbow-runner.nl> Date: Mon, 16 Feb 2015 20:46:15 +0100 From: Koop Mast User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen References: <201502092100.t19L0vsv010944@svn.freebsd.org> <54E1FCD0.6000500@rainbow-runner.nl> <20150216174658.GI34251@kib.kiev.ua> In-Reply-To: <20150216174658.GI34251@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 16 Feb 2015 19:46:34 -0000 On 16-2-2015 18:46, Konstantin Belousov wrote: > On Mon, Feb 16, 2015 at 03:21:04PM +0100, Koop Mast wrote: >> On 9-2-2015 22:00, Konstantin Belousov wrote: >>> Author: kib >>> Date: Mon Feb 9 21:00:56 2015 >>> New Revision: 278473 >>> URL: https://svnweb.freebsd.org/changeset/base/278473 >>> >>> Log: >>> Add x2APIC support. Enable it by default if CPU is capable. The >>> hw.x2apic_enable tunable allows disabling it from the loader prompt. >> Hi Konstantin, >> >> This commit broke my Sandybridge laptop. If x2APIC is enabled the kernel >> freezes after the >> "ACPI APIC Table: <_ASUS_ NoteBook>" line is printed. I can't get much >> information out of it since I couldn't get into the kernel debugger nor >> has the machine a serial cable. > Can you provide e.g. a photo of the machine screen with the hang boot, > of the same kernel you used for the dmesg log below ? > > Also, please provide the output of acpidump -t. https://people.freebsd.org/~kwm/x2apic/acpidump.txt https://people.freebsd.org/~kwm/x2apic/x2apic-boot.jpg The patch below didn't seem to have any noticable effect. -Koop > >> I did notice that "x2APIC" is listed in the CPU Features2 list, but for >> the cpu's it reports "x2APIC: 0". I don't know if this has to do with >> disabled x2APIC or some hardware/bios issue? > x2APIC tag for the LAPIC reports appear when cpu declares support for > x2APIC mode, like in your case. The 0/1 indicates the final value used > by kernel, i.e. 0 means disabled, by user override (your case), by BIOS > request, or due to detection of incompatible hypervisor. > >> -Koop >> >> Verbose dmesg with x2APIC disabled: >> https://people.freebsd.org/~kwm/dmesg-x2apic.txt > Also, please try the following patch. Only the local_apic.c chunk could > matter for you. > > diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c > index 13c3d43..b767691 100644 > --- a/sys/amd64/amd64/mp_machdep.c > +++ b/sys/amd64/amd64/mp_machdep.c > @@ -1507,6 +1507,7 @@ cpususpend_handler(void) > vmm_resume_p(); > > /* Resume MCA and local APIC */ > + lapic_xapic_mode(); > mca_resume(); > lapic_setup(0); > > diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c > index 32b9540..a80de54 100644 > --- a/sys/i386/i386/mp_machdep.c > +++ b/sys/i386/i386/mp_machdep.c > @@ -1555,6 +1555,7 @@ cpususpend_handler(void) > cpu_ops.cpu_resume(); > > /* Resume MCA and local APIC */ > + lapic_xapic_mode(); > mca_resume(); > lapic_setup(0); > > diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c > index 74522be..e652419 100644 > --- a/sys/x86/acpica/acpi_wakeup.c > +++ b/sys/x86/acpica/acpi_wakeup.c > @@ -270,6 +270,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, > initializecpu(); > PCPU_SET(switchtime, 0); > PCPU_SET(switchticks, ticks); > + lapic_xapic_mode(); > #ifdef SMP > if (!CPU_EMPTY(&suspcpus)) > acpi_wakeup_cpus(sc); > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index 1809fa6..1b66674 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -527,7 +527,6 @@ native_lapic_xapic_mode(void) > saveintr = intr_disable(); > if (x2apic_mode) > native_lapic_enable_x2apic(); > - native_lapic_disable(); > intr_restore(saveintr); > } >