Date: Fri, 28 Dec 2007 21:48:11 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 131913 for review Message-ID: <200712282148.lBSLmBBi001993@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131913 Change 131913 by kmacy@pandemonium:kmacy:xen31 on 2007/12/28 21:47:40 use PTDPTDI rather than explicit value give other domain time to run before calling xs_process_msg put pdir ma in pdpt not pdir shadow ma Affected files ... .. //depot/projects/xen31/sys/i386/xen/pmap.c#8 edit .. //depot/projects/xen31/sys/i386/xen/xen_machdep.c#8 edit .. //depot/projects/xen31/sys/xen/xenbus/xenbus_xs.c#4 edit Differences ... ==== //depot/projects/xen31/sys/i386/xen/pmap.c#8 (text+ko) ==== @@ -1432,7 +1432,6 @@ /* Wire in kernel global address entries. */ bcopy(PTD + KPTDI, pmap->pm_pdir + KPTDI, nkpt * sizeof(pd_entry_t)); - /* XXX need to copy global address entries to page directory's L1 shadow */ #ifdef PAE #ifdef XEN pmap_qenter((vm_offset_t)pmap->pm_pdpt, &ptdpg[NPGPTD*2], 1); @@ -1440,7 +1439,7 @@ for (i = 0; i < NPGPTD; i++) { vm_paddr_t ma; - ma = xpmap_ptom(VM_PAGE_TO_PHYS(ptdpg[NPGPTD + i])); + ma = xpmap_ptom(VM_PAGE_TO_PHYS(ptdpg[i])); pmap->pm_pdpt[i] = ma | PG_V; } @@ -1457,15 +1456,15 @@ for (i = 0; i < NPGPTD; i++) pmap->pm_pdir[PTDPTDI + i] = xpmap_ptom(VM_PAGE_TO_PHYS(ptdpg[i + NPGPTD])) | PG_V; - - bcopy(PTD + KPTDI, pmap->pm_pdir_shadow + KPTDI, nkpt * sizeof(pd_entry_t)); + for (i = KPTDI; i < KPTDI + nkpt; i++) + pmap->pm_pdir_shadow[i] = PTD[i] & ~(PG_RW|PG_M|PG_A); for (i = 0; i < NPGPTD; i++) { vm_paddr_t *pd; pd = pmap->pm_pdir + (i * NPDEPG); - PT_SET_MA(pd, *vtopte((vm_offset_t)pd) & ~PG_RW); + PT_SET_MA(pd, *vtopte((vm_offset_t)pd) & ~(PG_M|PG_A|PG_U|PG_RW)); pd = pmap->pm_pdir_shadow + (i * NPDEPG); - PT_SET_MA(pd, *vtopte((vm_offset_t)pd) & ~PG_RW); + PT_SET_MA(pd, *vtopte((vm_offset_t)pd) & ~(PG_M|PG_A|PG_U|PG_RW)); } #ifdef PAE PT_SET_MA(pmap->pm_pdpt, *vtopte((vm_offset_t)pmap->pm_pdpt) & ~PG_RW); ==== //depot/projects/xen31/sys/i386/xen/xen_machdep.c#8 (text+ko) ==== @@ -798,13 +798,13 @@ * L2 */ for (i = 0; i < 4; i++) - IdlePTDnew[1532 + i] = pdir_shadow_ma[i] | PG_V; + IdlePTDnew[PTDPTDI + i] = pdir_shadow_ma[i] | PG_V; /* * Map IdlePTD at PTD */ for (i = 0; i < 4; i++) - pdir_shadow[1532 + i] = IdlePTDnewma[i] | PG_V; + pdir_shadow[PTDPTDI + i] = IdlePTDnewma[i] | PG_V; PT_SET_MA(IdlePDPTnew, IdlePDPTnewma | PG_V); xen_pt_unpin(IdlePDPTma); ==== //depot/projects/xen31/sys/xen/xenbus/xenbus_xs.c#4 (text+ko) ==== @@ -140,10 +140,17 @@ { struct xs_stored_msg *msg; char *body; - - if (HYPERVISOR_shared_info->evtchn_mask[curcpu] & 1) + int i; + + if (HYPERVISOR_shared_info->evtchn_mask[curcpu] & 1) { + /* + * Give other domain time to run :-/ + */ + for (i = 0; i < 1000; i++) + HYPERVISOR_sched_op(SCHEDOP_yield, NULL); xs_process_msg(); - + } + spin_lock(&xs_state.reply_lock); while (list_empty(&xs_state.reply_list)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712282148.lBSLmBBi001993>