From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753759AbcANMhJ (ORCPT ); Thu, 14 Jan 2016 07:37:09 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:20094 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbcANMhG (ORCPT ); Thu, 14 Jan 2016 07:37:06 -0500 Message-ID: <56979621.1060102@huawei.com> Date: Thu, 14 Jan 2016 20:35:45 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Mark Rutland CC: zhong jiang , Laura Abbott , Hanjun Guo , "linux-arm-kernel@lists.infradead.org" , LKML Subject: Re: Have any influence on set_memory_** about below patch ?? References: <5693A740.7070408@huawei.com> <20160111133145.GM6499@leverpostej> <569454F6.1060207@huawei.com> <20160112111531.GA4858@leverpostej> <5696272E.8090408@huawei.com> <20160113111806.GC23370@leverpostej> In-Reply-To: <20160113111806.GC23370@leverpostej> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.56979634.00B5,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 614475d6f2020a8eaf8e49a1fddd65e5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/1/13 19:18, Mark Rutland wrote: > On Wed, Jan 13, 2016 at 06:30:06PM +0800, Xishi Qiu wrote: >> Hi Mark, >> >> If I create swapper page tables by 4kb, not large page, then I use >> set_memory_ro() to change the pate table flag, does it have the problem >> too? > > The splitting/merging problem would not apply. > > However, you're going to waste a reasonable amount of memory by not > using section mappings in the swapper, and we gain additional complexity > in the page table setup code (which is shared with others things that > want section mappings). > > What are you exactly actually trying to achieve? > If module allocates some pages and save data on them, and the data will not be changed during the module running. So we want to use set_memory_ro() to increase the security. If the data is changed, we can catch someone. > What memory do you want to mark RO, and why? > The key data, and it will not be changed during the running time. >>>From a previous discussion [1], we figured out alternative approaches > for common cases. Do none of those work for your case? > I have not read the patchset carefully, could you tell me the general meaning of the approaches? Thanks, Xishi Qiu > Thanks, > Mark. > > [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-January/397320.html > > . >