From patchwork Sun Dec 13 11:18:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 66985 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBDBIBZ4023526 for ; Sun, 13 Dec 2009 11:18:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752414AbZLMLSK (ORCPT ); Sun, 13 Dec 2009 06:18:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752417AbZLMLSK (ORCPT ); Sun, 13 Dec 2009 06:18:10 -0500 Received: from 124x34x33x190.ap124.ftth.ucom.ne.jp ([124.34.33.190]:56080 "HELO master.linux-sh.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752414AbZLMLSJ (ORCPT ); Sun, 13 Dec 2009 06:18:09 -0500 Received: from localhost (unknown [127.0.0.1]) by master.linux-sh.org (Postfix) with ESMTP id 18A376375A; Sun, 13 Dec 2009 11:18:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at linux-sh.org Received: from master.linux-sh.org ([127.0.0.1]) by localhost (master.linux-sh.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ph8cZenkUPBZ; Sun, 13 Dec 2009 20:17:59 +0900 (JST) Received: from localhost (cpc5-brad6-0-0-cust25.barn.cable.virginmedia.com [82.38.64.26]) by master.linux-sh.org (Postfix) with ESMTP id 18AD163758; Sun, 13 Dec 2009 20:17:58 +0900 (JST) From: Matt Fleming To: Paul Mundt Cc: linux-sh@vger.kernel.org Subject: [PATCH] sh: Couple kernel and user write page perm bits for CONFIG_X2TLB Date: Sun, 13 Dec 2009 11:18:01 +0000 Message-Id: <1260703081-1945-1-git-send-email-matt@console-pimps.org> X-Mailer: git-send-email 1.6.2.5 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h index b354355..5003ee8 100644 --- a/arch/sh/include/asm/pgtable_32.h +++ b/arch/sh/include/asm/pgtable_32.h @@ -344,7 +344,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) #define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL) #ifdef CONFIG_X2TLB -#define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) +#define pte_write(pte) \ + ((pte).pte_high & (_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)) #else #define pte_write(pte) ((pte).pte_low & _PAGE_RW) #endif @@ -358,7 +359,7 @@ static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; } * individually toggled (and user permissions are entirely decoupled from * kernel permissions), we attempt to couple them a bit more sanely here. */ -PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE); +PTE_BIT_FUNC(high, wrprotect, &= ~(_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)); PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); #else