Date: Fri, 3 Feb 2006 21:54:40 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 91000 for review Message-ID: <200602032154.k13Lse22042117@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=91000 Change 91000 by kmacy@kmacy:freebsd7_xen3 on 2006/02/03 21:54:37 enable DDB - fix console compiler error always map a page table for the first 4MB of kernel so that pmap_growkernel doesn't get confused and set nkpt to 1 bump tmpindex when doing mapping so that we don't re-use said page table elsewhere only copy nkpt pages of page table in pmap_pinit to match native Affected files ... .. //depot/projects/xen3/src/sys/dev/xen/console/console.c#6 edit .. //depot/projects/xen3/src/sys/i386-xen/conf/XENCONF#6 edit .. //depot/projects/xen3/src/sys/i386-xen/i386-xen/pmap.c#4 edit .. //depot/projects/xen3/src/sys/i386-xen/i386-xen/xen_machdep.c#12 edit Differences ... ==== //depot/projects/xen3/src/sys/dev/xen/console/console.c#6 (text+ko) ==== @@ -171,6 +171,7 @@ HYPERVISOR_console_io(CONSOLEIO_write, 1, (char *)&c); } +extern int db_active; static boolean_t xcons_putc(int c) { ==== //depot/projects/xen3/src/sys/i386-xen/conf/XENCONF#6 (text+ko) ==== @@ -142,7 +142,6 @@ # Be aware of the administrative consequences of enabling this! device bpf # Berkeley packet filter -#options BOOTP options XEN options XEN_PHYSDEV_ACCESS options XEN_PRIVILEGED_GUEST @@ -151,4 +150,4 @@ options DIAGNOSTIC options MAXMEM=(256*1024) #options NOXENDEBUG=1 # Turn off Debugging printfs - +options DDB ==== //depot/projects/xen3/src/sys/i386-xen/i386-xen/pmap.c#4 (text+ko) ==== @@ -289,7 +289,7 @@ #endif #ifdef XEN -static void pmap_copy_ma(vm_paddr_t src, vm_paddr_t dst); +static void pmap_copy_ma_range(vm_paddr_t src, vm_paddr_t dst, uint32_t soff, uint32_t eoff); void pd_set(struct pmap *pmap, vm_paddr_t *ptr, vm_paddr_t val, int type) @@ -1211,13 +1211,14 @@ /* XXX copies current process, does not fill in MPPTDI */ #ifdef XEN bcopy(kernel_pmap->pm_pdir + KPTDI, pmap->pm_pdir + KPTDI, - NKPDE * sizeof(pd_entry_t)); + nkpt * sizeof(pd_entry_t)); /* XXX need to copy global address entries to page directory's L1 shadow */ ma = xpmap_ptom(VM_PAGE_TO_PHYS(ptdpg[NPGPTD])); /* L1 pin shadow page director{y,ies} */ for (i = 0; i < NPGPTD; i++) { ma = xpmap_ptom(VM_PAGE_TO_PHYS(ptdpg[NPGPTD + i])); - pmap_copy_ma(kernel_pmap->pm_pdir[PTDPTDI + i] & ~(PG_RW|PG_M), ma); + pmap_copy_ma_range(kernel_pmap->pm_pdir[PTDPTDI + i] & ~(PG_RW|PG_M), ma, + KPTDI*sizeof(pd_entry_t), nkpt*sizeof(pd_entry_t)); xen_pt_pin(ma); } @@ -2791,7 +2792,7 @@ } void -pmap_copy_ma(vm_paddr_t src, vm_paddr_t dst) +pmap_copy_ma_range(vm_paddr_t src, vm_paddr_t dst, uint32_t soff, uint32_t len) { struct sysmaps *sysmaps; @@ -2810,7 +2811,7 @@ PT_SET_VA_MA(sysmaps->CMAP1, PG_V | src | PG_A, FALSE); PT_SET_VA_MA(sysmaps->CMAP2, PG_V | PG_RW | dst | PG_A | PG_M, TRUE); - bcopy(sysmaps->CADDR1, sysmaps->CADDR2, PAGE_SIZE); + bcopy(sysmaps->CADDR1 + soff, sysmaps->CADDR2 + soff, len); PT_CLEAR_VA(sysmaps->CMAP1, FALSE); PT_CLEAR_VA(sysmaps->CMAP2, TRUE); sched_unpin(); ==== //depot/projects/xen3/src/sys/i386-xen/i386-xen/xen_machdep.c#12 (text+ko) ==== @@ -751,13 +751,15 @@ op.u.set_iopl.iopl = 1; PANIC_IF(HYPERVISOR_physdev_op(&op)); + /* add page table for KERNBASE */ + xen_queue_pt_update((vm_paddr_t)(IdlePTDma + KPTDI), + xpmap_ptom((tmpindex << PAGE_SHIFT)| PG_KERNEL)); + xen_queue_pt_update(pdir_shadow_ma + KPTDI*sizeof(vm_paddr_t), + xpmap_ptom((tmpindex << PAGE_SHIFT)| PG_V | PG_A)); + xen_flush_queue(); + tmpindex++; + if (xen_start_info->flags & SIF_INITDOMAIN) { - /* add page table for KERNBASE */ - xen_queue_pt_update((vm_paddr_t)(IdlePTDma + KPTDI), - xpmap_ptom((tmpindex << PAGE_SHIFT)| PG_KERNEL)); - xen_queue_pt_update(pdir_shadow_ma + KPTDI*sizeof(vm_paddr_t), - xpmap_ptom((tmpindex << PAGE_SHIFT)| PG_V | PG_A)); - xen_flush_queue(); /* Map first megabyte */ for (i = 0; i < (256 << PAGE_SHIFT); i += PAGE_SIZE) PT_SET_MA(KERNBASE + i, i | PG_KERNEL | PG_NC_PCD);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602032154.k13Lse22042117>