Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/xen/x86/x86_xpmap.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/xen/x86/x86_xpmap.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.38 retrieving revision 1.38.2.2 diff -u -p -r1.38 -r1.38.2.2 --- src/sys/arch/xen/x86/x86_xpmap.c 2012/01/12 19:49:37 1.38 +++ src/sys/arch/xen/x86/x86_xpmap.c 2012/02/23 21:17:25 1.38.2.2 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_xpmap.c,v 1.38 2012/01/12 19:49:37 cherry Exp $ */ +/* $NetBSD: x86_xpmap.c,v 1.38.2.2 2012/02/23 21:17:25 riz Exp $ */ /* * Copyright (c) 2006 Mathieu Ropert @@ -69,7 +69,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.38 2012/01/12 19:49:37 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.38.2.2 2012/02/23 21:17:25 riz Exp $"); #include "opt_xen.h" #include "opt_ddb.h" @@ -185,8 +185,12 @@ retry: ret = HYPERVISOR_mmu_update_self(xpq_queue, xpq_idx, &ok); if (xpq_idx != 0 && ret < 0) { - printf("xpq_flush_queue: %d entries (%d successful)\n", - xpq_idx, ok); + struct cpu_info *ci; + CPU_INFO_ITERATOR cii; + + printf("xpq_flush_queue: %d entries (%d successful) on " + "cpu%d (%ld)\n", + xpq_idx, ok, xpq_cpu()->ci_index, xpq_cpu()->ci_cpuid); if (ok != 0) { xpq_queue += ok; @@ -195,9 +199,23 @@ retry: goto retry; } - for (i = 0; i < xpq_idx; i++) - printf("0x%016" PRIx64 ": 0x%016" PRIx64 "\n", - xpq_queue[i].ptr, xpq_queue[i].val); + for (CPU_INFO_FOREACH(cii, ci)) { + xpq_queue = xpq_queue_array[ci->ci_cpuid]; + xpq_idx = xpq_idx_array[ci->ci_cpuid]; + printf("cpu%d (%ld):\n", ci->ci_index, ci->ci_cpuid); + for (i = 0; i < xpq_idx; i++) { + printf(" 0x%016" PRIx64 ": 0x%016" PRIx64 "\n", + xpq_queue[i].ptr, xpq_queue[i].val); + } +#ifdef __x86_64__ + for (i = 0; i < PDIR_SLOT_PTE; i++) { + if (ci->ci_kpm_pdir[i] == 0) + continue; + printf(" kpm_pdir[%d]: 0x%" PRIx64 "\n", + i, ci->ci_kpm_pdir[i]); + } +#endif + } panic("HYPERVISOR_mmu_update failed, ret: %d\n", ret); } xpq_idx_array[xpq_cpu()->ci_cpuid] = 0; @@ -577,6 +595,7 @@ xen_pmap_bootstrap(void) * - UAREA * - dummy user PGD (x86_64) * - HYPERVISOR_shared_info + * - early_zerop * - ISA I/O mem (if needed) */ mapsize += UPAGES * NBPG; @@ -584,6 +603,7 @@ xen_pmap_bootstrap(void) mapsize += NBPG; #endif mapsize += NBPG; + mapsize += NBPG; #ifdef DOM0OPS if (xendomain_is_dom0()) { @@ -672,6 +692,7 @@ xen_bootstrap_tables (vaddr_t old_pgd, v vaddr_t page, avail, text_end, map_end; int i; extern char __data_start; + extern char *early_zerop; /* from pmap.c */ __PRINTK(("xen_bootstrap_tables(%#" PRIxVADDR ", %#" PRIxVADDR "," " %d, %d)\n", @@ -686,6 +707,7 @@ xen_bootstrap_tables (vaddr_t old_pgd, v * UAREA * dummy user PGD (x86_64 only)/gdt page (i386 only) * HYPERVISOR_shared_info + * early_zerop * ISA I/O mem (if needed) */ map_end = new_pgd + ((new_count + l2_4_count) * NBPG); @@ -693,6 +715,8 @@ xen_bootstrap_tables (vaddr_t old_pgd, v map_end += (UPAGES + 1) * NBPG; HYPERVISOR_shared_info = (shared_info_t *)map_end; map_end += NBPG; + early_zerop = (char *)map_end; + map_end += NBPG; } /* * we always set atdevbase, as it's used by init386 to find the first