Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031295AbbKFBYH (ORCPT ); Thu, 5 Nov 2015 20:24:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45036 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031112AbbKFBYF (ORCPT ); Thu, 5 Nov 2015 20:24:05 -0500 Subject: Re: [PATCH 1/2] arm64: Get existing page protections in split_pmd To: Xishi Qiu , Laura Abbott References: <1446587315-18145-1-git-send-email-labbott@fedoraproject.org> <1446587315-18145-2-git-send-email-labbott@fedoraproject.org> <563B2C32.10307@huawei.com> Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kees Cook , Ard Biesheuvel , Mark Rutland From: Laura Abbott Message-ID: <563C0131.2060707@redhat.com> Date: Thu, 5 Nov 2015 17:24:01 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <563B2C32.10307@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1567 Lines: 51 On 11/05/2015 02:15 AM, Xishi Qiu wrote: > On 2015/11/4 5:48, Laura Abbott wrote: > >> >> Rather than always putting the least restrictived permissions >> (PAGE_KERNEL_EXEC) when spliting a pmd into pages, use >> the existing permissions from the pmd for the page. >> >> Signed-off-by: Laura Abbott >> --- >> arch/arm64/mm/mmu.c | 9 ++++----- >> 1 file changed, 4 insertions(+), 5 deletions(-) >> >> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c >> index 9211b85..ff41efa 100644 >> --- a/arch/arm64/mm/mmu.c >> +++ b/arch/arm64/mm/mmu.c >> @@ -75,14 +75,13 @@ static void __init *early_alloc(unsigned long sz) >> static void split_pmd(pmd_t *pmd, pte_t *pte) >> { >> unsigned long pfn = pmd_pfn(*pmd); >> + unsigned long addr = pfn << PAGE_SHIFT; >> + pgprot_t prot = __pgprot(pmd_val(*pmd) ^ addr) | PTE_TYPE_PAGE; >> + > > Hi Laura, > > I'm not quite understand, I find split_pud() doesn't set the flag > PMD_TYPE_TABLE. If we clear xx_TABLE_BIT, does that means the page > is large page? I'm assuming by large page you mean a block mapping. Yes, without that entry the kernel treats this as a block mapping > And what is the different from the flag xx_TYPE_SECT? That would mark it this as a block mapping which is not what we want here. > > Thanks, > Xishi Qiu > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/