From owner-p4-projects@FreeBSD.ORG Tue May 29 18:58:01 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 64F8D1065672; Tue, 29 May 2012 18:58:01 +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 2799D106566C for ; Tue, 29 May 2012 18:58:01 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 101C08FC0A for ; Tue, 29 May 2012 18:58:01 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q4TIw00Z021563 for ; Tue, 29 May 2012 18:58:00 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q4TIw0HK021560 for perforce@freebsd.org; Tue, 29 May 2012 18:58:00 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 29 May 2012 18:58:00 GMT Message-Id: <201205291858.q4TIw0HK021560@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 211945 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 18:58:01 -0000 http://p4web.freebsd.org/@@211945?ac=10 Change 211945 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/05/29 18:57:04 Modify MIPS page table entry (PTE) initialisation so that cachability bits are set only once, using is_cacheable_mem() to determine what caching properties are required, rather than also unconditionally setting PTE_C_CACHE in init_pte_prot(). As PTE_C_CACHE | PTE_C_UNCACHED == PTE_C_CACHE, this meant that all userspace memory mappings of device memory used caching TLB entries. This is arguably not quite what we want, even though it is consistent with the MIPS pmap design: PTE caching properties should be derived from machine-independent page table attributes, but this is a substantially more complex change as the MIPS pmap doesn't yet known about attributes. This may fix cacheability issues seen in memory mappings of MTL and DE4 device memory on CHERI MIPS. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/mips/pmap.c#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/mips/pmap.c#2 (text+ko) ==== @@ -3144,16 +3144,16 @@ pt_entry_t rw; if (!(prot & VM_PROT_WRITE)) - rw = PTE_V | PTE_RO | PTE_C_CACHE; + rw = PTE_V | PTE_RO; else if ((m->oflags & VPO_UNMANAGED) == 0) { if ((m->md.pv_flags & PV_TABLE_MOD) != 0) - rw = PTE_V | PTE_D | PTE_C_CACHE; + rw = PTE_V | PTE_D; else - rw = PTE_V | PTE_C_CACHE; + rw = PTE_V; vm_page_aflag_set(m, PGA_WRITEABLE); } else /* Needn't emulate a modified bit for unmanaged pages. */ - rw = PTE_V | PTE_D | PTE_C_CACHE; + rw = PTE_V | PTE_D; return (rw); }