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 ." <214748mv@gmail.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	2 months
This commit is contained in:
Konstantin Belousov 2015-02-16 21:56:19 +00:00
parent 8dc98c2a36
commit 5f674c4cbd
4 changed files with 3 additions and 1 deletions

View File

@ -1507,6 +1507,7 @@ cpususpend_handler(void)
vmm_resume_p();
/* Resume MCA and local APIC */
lapic_xapic_mode();
mca_resume();
lapic_setup(0);

View File

@ -1555,6 +1555,7 @@ cpususpend_handler(void)
cpu_ops.cpu_resume();
/* Resume MCA and local APIC */
lapic_xapic_mode();
mca_resume();
lapic_setup(0);

View File

@ -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);

View File

@ -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);
}