Deleted Added
full compact
mp_machdep.c (255725) mp_machdep.c (256073)
1/*-
2 * Copyright (c) 1996, by Steve Passe
3 * Copyright (c) 2008, by Kip Macy
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) 2008, by Kip Macy
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/i386/xen/mp_machdep.c 255725 2013-09-20 04:35:09Z gibbs $");
28__FBSDID("$FreeBSD: head/sys/i386/xen/mp_machdep.c 256073 2013-10-05 23:11:01Z gibbs $");
29
30#include "opt_apic.h"
31#include "opt_cpu.h"
32#include "opt_kstack_pages.h"
33#include "opt_mp_watchdog.h"
34#include "opt_pmap.h"
35#include "opt_sched.h"
36#include "opt_smp.h"

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

778 bootAPgdt = gdt + (512*cpu);
779
780 /* Get per-cpu data */
781 pc = &__pcpu[bootAP];
782 pcpu_init(pc, bootAP, sizeof(struct pcpu));
783 dpcpu_init((void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
784 M_WAITOK | M_ZERO), bootAP);
785 pc->pc_apic_id = cpu_apic_ids[bootAP];
29
30#include "opt_apic.h"
31#include "opt_cpu.h"
32#include "opt_kstack_pages.h"
33#include "opt_mp_watchdog.h"
34#include "opt_pmap.h"
35#include "opt_sched.h"
36#include "opt_smp.h"

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

778 bootAPgdt = gdt + (512*cpu);
779
780 /* Get per-cpu data */
781 pc = &__pcpu[bootAP];
782 pcpu_init(pc, bootAP, sizeof(struct pcpu));
783 dpcpu_init((void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
784 M_WAITOK | M_ZERO), bootAP);
785 pc->pc_apic_id = cpu_apic_ids[bootAP];
786 /*
787 * The i386 PV port uses the apic_id as vCPU id, but the
788 * PVHVM port needs to use the acpi_id, so set it for PV
789 * also in order to work with shared devices between PV
790 * and PVHVM.
791 */
792 pc->pc_acpi_id = cpu_apic_ids[bootAP];
786 pc->pc_vcpu_id = cpu_apic_ids[bootAP];
793 pc->pc_prvspace = pc;
794 pc->pc_curthread = 0;
795
796 gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
797 gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss;
798
799 PT_SET_MA(bootAPgdt, VTOM(bootAPgdt) | PG_V | PG_RW);
800 bzero(bootAPgdt, PAGE_SIZE);

--- 500 unchanged lines hidden ---
787 pc->pc_prvspace = pc;
788 pc->pc_curthread = 0;
789
790 gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
791 gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss;
792
793 PT_SET_MA(bootAPgdt, VTOM(bootAPgdt) | PG_V | PG_RW);
794 bzero(bootAPgdt, PAGE_SIZE);

--- 500 unchanged lines hidden ---