Deleted Added
full compact
mp_machdep.c (255705) mp_machdep.c (255725)
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 255705 2013-09-19 14:41:10Z gibbs $");
28__FBSDID("$FreeBSD: head/sys/i386/xen/mp_machdep.c 255725 2013-09-20 04:35:09Z 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"

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

246 boot_cpu_id = apic_id;
247 cpu_info[apic_id].cpu_bsp = 1;
248 }
249 if (mp_ncpus < MAXCPU)
250 mp_ncpus++;
251 if (bootverbose)
252 printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" :
253 "AP");
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"

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

246 boot_cpu_id = apic_id;
247 cpu_info[apic_id].cpu_bsp = 1;
248 }
249 if (mp_ncpus < MAXCPU)
250 mp_ncpus++;
251 if (bootverbose)
252 printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" :
253 "AP");
254
255 /* Set the ACPI id (it is needed by VCPU operations) */
256 pcpu_find(apic_id)->pc_acpi_id = apic_id;
257}
258
259void
260cpu_mp_setmaxid(void)
261{
262
263 mp_maxid = MAXCPU - 1;
264}

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

781 bootAPgdt = gdt + (512*cpu);
782
783 /* Get per-cpu data */
784 pc = &__pcpu[bootAP];
785 pcpu_init(pc, bootAP, sizeof(struct pcpu));
786 dpcpu_init((void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
787 M_WAITOK | M_ZERO), bootAP);
788 pc->pc_apic_id = cpu_apic_ids[bootAP];
254}
255
256void
257cpu_mp_setmaxid(void)
258{
259
260 mp_maxid = MAXCPU - 1;
261}

--- 516 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];
789 pc->pc_prvspace = pc;
790 pc->pc_curthread = 0;
791
792 gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
793 gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss;
794
795 PT_SET_MA(bootAPgdt, VTOM(bootAPgdt) | PG_V | PG_RW);
796 bzero(bootAPgdt, PAGE_SIZE);

--- 500 unchanged lines hidden ---
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 ---