Author: kib
Date: Mon Feb 16 21:56:19 2015
New Revision: 278869
URL: https://svnweb.freebsd.org/changeset/base/278869

Log:
  Initialize x2APIC mode on the resume path before accessing LAPIC.
  
  Remove unneeded disable of LAPIC in the native_lapic_xapic_mode().  We
  attempt to send wakeup IPI on the resume path right after BSP wakeup,
  so disabling is wrong.
  
  Reported and tested by:       glebius, "Ranjan1018 ." <21474...@gmail.com>
  Sponsored by: The FreeBSD Foundation
  MFC after:    2 months

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/x86/acpica/acpi_wakeup.c
  head/sys/x86/x86/local_apic.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c   Mon Feb 16 21:52:28 2015        
(r278868)
+++ head/sys/amd64/amd64/mp_machdep.c   Mon Feb 16 21:56:19 2015        
(r278869)
@@ -1507,6 +1507,7 @@ cpususpend_handler(void)
                vmm_resume_p();
 
        /* Resume MCA and local APIC */
+       lapic_xapic_mode();
        mca_resume();
        lapic_setup(0);
 

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c     Mon Feb 16 21:52:28 2015        
(r278868)
+++ head/sys/i386/i386/mp_machdep.c     Mon Feb 16 21:56:19 2015        
(r278869)
@@ -1555,6 +1555,7 @@ cpususpend_handler(void)
                cpu_ops.cpu_resume();
 
        /* Resume MCA and local APIC */
+       lapic_xapic_mode();
        mca_resume();
        lapic_setup(0);
 

Modified: head/sys/x86/acpica/acpi_wakeup.c
==============================================================================
--- head/sys/x86/acpica/acpi_wakeup.c   Mon Feb 16 21:52:28 2015        
(r278868)
+++ head/sys/x86/acpica/acpi_wakeup.c   Mon Feb 16 21:56:19 2015        
(r278869)
@@ -270,6 +270,7 @@ acpi_wakeup_machdep(struct acpi_softc *s
                        initializecpu();
                        PCPU_SET(switchtime, 0);
                        PCPU_SET(switchticks, ticks);
+                       lapic_xapic_mode();
 #ifdef SMP
                        if (!CPU_EMPTY(&suspcpus))
                                acpi_wakeup_cpus(sc);

Modified: head/sys/x86/x86/local_apic.c
==============================================================================
--- head/sys/x86/x86/local_apic.c       Mon Feb 16 21:52:28 2015        
(r278868)
+++ head/sys/x86/x86/local_apic.c       Mon Feb 16 21:56:19 2015        
(r278869)
@@ -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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to