From patchwork Fri Jun 5 09:11:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bibo mao X-Patchwork-Id: 11589225 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E894138C for ; Fri, 5 Jun 2020 09:11:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EF6912075B for ; Fri, 5 Jun 2020 09:11:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF6912075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BCC2880009; Fri, 5 Jun 2020 05:11:20 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B7BC68E0006; Fri, 5 Jun 2020 05:11:20 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CE3F8000A; Fri, 5 Jun 2020 05:11:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 88F5E80009 for ; Fri, 5 Jun 2020 05:11:20 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4D0E4180AD802 for ; Fri, 5 Jun 2020 09:11:20 +0000 (UTC) X-FDA: 76894589520.01.name53_0d0da6a26d9e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 312C418037BE3 for ; Fri, 5 Jun 2020 09:11:20 +0000 (UTC) X-Spam-Summary: 2,0,0,103d5dbd5f26bcfa,d41d8cd98f00b204,maobibo@loongson.cn,,RULES_HIT:41:355:379:541:800:960:988:989:1260:1261:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2910:3138:3139:3140:3141:3142:3352:3622:3870:3871:3876:4250:4321:5007:6261:10004:11026:11658:11914:12048:12114:12160:12297:12438:12555:12895:12986:13069:13311:13357:14181:14384:14394:14721:21080:21627:30054,0,RBL:114.242.206.163:@loongson.cn:.lbl8.mailshell.net-64.201.201.201 62.14.2.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: name53_0d0da6a26d9e X-Filterd-Recvd-Size: 3762 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Jun 2020 09:11:18 +0000 (UTC) Received: from kvm-dev1.localdomain (unknown [10.2.5.134]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxXesqDNpeHOw9AA--.611S3; Fri, 05 Jun 2020 17:11:07 +0800 (CST) From: Bibo Mao To: Thomas Bogendoerfer , Andrew Morton , Paul Burton , Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/2] MIPS: Add writable-applies-readable policy with pgrot Date: Fri, 5 Jun 2020 17:11:06 +0800 Message-Id: <1591348266-28392-2-git-send-email-maobibo@loongson.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591348266-28392-1-git-send-email-maobibo@loongson.cn> References: <1591348266-28392-1-git-send-email-maobibo@loongson.cn> X-CM-TRANSID: AQAAf9DxXesqDNpeHOw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I43ZEXa7IU8Q_-PUUUUU== X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Rspamd-Queue-Id: 312C418037BE3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000138, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Linux system, writable applies readable privilege in most architectures, this patch adds this policy on MIPS platform where hardware rixi is supported. Signed-off-by: Bibo Mao --- arch/mips/mm/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index f814e43..dae0617 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -160,7 +160,7 @@ static inline void setup_protection_map(void) if (cpu_has_rixi) { protection_map[0] = __pgprot(__PC | __PP | __NX | __NR); protection_map[1] = __pgprot(__PC | __PP | __NX | ___R); - protection_map[2] = __pgprot(__PC | __PP | __NX | __NR); + protection_map[2] = __pgprot(__PC | __PP | __NX | ___R); protection_map[3] = __pgprot(__PC | __PP | __NX | ___R); protection_map[4] = __pgprot(__PC | __PP | ___R); protection_map[5] = __pgprot(__PC | __PP | ___R); @@ -169,7 +169,7 @@ static inline void setup_protection_map(void) protection_map[8] = __pgprot(__PC | __PP | __NX | __NR); protection_map[9] = __pgprot(__PC | __PP | __NX | ___R); - protection_map[10] = __pgprot(__PC | __PP | __NX | ___W | __NR); + protection_map[10] = __pgprot(__PC | __PP | __NX | ___W | ___R); protection_map[11] = __pgprot(__PC | __PP | __NX | ___W | ___R); protection_map[12] = __pgprot(__PC | __PP | ___R); protection_map[13] = __pgprot(__PC | __PP | ___R);