[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1591348266-28392-2-git-send-email-maobibo@loongson.cn>
Date: Fri, 5 Jun 2020 17:11:06 +0800
From: Bibo Mao <maobibo@...ngson.cn>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Paul Burton <paulburton@...nel.org>,
Jiaxun Yang <jiaxun.yang@...goat.com>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH 2/2] MIPS: Add writable-applies-readable policy with pgrot
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 <maobibo@...ngson.cn>
---
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);
--
1.8.3.1
Powered by blists - more mailing lists