PERFORCE change 38929 for review
Peter Wemm
peter at FreeBSD.org
Tue Sep 30 15:52:24 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=38929
Change 38929 by peter at peter_hammer on 2003/09/30 15:51:24
I'm not going to do a P==V hack for amd64, I'll use a custom
page table tree for boot and reclaim the pages. Start killing
the vile SMPpt[] and SMP_prvspace nastiness.
Affected files ...
.. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#11 edit
Differences ...
==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#11 (text+ko) ====
@@ -435,14 +435,6 @@
outb(CMOS_REG, BIOS_RESET);
mpbiosreason = inb(CMOS_DATA);
- /* set up temporary P==V mapping for AP boot */
- /* XXX this is a hack, we should boot the AP on its own stack/PTD */
- kptbase = (uintptr_t)(void *)KPTphys;
- for (i = 0; i < NKPT; i++)
- PTD[i] = (pd_entry_t)(PG_V | PG_RW |
- ((kptbase + i * PAGE_SIZE) & PG_FRAME));
- invltlb();
-
/* start each AP */
for (cpu = 0, apic_id = 0; apic_id < MAXCPU; apic_id++) {
if (!cpu_info[apic_id].cpu_present ||
@@ -450,20 +442,11 @@
continue;
cpu++;
- /* first page of AP's private space */
- pg = cpu * amd64_btop(sizeof(struct privatespace));
-
/* allocate a new private data page */
pc = (struct pcpu *)kmem_alloc(kernel_map, PAGE_SIZE);
- /* wire it into the private page table page */
- SMPpt[pg] = (pt_entry_t)(PG_V | PG_RW | vtophys(pc));
-
/* allocate and set up an idle stack data page */
- stack = (char *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE); /* XXXKSE */
- for (i = 0; i < KSTACK_PAGES; i++)
- SMPpt[pg + 1 + i] = (pt_entry_t)
- (PG_V | PG_RW | vtophys(PAGE_SIZE * i + stack));
+ stack = (char *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE);
/* prime data page for it to use */
pcpu_init(pc, cpu, sizeof(struct pcpu));
@@ -831,9 +814,6 @@
while (!aps_ready)
ia32_pause();
- /* BSP may have changed PTD while we were waiting */
- invltlb();
-
/* set up CPU registers and state */
cpu_setregs();
More information about the p4-projects
mailing list