xref: /onnv-gate/usr/src/uts/sun4v/cpu/niagara.c (revision 5352:30dae0788871)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51592Sgirish  * Common Development and Distribution License (the "License").
61592Sgirish  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
214203Srsmaeda 
220Sstevel@tonic-gate /*
233434Sesaxe  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #include <sys/types.h>
300Sstevel@tonic-gate #include <sys/systm.h>
310Sstevel@tonic-gate #include <sys/archsystm.h>
320Sstevel@tonic-gate #include <sys/machparam.h>
330Sstevel@tonic-gate #include <sys/machsystm.h>
340Sstevel@tonic-gate #include <sys/cpu.h>
350Sstevel@tonic-gate #include <sys/elf_SPARC.h>
360Sstevel@tonic-gate #include <vm/hat_sfmmu.h>
370Sstevel@tonic-gate #include <vm/page.h>
380Sstevel@tonic-gate #include <sys/cpuvar.h>
390Sstevel@tonic-gate #include <sys/async.h>
400Sstevel@tonic-gate #include <sys/cmn_err.h>
410Sstevel@tonic-gate #include <sys/debug.h>
420Sstevel@tonic-gate #include <sys/dditypes.h>
430Sstevel@tonic-gate #include <sys/sunddi.h>
440Sstevel@tonic-gate #include <sys/cpu_module.h>
450Sstevel@tonic-gate #include <sys/prom_debug.h>
460Sstevel@tonic-gate #include <sys/vmsystm.h>
470Sstevel@tonic-gate #include <sys/prom_plat.h>
480Sstevel@tonic-gate #include <sys/sysmacros.h>
490Sstevel@tonic-gate #include <sys/intreg.h>
500Sstevel@tonic-gate #include <sys/machtrap.h>
510Sstevel@tonic-gate #include <sys/ontrap.h>
520Sstevel@tonic-gate #include <sys/ivintr.h>
530Sstevel@tonic-gate #include <sys/atomic.h>
540Sstevel@tonic-gate #include <sys/panic.h>
550Sstevel@tonic-gate #include <sys/dtrace.h>
560Sstevel@tonic-gate #include <sys/simulate.h>
570Sstevel@tonic-gate #include <sys/fault.h>
581050Sgirish #include <sys/niagararegs.h>
591050Sgirish #include <sys/trapstat.h>
601592Sgirish #include <sys/hsvc.h>
610Sstevel@tonic-gate 
621991Sheppo #define	NI_MMU_PAGESIZE_MASK	((1 << TTE8K) | (1 << TTE64K) | (1 << TTE4M) \
631991Sheppo 				    | (1 << TTE256M))
640Sstevel@tonic-gate 
650Sstevel@tonic-gate uint_t root_phys_addr_lo_mask = 0xffffffffU;
661050Sgirish static niagara_mmustat_t *cpu_tstat_va;		/* VA of mmustat buffer */
671050Sgirish static uint64_t cpu_tstat_pa;			/* PA of mmustat buffer */
681592Sgirish char cpu_module_name[] = "SUNW,UltraSPARC-T1";
690Sstevel@tonic-gate 
701592Sgirish /*
711592Sgirish  * Hypervisor services information for the NIAGARA CPU module
721592Sgirish  */
731592Sgirish static boolean_t niagara_hsvc_available = B_TRUE;
741592Sgirish static uint64_t niagara_sup_minor;		/* Supported minor number */
751592Sgirish static hsvc_info_t niagara_hsvc = {
761592Sgirish 	HSVC_REV_1, NULL, HSVC_GROUP_NIAGARA_CPU, 1, 0, cpu_module_name
771592Sgirish };
780Sstevel@tonic-gate 
790Sstevel@tonic-gate void
800Sstevel@tonic-gate cpu_setup(void)
810Sstevel@tonic-gate {
820Sstevel@tonic-gate 	extern int mmu_exported_pagesize_mask;
830Sstevel@tonic-gate 	extern int cpc_has_overflow_intr;
841592Sgirish 	int status;
851991Sheppo 	char *ni_isa_set[] = {
861991Sheppo 	    "sparcv9+vis",
871991Sheppo 	    "sparcv9+vis2",
881991Sheppo 	    "sparcv8plus+vis",
891991Sheppo 	    "sparcv8plus+vis2",
901991Sheppo 	    NULL
911991Sheppo 	};
921592Sgirish 
931592Sgirish 	/*
941592Sgirish 	 * Negotiate the API version for Niagara specific hypervisor
951592Sgirish 	 * services.
961592Sgirish 	 */
971592Sgirish 	status = hsvc_register(&niagara_hsvc, &niagara_sup_minor);
981592Sgirish 	if (status != 0) {
991592Sgirish 		cmn_err(CE_WARN, "%s: cannot negotiate hypervisor services "
1001717Swesolows 		    "group: 0x%lx major: 0x%lx minor: 0x%lx errno: %d\n",
1011592Sgirish 		    niagara_hsvc.hsvc_modname, niagara_hsvc.hsvc_group,
1021592Sgirish 		    niagara_hsvc.hsvc_major, niagara_hsvc.hsvc_minor, status);
1031592Sgirish 		niagara_hsvc_available = B_FALSE;
1041592Sgirish 	}
1050Sstevel@tonic-gate 
1061991Sheppo 	/*
1071991Sheppo 	 * The setup common to all CPU modules is done in cpu_setup_common
1081991Sheppo 	 * routine.
1091991Sheppo 	 */
1101991Sheppo 	cpu_setup_common(ni_isa_set);
1111991Sheppo 
1120Sstevel@tonic-gate 	cache |= (CACHE_PTAG | CACHE_IOCOHERENT);
1130Sstevel@tonic-gate 
1141991Sheppo 	if (broken_md_flag) {
1151991Sheppo 		/*
1161991Sheppo 		 * Turn on the missing bits supported by Niagara CPU in
1171991Sheppo 		 * MMU pagesize mask returned by MD.
1181991Sheppo 		 */
1191991Sheppo 		mmu_exported_pagesize_mask |= NI_MMU_PAGESIZE_MASK;
1201991Sheppo 	} else {
1211991Sheppo 		if ((mmu_exported_pagesize_mask &
1221991Sheppo 		    DEFAULT_SUN4V_MMU_PAGESIZE_MASK) !=
1231991Sheppo 		    DEFAULT_SUN4V_MMU_PAGESIZE_MASK)
1241991Sheppo 			cmn_err(CE_PANIC, "machine description"
1251991Sheppo 			    " does not have required sun4v page sizes"
1261991Sheppo 			    " 8K, 64K and 4M: MD mask is 0x%x",
1271991Sheppo 			    mmu_exported_pagesize_mask);
1280Sstevel@tonic-gate 	}
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate 	cpu_hwcap_flags |= AV_SPARC_ASI_BLK_INIT;
1310Sstevel@tonic-gate 
1320Sstevel@tonic-gate 	/*
133303Sgirish 	 * Niagara supports a 48-bit subset of the full 64-bit virtual
134303Sgirish 	 * address space. Virtual addresses between 0x0000800000000000
135303Sgirish 	 * and 0xffff.7fff.ffff.ffff inclusive lie within a "VA Hole"
136303Sgirish 	 * and must never be mapped. In addition, software must not use
137303Sgirish 	 * pages within 4GB of the VA hole as instruction pages to
138303Sgirish 	 * avoid problems with prefetching into the VA hole.
1390Sstevel@tonic-gate 	 */
1401991Sheppo 	hole_start = (caddr_t)((1ull << (va_bits - 1)) - (1ull << 32));
1411991Sheppo 	hole_end = (caddr_t)((0ull - (1ull << (va_bits - 1))) + (1ull << 32));
1420Sstevel@tonic-gate 
1430Sstevel@tonic-gate 	/*
1440Sstevel@tonic-gate 	 * Niagara has a performance counter overflow interrupt
1450Sstevel@tonic-gate 	 */
1460Sstevel@tonic-gate 	cpc_has_overflow_intr = 1;
1474528Spaulsan 
1484528Spaulsan 	shctx_on = 0;
1490Sstevel@tonic-gate }
1500Sstevel@tonic-gate 
1511991Sheppo #define	MB(n)	((n) * 1024 * 1024)
1520Sstevel@tonic-gate /*
1530Sstevel@tonic-gate  * Set the magic constants of the implementation.
1540Sstevel@tonic-gate  */
1550Sstevel@tonic-gate void
1560Sstevel@tonic-gate cpu_fiximp(struct cpu_node *cpunode)
1570Sstevel@tonic-gate {
1580Sstevel@tonic-gate 	/*
1591991Sheppo 	 * The Cache node is optional in MD. Therefore in case "Cache"
1601991Sheppo 	 * node does not exists in MD, set the default L2 cache associativity,
1611991Sheppo 	 * size, linesize.
1620Sstevel@tonic-gate 	 */
1630Sstevel@tonic-gate 	if (cpunode->ecache_size == 0)
1641991Sheppo 		cpunode->ecache_size = MB(3);
1650Sstevel@tonic-gate 	if (cpunode->ecache_linesize == 0)
1660Sstevel@tonic-gate 		cpunode->ecache_linesize = 64;
1670Sstevel@tonic-gate 	if (cpunode->ecache_associativity == 0)
1680Sstevel@tonic-gate 		cpunode->ecache_associativity = 12;
1690Sstevel@tonic-gate }
1700Sstevel@tonic-gate 
1710Sstevel@tonic-gate void
1724203Srsmaeda cpu_map_exec_units(struct cpu *cp)
1730Sstevel@tonic-gate {
1744203Srsmaeda 	ASSERT(MUTEX_HELD(&cpu_lock));
1750Sstevel@tonic-gate 
176220Sesaxe 	/*
1773434Sesaxe 	 * The cpu_ipipe and cpu_fpu fields are initialized based on
1784203Srsmaeda 	 * the execution unit sharing information from the MD. They
1794203Srsmaeda 	 * default to the CPU id in the absence of such information.
180220Sesaxe 	 */
1811991Sheppo 	cp->cpu_m.cpu_ipipe = cpunodes[cp->cpu_id].exec_unit_mapping;
1821991Sheppo 	if (cp->cpu_m.cpu_ipipe == NO_EU_MAPPING_FOUND)
1831991Sheppo 		cp->cpu_m.cpu_ipipe = (id_t)(cp->cpu_id);
184220Sesaxe 
1853434Sesaxe 	cp->cpu_m.cpu_fpu = cpunodes[cp->cpu_id].fpu_mapping;
1863434Sesaxe 	if (cp->cpu_m.cpu_fpu == NO_EU_MAPPING_FOUND)
1873434Sesaxe 		cp->cpu_m.cpu_fpu = (id_t)(cp->cpu_id);
1883434Sesaxe 
1893434Sesaxe 	/*
1903434Sesaxe 	 * Niagara defines the the core to be at the ipipe level
1913434Sesaxe 	 */
1923434Sesaxe 	cp->cpu_m.cpu_core = cp->cpu_m.cpu_ipipe;
1934732Sdavemq 
1944732Sdavemq 	/*
1954732Sdavemq 	 * Niagara systems just have one chip. Therefore, the chip id
1964769Sdp78419 	 * mpipe id are always 0.
1974732Sdavemq 	 */
1984732Sdavemq 	cp->cpu_m.cpu_chip = 0;
1994769Sdp78419 	cp->cpu_m.cpu_mpipe = 0;
2004203Srsmaeda }
2014203Srsmaeda 
2024203Srsmaeda static int niagara_cpucnt;
2034203Srsmaeda 
2044203Srsmaeda void
2054203Srsmaeda cpu_init_private(struct cpu *cp)
2064203Srsmaeda {
2074203Srsmaeda 	extern void niagara_kstat_init(void);
2083434Sesaxe 
2090Sstevel@tonic-gate 	ASSERT(MUTEX_HELD(&cpu_lock));
2104203Srsmaeda 
2114203Srsmaeda 	cpu_map_exec_units(cp);
2124203Srsmaeda 
2134203Srsmaeda 	if ((niagara_cpucnt++ == 0) && (niagara_hsvc_available == B_TRUE))
2144203Srsmaeda 		niagara_kstat_init();
2150Sstevel@tonic-gate }
2160Sstevel@tonic-gate 
2174203Srsmaeda /*ARGSUSED*/
2180Sstevel@tonic-gate void
2190Sstevel@tonic-gate cpu_uninit_private(struct cpu *cp)
2200Sstevel@tonic-gate {
2214203Srsmaeda 	extern void niagara_kstat_fini(void);
2220Sstevel@tonic-gate 
2230Sstevel@tonic-gate 	ASSERT(MUTEX_HELD(&cpu_lock));
2244203Srsmaeda 
2254203Srsmaeda 	if ((--niagara_cpucnt == 0) && (niagara_hsvc_available == B_TRUE))
2264203Srsmaeda 		niagara_kstat_fini();
2270Sstevel@tonic-gate }
2280Sstevel@tonic-gate 
2290Sstevel@tonic-gate /*
2300Sstevel@tonic-gate  * On Niagara, any flush will cause all preceding stores to be
2310Sstevel@tonic-gate  * synchronized wrt the i$, regardless of address or ASI.  In fact,
2320Sstevel@tonic-gate  * the address is ignored, so we always flush address 0.
2330Sstevel@tonic-gate  */
234*5352Ssvemuri /*ARGSUSED*/
2350Sstevel@tonic-gate void
2360Sstevel@tonic-gate dtrace_flush_sec(uintptr_t addr)
2370Sstevel@tonic-gate {
2380Sstevel@tonic-gate 	doflush(0);
2390Sstevel@tonic-gate }
2400Sstevel@tonic-gate 
2410Sstevel@tonic-gate #define	IS_FLOAT(i) (((i) & 0x1000000) != 0)
2420Sstevel@tonic-gate #define	IS_IBIT_SET(x)	(x & 0x2000)
2430Sstevel@tonic-gate #define	IS_VIS1(op, op3)(op == 2 && op3 == 0x36)
2440Sstevel@tonic-gate #define	IS_PARTIAL_OR_SHORT_FLOAT_LD_ST(op, op3, asi)		\
2450Sstevel@tonic-gate 		(op == 3 && (op3 == IOP_V8_LDDFA ||		\
2460Sstevel@tonic-gate 		op3 == IOP_V8_STDFA) &&	asi > ASI_SNFL)
2470Sstevel@tonic-gate int
2480Sstevel@tonic-gate vis1_partial_support(struct regs *rp, k_siginfo_t *siginfo, uint_t *fault)
2490Sstevel@tonic-gate {
2500Sstevel@tonic-gate 	char *badaddr;
2510Sstevel@tonic-gate 	int instr;
2520Sstevel@tonic-gate 	uint_t	optype, op3, asi;
253*5352Ssvemuri 	uint_t	ignor;
2540Sstevel@tonic-gate 
255526Sarao 	if (!USERMODE(rp->r_tstate))
256526Sarao 		return (-1);
2570Sstevel@tonic-gate 
2580Sstevel@tonic-gate 	instr = fetch_user_instr((caddr_t)rp->r_pc);
2590Sstevel@tonic-gate 
2600Sstevel@tonic-gate 	optype = (instr >> 30) & 0x3;
2610Sstevel@tonic-gate 	op3 = (instr >> 19) & 0x3f;
2620Sstevel@tonic-gate 	ignor = (instr >> 5) & 0xff;
2630Sstevel@tonic-gate 	if (IS_IBIT_SET(instr)) {
2640Sstevel@tonic-gate 		asi = (uint32_t)((rp->r_tstate >> TSTATE_ASI_SHIFT) &
2650Sstevel@tonic-gate 		    TSTATE_ASI_MASK);
2660Sstevel@tonic-gate 	} else {
2670Sstevel@tonic-gate 		asi = ignor;
2680Sstevel@tonic-gate 	}
2690Sstevel@tonic-gate 
2700Sstevel@tonic-gate 	if (!IS_VIS1(optype, op3) &&
2710Sstevel@tonic-gate 	    !IS_PARTIAL_OR_SHORT_FLOAT_LD_ST(optype, op3, asi)) {
2720Sstevel@tonic-gate 		return (-1);
2730Sstevel@tonic-gate 	}
2740Sstevel@tonic-gate 	switch (simulate_unimp(rp, &badaddr)) {
2750Sstevel@tonic-gate 	case SIMU_RETRY:
2760Sstevel@tonic-gate 		break;	/* regs are already set up */
2770Sstevel@tonic-gate 		/*NOTREACHED*/
2780Sstevel@tonic-gate 
2790Sstevel@tonic-gate 	case SIMU_SUCCESS:
2800Sstevel@tonic-gate 		/*
2810Sstevel@tonic-gate 		 * skip the successfully
2820Sstevel@tonic-gate 		 * simulated instruction
2830Sstevel@tonic-gate 		 */
2840Sstevel@tonic-gate 		rp->r_pc = rp->r_npc;
2850Sstevel@tonic-gate 		rp->r_npc += 4;
2860Sstevel@tonic-gate 		break;
2870Sstevel@tonic-gate 		/*NOTREACHED*/
2880Sstevel@tonic-gate 
2890Sstevel@tonic-gate 	case SIMU_FAULT:
2900Sstevel@tonic-gate 		siginfo->si_signo = SIGSEGV;
2910Sstevel@tonic-gate 		siginfo->si_code = SEGV_MAPERR;
2920Sstevel@tonic-gate 		siginfo->si_addr = badaddr;
2930Sstevel@tonic-gate 		*fault = FLTBOUNDS;
2940Sstevel@tonic-gate 		break;
2950Sstevel@tonic-gate 
2960Sstevel@tonic-gate 	case SIMU_DZERO:
2970Sstevel@tonic-gate 		siginfo->si_signo = SIGFPE;
2980Sstevel@tonic-gate 		siginfo->si_code = FPE_INTDIV;
2990Sstevel@tonic-gate 		siginfo->si_addr = (caddr_t)rp->r_pc;
3000Sstevel@tonic-gate 		*fault = FLTIZDIV;
3010Sstevel@tonic-gate 		break;
3020Sstevel@tonic-gate 
3030Sstevel@tonic-gate 	case SIMU_UNALIGN:
3040Sstevel@tonic-gate 		siginfo->si_signo = SIGBUS;
3050Sstevel@tonic-gate 		siginfo->si_code = BUS_ADRALN;
3060Sstevel@tonic-gate 		siginfo->si_addr = badaddr;
3070Sstevel@tonic-gate 		*fault = FLTACCESS;
3080Sstevel@tonic-gate 		break;
3090Sstevel@tonic-gate 
3100Sstevel@tonic-gate 	case SIMU_ILLEGAL:
3110Sstevel@tonic-gate 	default:
3120Sstevel@tonic-gate 		siginfo->si_signo = SIGILL;
3130Sstevel@tonic-gate 		op3 = (instr >> 19) & 0x3F;
3140Sstevel@tonic-gate 		if ((IS_FLOAT(instr) && (op3 == IOP_V8_STQFA) ||
3150Sstevel@tonic-gate 		    (op3 == IOP_V8_STDFA)))
3160Sstevel@tonic-gate 			siginfo->si_code = ILL_ILLADR;
3170Sstevel@tonic-gate 		else
3180Sstevel@tonic-gate 			siginfo->si_code = ILL_ILLOPC;
3190Sstevel@tonic-gate 		siginfo->si_addr = (caddr_t)rp->r_pc;
3200Sstevel@tonic-gate 		*fault = FLTILL;
3210Sstevel@tonic-gate 		break;
3220Sstevel@tonic-gate 	}
3230Sstevel@tonic-gate 	return (0);
3240Sstevel@tonic-gate }
3251050Sgirish 
3261050Sgirish /*
3271050Sgirish  * Trapstat support for Niagara processor
3281050Sgirish  */
3291050Sgirish int
3301050Sgirish cpu_trapstat_conf(int cmd)
3311050Sgirish {
3321050Sgirish 	size_t len;
3331050Sgirish 	uint64_t mmustat_pa, hvret;
3341050Sgirish 	int status = 0;
3351050Sgirish 
3361592Sgirish 	if (niagara_hsvc_available == B_FALSE)
3371592Sgirish 		return (ENOTSUP);
3381592Sgirish 
3391050Sgirish 	switch (cmd) {
3401050Sgirish 	case CPU_TSTATCONF_INIT:
3411050Sgirish 		ASSERT(cpu_tstat_va == NULL);
3421050Sgirish 		len = (NCPU+1) * sizeof (niagara_mmustat_t);
3431050Sgirish 		cpu_tstat_va = contig_mem_alloc_align(len,
3441050Sgirish 		    sizeof (niagara_mmustat_t));
3451050Sgirish 		if (cpu_tstat_va == NULL)
3461050Sgirish 			status = EAGAIN;
3471050Sgirish 		else {
3481050Sgirish 			bzero(cpu_tstat_va, len);
3491050Sgirish 			cpu_tstat_pa = va_to_pa(cpu_tstat_va);
3501050Sgirish 		}
3511050Sgirish 		break;
3521050Sgirish 
3531050Sgirish 	case CPU_TSTATCONF_FINI:
3541050Sgirish 		if (cpu_tstat_va) {
3551050Sgirish 			len = (NCPU+1) * sizeof (niagara_mmustat_t);
3561050Sgirish 			contig_mem_free(cpu_tstat_va, len);
3571050Sgirish 			cpu_tstat_va = NULL;
3581050Sgirish 			cpu_tstat_pa = 0;
3591050Sgirish 		}
3601050Sgirish 		break;
3611050Sgirish 
3621050Sgirish 	case CPU_TSTATCONF_ENABLE:
3631050Sgirish 		hvret = hv_niagara_mmustat_conf((cpu_tstat_pa +
3641050Sgirish 		    (CPU->cpu_id+1) * sizeof (niagara_mmustat_t)),
3651050Sgirish 		    (uint64_t *)&mmustat_pa);
3661050Sgirish 		if (hvret != H_EOK)
3671050Sgirish 			status = EINVAL;
3681050Sgirish 		break;
3691050Sgirish 
3701050Sgirish 	case CPU_TSTATCONF_DISABLE:
3711050Sgirish 		hvret = hv_niagara_mmustat_conf(0, (uint64_t *)&mmustat_pa);
3721050Sgirish 		if (hvret != H_EOK)
3731050Sgirish 			status = EINVAL;
3741050Sgirish 		break;
3751050Sgirish 
3761050Sgirish 	default:
3771050Sgirish 		status = EINVAL;
3781050Sgirish 		break;
3791050Sgirish 	}
3801050Sgirish 	return (status);
3811050Sgirish }
3821050Sgirish 
3831050Sgirish void
3841050Sgirish cpu_trapstat_data(void *buf, uint_t tstat_pgszs)
3851050Sgirish {
3861050Sgirish 	niagara_mmustat_t	*mmustatp;
3871050Sgirish 	tstat_pgszdata_t	*tstatp = (tstat_pgszdata_t *)buf;
388*5352Ssvemuri 	int	i;
3891050Sgirish 
3901050Sgirish 	if (cpu_tstat_va == NULL)
3911050Sgirish 		return;
3921050Sgirish 
3931050Sgirish 	mmustatp = &((niagara_mmustat_t *)cpu_tstat_va)[CPU->cpu_id+1];
3941050Sgirish 	if (tstat_pgszs > NIAGARA_MMUSTAT_PGSZS)
3951050Sgirish 		tstat_pgszs = NIAGARA_MMUSTAT_PGSZS;
3961050Sgirish 
3971050Sgirish 	for (i = 0; i < tstat_pgszs; i++, tstatp++) {
3981050Sgirish 		tstatp->tpgsz_kernel.tmode_itlb.ttlb_tlb.tmiss_count =
3991050Sgirish 		    mmustatp->kitsb[i].tsbhit_count;
4001050Sgirish 		tstatp->tpgsz_kernel.tmode_itlb.ttlb_tlb.tmiss_time =
4011050Sgirish 		    mmustatp->kitsb[i].tsbhit_time;
4021050Sgirish 		tstatp->tpgsz_user.tmode_itlb.ttlb_tlb.tmiss_count =
4031050Sgirish 		    mmustatp->uitsb[i].tsbhit_count;
4041050Sgirish 		tstatp->tpgsz_user.tmode_itlb.ttlb_tlb.tmiss_time =
4051050Sgirish 		    mmustatp->uitsb[i].tsbhit_time;
4061050Sgirish 		tstatp->tpgsz_kernel.tmode_dtlb.ttlb_tlb.tmiss_count =
4071050Sgirish 		    mmustatp->kdtsb[i].tsbhit_count;
4081050Sgirish 		tstatp->tpgsz_kernel.tmode_dtlb.ttlb_tlb.tmiss_time =
4091050Sgirish 		    mmustatp->kdtsb[i].tsbhit_time;
4101050Sgirish 		tstatp->tpgsz_user.tmode_dtlb.ttlb_tlb.tmiss_count =
4111050Sgirish 		    mmustatp->udtsb[i].tsbhit_count;
4121050Sgirish 		tstatp->tpgsz_user.tmode_dtlb.ttlb_tlb.tmiss_time =
4131050Sgirish 		    mmustatp->udtsb[i].tsbhit_time;
4141050Sgirish 	}
4151050Sgirish }
416