From owner-p4-projects@FreeBSD.ORG Mon Apr 3 07:55:40 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A8C1716A425; Mon, 3 Apr 2006 07:55:40 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7081016A401 for ; Mon, 3 Apr 2006 07:55:40 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E35FB43D55 for ; Mon, 3 Apr 2006 07:55:39 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k337td86059903 for ; Mon, 3 Apr 2006 07:55:39 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k337tdMc059900 for perforce@freebsd.org; Mon, 3 Apr 2006 07:55:39 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 3 Apr 2006 07:55:39 GMT Message-Id: <200604030755.k337tdMc059900@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 94528 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2006 07:55:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=94528 Change 94528 by kmacy@kmacy_storage:sun4v_work on 2006/04/03 07:54:52 convert string mapping for trap numbers remove call to pmap_set_tsbs Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/trap.c#8 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/trap.c#8 (text+ko) ==== @@ -115,6 +115,8 @@ extern char *syscallnames[]; +static int trap_conversion[256]; + const char *trap_msg[] = { "reserved", "instruction access exception", @@ -237,12 +239,21 @@ trap_init(void) { vm_paddr_t mmfsa; + int i; + mmfsa = mmu_fault_status_area + (MMFSA_SIZE*PCPU_GET(cpuid)); set_wstate(WSTATE_KERN); set_mmfsa_scratchpad(mmfsa); OF_set_mmfsa_traptable(&tl0_base, mmfsa); - pmap_set_tsbs(); + for (i = 0; i < 128; i++) + trap_conversion[i] = i; + for (i = 128; i < 256; i++) + trap_conversion[i] = 0; + trap_conversion[0x31] = 35; + trap_conversion[0x9] = 34; + trap_conversion[0x6c] = 14; + } void @@ -257,7 +268,7 @@ td = PCPU_GET(curthread); CTR4(KTR_TRAP, "trap: %p type=%s (%s) pil=%#lx", td, - trap_msg[type & ~T_KERNEL], + trap_msg[trap_conversion[type & ~T_KERNEL]], (TRAPF_USERMODE(tf) ? "user" : "kernel"), rdpr(pil)); PCPU_LAZY_INC(cnt.v_trap); @@ -365,13 +376,19 @@ UNIMPLEMENTED; error = 1; break; + case T_ILLEGAL_INSTRUCTION: + if (tf->tf_tpc > KERNBASE) { + printf("illinstr: 0x%lx\n", tf->tf_tpc); + printf("illinstr: 0x%x\n", *((uint32_t *)tf->tf_tpc)); + } + default: error = 1; break; } if (error != 0) - panic("trap: %s", trap_msg[type & ~T_KERNEL]); + panic("trap: %s at 0x%lx", trap_msg[trap_conversion[type & ~T_KERNEL]], tf->tf_tpc); } CTR1(KTR_TRAP, "trap: td=%p return", td); } @@ -402,6 +419,11 @@ type = type & ~T_KERNEL; va = TLB_TAR_VA(data); +#if 1 + printf("trap_pfault(type=%ld, data=0x%lx, tpc=0x%lx, ctx=0x%lx)\n", + type, data, tf->tf_tpc, ctx); +#endif + CTR4(KTR_TRAP, "trap_pfault: td=%p pm_ctx=%#lx va=%#lx ctx=%#lx", td, p->p_vmspace->vm_pmap.pm_context[PCPU_GET(cpuid)], va, ctx);