Deleted Added
full compact
mp_machdep.c (255331) mp_machdep.c (255726)
1/*-
2 * Copyright (c) 1996, by Steve Passe
3 * Copyright (c) 2003, by Peter Wemm
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1996, by Steve Passe
3 * Copyright (c) 2003, by Peter Wemm
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/amd64/amd64/mp_machdep.c 255331 2013-09-06 22:17:02Z gibbs $");
28__FBSDID("$FreeBSD: head/sys/amd64/amd64/mp_machdep.c 255726 2013-09-20 05:06:03Z gibbs $");
29
30#include "opt_cpu.h"
31#include "opt_ddb.h"
32#include "opt_kstack_pages.h"
33#include "opt_sched.h"
34#include "opt_smp.h"
35
36#include <sys/param.h>

--- 1426 unchanged lines hidden (view full) ---

1463 */
1464void
1465cpususpend_handler(void)
1466{
1467 u_int cpu;
1468
1469 cpu = PCPU_GET(cpuid);
1470
29
30#include "opt_cpu.h"
31#include "opt_ddb.h"
32#include "opt_kstack_pages.h"
33#include "opt_sched.h"
34#include "opt_smp.h"
35
36#include <sys/param.h>

--- 1426 unchanged lines hidden (view full) ---

1463 */
1464void
1465cpususpend_handler(void)
1466{
1467 u_int cpu;
1468
1469 cpu = PCPU_GET(cpuid);
1470
1471#ifdef XENHVM
1472 mtx_assert(&smp_ipi_mtx, MA_NOTOWNED);
1473#endif
1474
1471 if (savectx(susppcbs[cpu])) {
1472 ctx_fpusave(susppcbs[cpu]->pcb_fpususpend);
1473 wbinvd();
1474 CPU_SET_ATOMIC(cpu, &suspended_cpus);
1475 } else {
1476 pmap_init_pat();
1477 initializecpu();
1478 PCPU_SET(switchtime, 0);
1479 PCPU_SET(switchticks, ticks);
1480
1481 /* Indicate that we are resumed */
1482 CPU_CLR_ATOMIC(cpu, &suspended_cpus);
1483 }
1484
1485 /* Wait for resume */
1486 while (!CPU_ISSET(cpu, &started_cpus))
1487 ia32_pause();
1488
1475 if (savectx(susppcbs[cpu])) {
1476 ctx_fpusave(susppcbs[cpu]->pcb_fpususpend);
1477 wbinvd();
1478 CPU_SET_ATOMIC(cpu, &suspended_cpus);
1479 } else {
1480 pmap_init_pat();
1481 initializecpu();
1482 PCPU_SET(switchtime, 0);
1483 PCPU_SET(switchticks, ticks);
1484
1485 /* Indicate that we are resumed */
1486 CPU_CLR_ATOMIC(cpu, &suspended_cpus);
1487 }
1488
1489 /* Wait for resume */
1490 while (!CPU_ISSET(cpu, &started_cpus))
1491 ia32_pause();
1492
1493#ifdef XENHVM
1494 /*
1495 * Reset pending bitmap IPIs, because Xen doesn't preserve pending
1496 * event channels on migration.
1497 */
1498 cpu_ipi_pending[cpu] = 0;
1499 /* register vcpu_info area */
1500 xen_hvm_init_cpu();
1501#endif
1502
1489 /* Resume MCA and local APIC */
1490 mca_resume();
1491 lapic_setup(0);
1492
1493 CPU_CLR_ATOMIC(cpu, &started_cpus);
1503 /* Resume MCA and local APIC */
1504 mca_resume();
1505 lapic_setup(0);
1506
1507 CPU_CLR_ATOMIC(cpu, &started_cpus);
1508 /* Indicate that we are resumed */
1509 CPU_CLR_ATOMIC(cpu, &suspended_cpus);
1494}
1495
1496/*
1497 * This is called once the rest of the system is up and running and we're
1498 * ready to let the AP's out of the pen.
1499 */
1500static void
1501release_aps(void *dummy __unused)

--- 42 unchanged lines hidden ---
1510}
1511
1512/*
1513 * This is called once the rest of the system is up and running and we're
1514 * ready to let the AP's out of the pen.
1515 */
1516static void
1517release_aps(void *dummy __unused)

--- 42 unchanged lines hidden ---