Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1972231ybg; Fri, 5 Jun 2020 02:14:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEaP223I+E4tW1X+Kf0SYBMmD4K14XMQ1IUB3AxiCx9QMFdxsmsgFLBNR2lAGSkzcudL8M X-Received: by 2002:a17:906:34c4:: with SMTP id h4mr8371929ejb.167.1591348459486; Fri, 05 Jun 2020 02:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591348459; cv=none; d=google.com; s=arc-20160816; b=mG4H7bsJxHlHygShzxBCOx57nPJvguahGDsExO1fZEobCDMLkXz+fZ08cDLuCCme6e s7bnPxfVn067avIHjmZYXMjcI2KPc2ntl1ewMPSQQsS90sZRXRmv1yjFiNdzkeO1qvaR xJWnYfBGeUKNcikpDn05Dw6Ac52jkvTdqwXyKBPmxCECoqneycI8nqp2rqb4Bm0g+Fct QJR1of+FOvd5F3RhLtrVndWMcjX8lqEE6vMrM0g5ohfYIB41uCa/EwdlA5BLqp7++KOk 9U51P9IztWX89QA/EVpD3+mxAS2gDv4jfjPPGVLWCUyKr9elvDvbzLVMKELiMtnQP8Lp wlYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=xqVB9DzqiDPP5lfDcKNAWM5SydBES97yJVe8bizQY3I=; b=ZJ1MqK9QHG37WXJx9dj/1lN4aQHnQKy0Cjh2STyvvrwA6weC9D6PU92/NnbOs/YZf/ 6e+5P+RJGlWH62XwA6CG7tfTGvgCtzWUldYaoJomvOOfIfIgabx6xEXIsu8ceL2lkopK kJmPrdbMhAGT3ajKVO1iVqrnJxWMedfZGfB10RXGZBBUpYFb6OWZ3WemKRI3JuGqbVhA gT4AoJBdjY1X+USbDZ4Da57qxcPRcSRD/3dXdhslzeBLVwMShdlv19bbdSNLIGenWree 85/pMGwRGPAl1a43Li5wNQnl9KJ2RR1HeX+fuRuuqr+UG8UZffV0ohGMMYtgF1CMj2DW dGMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si2898969edr.155.2020.06.05.02.13.56; Fri, 05 Jun 2020 02:14:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726276AbgFEJL1 (ORCPT + 99 others); Fri, 5 Jun 2020 05:11:27 -0400 Received: from mail.loongson.cn ([114.242.206.163]:51160 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726261AbgFEJLZ (ORCPT ); Fri, 5 Jun 2020 05:11:25 -0400 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: A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UvcSsGvfC2KfnxnUUI43ZEXa7IU8Q_-PUUUUU== X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 1.8.3.1