From: labbott@redhat.com (Laura Abbott)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm64: Get existing page protections in split_pmd
Date: Thu, 5 Nov 2015 17:24:01 -0800 [thread overview]
Message-ID: <563C0131.2060707@redhat.com> (raw)
In-Reply-To: <563B2C32.10307@huawei.com>
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 <labbott@fedoraproject.org>
>> ---
>> 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
>
WARNING: multiple messages have this Message-ID (diff)
From: Laura Abbott <labbott@redhat.com>
To: Xishi Qiu <qiuxishi@huawei.com>,
Laura Abbott <labbott@fedoraproject.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH 1/2] arm64: Get existing page protections in split_pmd
Date: Thu, 5 Nov 2015 17:24:01 -0800 [thread overview]
Message-ID: <563C0131.2060707@redhat.com> (raw)
In-Reply-To: <563B2C32.10307@huawei.com>
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 <labbott@fedoraproject.org>
>> ---
>> 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
>
next prev parent reply other threads:[~2015-11-06 1:24 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 21:48 [PATCH 0/2] Support for set_memory_* outside of module space Laura Abbott
2015-11-03 21:48 ` Laura Abbott
2015-11-03 21:48 ` [PATCH 1/2] arm64: Get existing page protections in split_pmd Laura Abbott
2015-11-03 21:48 ` Laura Abbott
2015-11-05 7:07 ` Ard Biesheuvel
2015-11-05 7:07 ` Ard Biesheuvel
2015-11-05 10:15 ` Xishi Qiu
2015-11-05 10:15 ` Xishi Qiu
2015-11-06 1:24 ` Laura Abbott [this message]
2015-11-06 1:24 ` Laura Abbott
2015-11-03 21:48 ` [PATCH 2/2] arm64: Allow changing of attributes outside of modules Laura Abbott
2015-11-03 21:48 ` Laura Abbott
2015-11-04 3:17 ` zhong jiang
2015-11-04 3:17 ` zhong jiang
2015-11-05 7:44 ` Ard Biesheuvel
2015-11-05 7:44 ` Ard Biesheuvel
2015-11-06 1:35 ` Laura Abbott
2015-11-06 1:35 ` Laura Abbott
[not found] ` <563974A8.3060306@huawei.com>
[not found] ` <563A4A74.60900@redhat.com>
2015-11-05 11:10 ` Xishi Qiu
2015-11-05 11:10 ` Xishi Qiu
2015-11-06 1:11 ` Laura Abbott
2015-11-06 1:11 ` Laura Abbott
2015-11-05 11:29 ` Xishi Qiu
2015-11-05 11:29 ` Xishi Qiu
2015-11-03 23:42 ` [PATCH 0/2] Support for set_memory_* outside of module space Kees Cook
2015-11-03 23:42 ` Kees Cook
2015-11-04 18:51 ` Laura Abbott
2015-11-04 18:51 ` Laura Abbott
2015-11-04 19:06 ` Kees Cook
2015-11-04 19:06 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563C0131.2060707@redhat.com \
--to=labbott@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.