From owner-p4-projects@FreeBSD.ORG Mon Feb 4 14:12:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4F55816A41A; Mon, 4 Feb 2008 14:12:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F105D16A417 for ; Mon, 4 Feb 2008 14:12:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DDBED13C4E3 for ; Mon, 4 Feb 2008 14:12:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m14ECimb084585 for ; Mon, 4 Feb 2008 14:12:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m14ECila084582 for perforce@freebsd.org; Mon, 4 Feb 2008 14:12:44 GMT (envelope-from gonzo@FreeBSD.org) Date: Mon, 4 Feb 2008 14:12:44 GMT Message-Id: <200802041412.m14ECila084582@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 134779 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, 04 Feb 2008 14:12:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=134779 Change 134779 by gonzo@gonzo_jeeves on 2008/02/04 14:12:06 o Fix MCHECK exception caused by tlbwi instruction in octeon emulation. The solution is to use bogus EntryHi value based on TLB entry index instead of fixed value. Tested by: cognet Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips/tlb.S#6 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/tlb.S#6 (text+ko) ==== @@ -81,12 +81,14 @@ #define _MFC0 dmfc0 #define _MTC0 dmtc0 #define WIRED_SHIFT 34 +#define PAGE_SHIFT 34 #else #define _SLL sll #define _SRL srl #define _MFC0 mfc0 #define _MTC0 mtc0 #define WIRED_SHIFT 2 +#define PAGE_SHIFT 2 #endif .set noreorder # Noreorder is default style! #if defined(ISA_MIPS32) @@ -287,9 +289,15 @@ tlbp # Probe for the entry. MIPS_CPU_NOP_DELAY mfc0 v0, COP_0_TLB_INDEX # See what we got - li t1, MIPS_KSEG0_START # Load invalid entry. + li t1, MIPS_KSEG0_START + 0x0fff0000 bltz v0, 1f # index < 0 => !found nop + # Load invalid entry, each TLB entry should have it's own bogus + # address calculated by following expression: + # MIPS_KSEG0_START + 0x0fff0000 + 2 * i * PAGE_SIZE; + # One bogus value for every TLB entry might cause MCHECK exception + sll v0, PAGE_SHIFT + 1 + addu t1, v0 _MTC0 t1, COP_0_TLB_HI # Mark entry high as invalid _MTC0 zero, COP_0_TLB_LO0 # Zero out low entry.