From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbcBCNoD (ORCPT ); Wed, 3 Feb 2016 08:44:03 -0500 Received: from foss.arm.com ([217.140.101.70]:34415 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751572AbcBCNoB (ORCPT ); Wed, 3 Feb 2016 08:44:01 -0500 Date: Wed, 3 Feb 2016 13:43:32 +0000 From: Mark Rutland To: Xishi Qiu Cc: Ard Biesheuvel , Laura Abbott , Catalin Marinas , Will Deacon , Kees Cook , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , zhong jiang , steve.capper@arm.com, Hanjun Guo Subject: Re: [PATCH] arm64: Allow vmalloc regions to be set with set_memory_* Message-ID: <20160203134332.GB1234@leverpostej> References: <20160118115640.GK21067@leverpostej> <56A97328.9070003@huawei.com> <20160128105138.GE17123@leverpostej> <56A9FFBD.8030303@huawei.com> <20160128142746.GL17123@leverpostej> <56AABEA4.3010301@huawei.com> <20160129110252.GB17038@leverpostej> <56AC2462.20506@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56AC2462.20506@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 30, 2016 at 10:48:02AM +0800, Xishi Qiu wrote: Hi Mark, > > Thanks for your reply. Maybe I didn't express it clearly, sorry for it. > > The abstract process is the following: > 1. do not create a large block, use 4kb for all of the memory(regardless of performance). > setup_arch->paging_init()->map_mem()->__map_memblock()->create_mapping() > 2. alloc a page and get the the linear mapping address. > 3. modify judgment condition of the function set_memory_ro(), so it could handle the linear mapping range. > 4. use set_memory_ro() to change the prot flag of the page which we get in step 2. > > Is it safe? This will be free from the problems associated with splitting/fusing sections. My concern was with what exactly this "special memory" was and how it was being used. It sounds like either some infrstructure is missing, or you are using the wrong abstractions. Thanks, Mark.