From owner-freebsd-ppc@FreeBSD.ORG Tue Jun 1 16:50:06 2010 Return-Path: Delivered-To: ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F522106564A for ; Tue, 1 Jun 2010 16:50:06 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id ECE928FC17 for ; Tue, 1 Jun 2010 16:50:05 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id A55042C2B58; Tue, 1 Jun 2010 11:21:42 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dALQqynSHnxZ; Tue, 1 Jun 2010 11:21:34 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id A36F62C2C60; Tue, 1 Jun 2010 11:21:30 -0500 (CDT) Message-ID: <4C053389.1040204@cs.rice.edu> Date: Tue, 01 Jun 2010 11:21:29 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100501) MIME-Version: 1.0 To: ppc@freebsd.org Content-Type: multipart/mixed; boundary="------------070902080904060507040709" Cc: Marcel Moolenaar , Alan Cox Subject: BookE pmap_enter() bug? X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 16:50:06 -0000 This is a multi-part message in MIME format. --------------070902080904060507040709 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I've been reviewing the various pmap_enter() implementations and came across the following bit of code in the BookE pmap_enter(): if (prot & VM_PROT_EXECUTE) { flags |= PTE_SX; if (!su) flags |= PTE_UX; /* * Check existing flags for execute permissions: if we * are turning execute permissions on, icache should * be flushed. */ if ((flags & (PTE_UX | PTE_SX)) == 0) sync++; } This will never flush the instruction cache because the new flags, not the old flags, are being used. I suspect that the attached change should be made. Alan --------------070902080904060507040709 Content-Type: text/plain; name="booke.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="booke.patch" Index: powerpc/booke/pmap.c =================================================================== --- powerpc/booke/pmap.c (revision 208657) +++ powerpc/booke/pmap.c (working copy) @@ -1621,7 +1621,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_ * are turning execute permissions on, icache should * be flushed. */ - if ((flags & (PTE_UX | PTE_SX)) == 0) + if ((pte->flags & (PTE_UX | PTE_SX)) == 0) sync++; } --------------070902080904060507040709--