Property changes on: . ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys:r211149,211151,211197,211518,215128 Index: arm/include/pmap.h =================================================================== --- arm/include/pmap.h (revision 215125) +++ arm/include/pmap.h (working copy) @@ -134,7 +134,7 @@ struct l1_ttable *pm_l1; struct l2_dtable *pm_l2[L2_SIZE]; pd_entry_t *pm_pdir; /* KVA of page directory */ - int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statictics */ TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ }; Index: powerpc/include/pmap.h =================================================================== --- powerpc/include/pmap.h (revision 215125) +++ powerpc/include/pmap.h (working copy) @@ -87,7 +87,7 @@ struct pmap { struct mtx pm_mtx; u_int pm_sr[16]; - u_int pm_active; + cpumask_t pm_active; u_int pm_context; struct pmap *pmap_phys; @@ -122,7 +122,7 @@ struct pmap { struct mtx pm_mtx; /* pmap mutex */ tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ - u_int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ int pm_refs; /* ref count */ struct pmap_statistics pm_stats; /* pmap statistics */ Index: sparc64/sparc64/mp_machdep.c =================================================================== --- sparc64/sparc64/mp_machdep.c (revision 215125) +++ sparc64/sparc64/mp_machdep.c (working copy) @@ -119,7 +119,7 @@ static vm_offset_t mp_tramp; static u_int cpuid_to_mid[MAXCPU]; static int isjbus; -static volatile u_int shutdown_cpus; +static volatile cpumask_t shutdown_cpus; static void ap_count(phandle_t node, u_int mid, u_int cpu_impl); static void ap_start(phandle_t node, u_int mid, u_int cpu_impl); Index: sparc64/include/smp.h =================================================================== --- sparc64/include/smp.h (revision 215125) +++ sparc64/include/smp.h (working copy) @@ -75,17 +75,17 @@ }; struct ipi_cache_args { - u_int ica_mask; + cpumask_t ica_mask; vm_paddr_t ica_pa; }; struct ipi_rd_args { - u_int ira_mask; + cpumask_t ira_mask; register_t *ira_val; }; struct ipi_tlb_args { - u_int ita_mask; + cpumask_t ita_mask; struct pmap *ita_pmap; u_long ita_start; u_long ita_end; @@ -206,7 +206,7 @@ ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -228,7 +228,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -250,7 +250,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -273,7 +273,7 @@ static __inline void ipi_wait(void *cookie) { - volatile u_int *mask; + volatile cpumask_t *mask; if ((mask = cookie) != NULL) { atomic_clear_int(mask, PCPU_GET(cpumask)); Index: sparc64/include/pmap.h =================================================================== --- sparc64/include/pmap.h (revision 215125) +++ sparc64/include/pmap.h (working copy) @@ -61,7 +61,7 @@ struct mtx pm_mtx; struct tte *pm_tsb; vm_object_t pm_tsb_obj; - u_int pm_active; + cpumask_t pm_active; u_int pm_context[MAXCPU]; struct pmap_statistics pm_stats; }; Index: mips/include/pmap.h =================================================================== --- mips/include/pmap.h (revision 215125) +++ mips/include/pmap.h (working copy) @@ -88,7 +88,7 @@ pd_entry_t *pm_segtab; /* KVA of segment table */ TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in * pmap */ - int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct { u_int32_t asid:ASID_BITS; /* TLB address space tag */ u_int32_t gen:ASIDGEN_BITS; /* its generation number */ Property changes on: dev/xen/xenpci ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/dev/xen/xenpci:r211149,211151,211197,211518,215128 Index: sun4v/sun4v/mp_machdep.c =================================================================== --- sun4v/sun4v/mp_machdep.c (revision 215125) +++ sun4v/sun4v/mp_machdep.c (working copy) @@ -115,7 +115,7 @@ u_int mp_boot_mid; -static volatile u_int shutdown_cpus; +static volatile cpumask_t shutdown_cpus; void cpu_mp_unleash(void *); SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); @@ -519,7 +519,7 @@ } void -ipi_selected(u_int icpus, u_int ipi) +ipi_selected(cpumask_t icpus, u_int ipi) { int i, cpu_count; uint16_t *cpulist; Index: sun4v/sun4v/pmap.c =================================================================== --- sun4v/sun4v/pmap.c (revision 215125) +++ sun4v/sun4v/pmap.c (working copy) @@ -1402,7 +1402,7 @@ { int i, cpu_count, retried; - u_int cpus; + cpumask_t cpus; cpumask_t cpumask, active, curactive; cpumask_t active_total, ackmask; uint16_t *cpulist; Index: sun4v/include/smp.h =================================================================== --- sun4v/include/smp.h (revision 215125) +++ sun4v/include/smp.h (working copy) @@ -58,12 +58,12 @@ }; struct ipi_cache_args { - u_int ica_mask; + cpumask_t ica_mask; vm_paddr_t ica_pa; }; struct ipi_tlb_args { - u_int ita_mask; + cpumask_t ita_mask; struct pmap *ita_pmap; u_long ita_start; u_long ita_end; @@ -75,7 +75,7 @@ void cpu_mp_bootstrap(struct pcpu *pc); void cpu_mp_shutdown(void); -void cpu_ipi_selected(int cpus, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); +void cpu_ipi_selected(int cpu_count, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); void cpu_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); void cpu_ipi_ast(struct trapframe *tf); @@ -84,7 +84,7 @@ void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); -void ipi_selected(u_int cpus, u_int ipi); +void ipi_selected(cpumask_t cpus, u_int ipi); vm_offset_t mp_tramp_alloc(void); void mp_set_tsb_desc_ra(vm_paddr_t); @@ -148,7 +148,7 @@ ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -167,7 +167,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -186,7 +186,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -205,7 +205,7 @@ static __inline void ipi_wait(void *cookie) { - volatile u_int *mask; + volatile cpumask_t *mask; if ((mask = cookie) != NULL) { atomic_clear_int(mask, PCPU_GET(cpumask)); Index: sun4v/include/pmap.h =================================================================== --- sun4v/include/pmap.h (revision 215125) +++ sun4v/include/pmap.h (working copy) @@ -54,7 +54,6 @@ #define TSB_MAX_RESIZE (20 - TSB_INIT_SHIFT - PAGE_SHIFT) typedef struct pmap *pmap_t; -typedef uint32_t pmap_cpumask_t; struct pv_entry; struct tte_hash; @@ -75,8 +74,8 @@ struct tte_hash *pm_hash; TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ struct hv_tsb_info pm_tsb; - pmap_cpumask_t pm_active; /* mask of cpus currently using pmap */ - pmap_cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ + cpumask_t pm_active; /* mask of cpus currently using pmap */ + cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ struct pmap_statistics pm_stats; uint32_t pm_tsb_miss_count; uint32_t pm_tsb_cap_miss_count; Index: i386/i386/vm_machdep.c =================================================================== --- i386/i386/vm_machdep.c (revision 215125) +++ i386/i386/vm_machdep.c (working copy) @@ -592,7 +592,8 @@ #endif #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) & ~stopped_cpus; Index: i386/i386/pmap.c =================================================================== --- i386/i386/pmap.c (revision 215125) +++ i386/i386/pmap.c (working copy) @@ -935,8 +935,7 @@ void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -956,8 +955,7 @@ void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; sched_pin(); @@ -981,8 +979,7 @@ void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { Index: i386/i386/mp_machdep.c =================================================================== --- i386/i386/mp_machdep.c (revision 215125) +++ i386/i386/mp_machdep.c (working copy) @@ -1443,9 +1443,12 @@ void cpustop_handler(void) { - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; + u_int cpu; + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); + savectx(&stoppcbs[cpu]); /* Indicate that we are stopped */ @@ -1612,19 +1615,23 @@ int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask; #ifdef MP_WATCHDOG - u_int cpuid = PCPU_GET(cpuid); + u_int cpuid; #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG + cpuid = PCPU_GET(cpuid); ap_watchdog(cpuid); #endif - retval = mask & hlt_cpus_mask; - while (mask & hlt_cpus_mask) + retval = 0; + while (mask & hlt_cpus_mask) { + retval = 1; __asm __volatile("sti; hlt" : : : "memory"); + } return (retval); } Index: i386/xen/pmap.c =================================================================== --- i386/xen/pmap.c (revision 215125) +++ i386/xen/pmap.c (working copy) @@ -851,8 +851,7 @@ void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; CTR2(KTR_PMAP, "pmap_invalidate_page: pmap=%p va=0x%x", pmap, va); @@ -876,8 +875,7 @@ void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; CTR3(KTR_PMAP, "pmap_invalidate_page: pmap=%p eva=0x%x sva=0x%x", @@ -905,8 +903,7 @@ void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; CTR1(KTR_PMAP, "pmap_invalidate_page: pmap=%p", pmap); Property changes on: contrib/pf ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/contrib/pf:r211149,211151,211197,211518,215128 Property changes on: contrib/dev/acpica ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/contrib/dev/acpica:r211149,211151,211197,211518,215128 Property changes on: cddl/contrib/opensolaris ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/cddl/contrib/opensolaris:r211149,211151,211197,211518,215128 Property changes on: amd64/include/xen ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/amd64/include/xen:r211149,211151,211197,211518,215128 Index: amd64/amd64/vm_machdep.c =================================================================== --- amd64/amd64/vm_machdep.c (revision 215125) +++ amd64/amd64/vm_machdep.c (working copy) @@ -520,7 +520,8 @@ cpu_reset() { #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) & ~stopped_cpus; Index: amd64/amd64/pmap.c =================================================================== --- amd64/amd64/pmap.c (revision 215125) +++ amd64/amd64/pmap.c (working copy) @@ -860,8 +860,7 @@ void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -881,8 +880,7 @@ void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; sched_pin(); @@ -906,8 +904,7 @@ void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { Index: amd64/amd64/mp_machdep.c =================================================================== --- amd64/amd64/mp_machdep.c (revision 215125) +++ amd64/amd64/mp_machdep.c (working copy) @@ -1047,7 +1047,7 @@ int ncpu, othercpus; othercpus = mp_ncpus - 1; - if (mask == (u_int)-1) { + if (mask == (cpumask_t)-1) { ncpu = othercpus; if (ncpu < 1) return; @@ -1072,7 +1072,7 @@ smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; atomic_store_rel_int(&smp_tlb_wait, 0); - if (mask == (u_int)-1) + if (mask == (cpumask_t)-1) ipi_all_but_self(vector); else ipi_selected(mask, vector); @@ -1283,9 +1283,12 @@ void cpustop_handler(void) { - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; + u_int cpu; + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); + savectx(&stoppcbs[cpu]); /* Indicate that we are stopped */ @@ -1312,10 +1315,13 @@ cpususpend_handler(void) { struct savefpu *stopfpu; + cpumask_t cpumask; register_t cr3, rf; - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + u_int cpu; + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); + rf = intr_disable(); cr3 = rcr3(); stopfpu = &stopxpcbs[cpu].xpcb_pcb.pcb_save; @@ -1488,18 +1494,22 @@ int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask; #ifdef MP_WATCHDOG - u_int cpuid = PCPU_GET(cpuid); + u_int cpuid; #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG + cpuid = PCPU_GET(cpuid); ap_watchdog(cpuid); #endif - retval = mask & hlt_cpus_mask; - while (mask & hlt_cpus_mask) + retval = 0; + while (mask & hlt_cpus_mask) { + retval = 1; __asm __volatile("sti; hlt" : : : "memory"); + } return (retval); }