From patchwork Sat Jun 6 04:02:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bibo mao X-Patchwork-Id: 11590923 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 E533660D for ; Sat, 6 Jun 2020 04:03:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B376820723 for ; Sat, 6 Jun 2020 04:03:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B376820723 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 7FF4A8E0007; Sat, 6 Jun 2020 00:03:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7AF388E0006; Sat, 6 Jun 2020 00:03:03 -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 6C4538E0007; Sat, 6 Jun 2020 00:03:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 54DE68E0006 for ; Sat, 6 Jun 2020 00:03:03 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0851F8248047 for ; Sat, 6 Jun 2020 04:03:03 +0000 (UTC) X-FDA: 76897441446.13.shape32_47158ac26da5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id D58C918140B60 for ; Sat, 6 Jun 2020 04:03:02 +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-62.14.2.100 64.201.201.201,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: shape32_47158ac26da5 X-Filterd-Recvd-Size: 3755 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Sat, 6 Jun 2020 04:03:01 +0000 (UTC) Received: from kvm-dev1.localdomain (unknown [10.2.5.134]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxJuppFdtebUs+AA--.1078S3; Sat, 06 Jun 2020 12:02:51 +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 v2 2/2] MIPS: Add writable-applies-readable policy with pgrot Date: Sat, 6 Jun 2020 12:02:49 +0800 Message-Id: <1591416169-26666-2-git-send-email-maobibo@loongson.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591416169-26666-1-git-send-email-maobibo@loongson.cn> References: <1591416169-26666-1-git-send-email-maobibo@loongson.cn> X-CM-TRANSID: AQAAf9AxJuppFdtebUs+AA--.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OrcfUUUUU= X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Rspamd-Queue-Id: D58C918140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, 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);