From: qiuxishi@huawei.com (Xishi Qiu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 2/2] arm64: Allow changing of attributes outside of modules
Date: Fri, 13 Nov 2015 16:32:13 +0800 [thread overview]
Message-ID: <5645A00D.6020005@huawei.com> (raw)
In-Reply-To: <56459EED.4030109@huawei.com>
>> +static int update_pmd_range(struct mm_struct *mm, pud_t *pud,
>> + unsigned long addr, unsigned long end,
>> + pgprot_t clear, pgprot_t set)
>> +{
>> + pmd_t *pmd;
>> + unsigned long next;
>> + int err = 0;
>> +
>> + if (pud_sect(*pud)) {
>> + if (!IS_ENABLED(CONFIG_DEBUG_CHANGE_PAGEATTR)) {
>> + err = -EINVAL;
>> + goto out;
>> + }
>> + pmd = pmd_alloc_one(&init_mm, addr);
>> + if (!pmd) {
>> + err = -ENOMEM;
>> + goto out;
>> + }
>> + split_pud(pud, pmd);
>> + pud_populate(&init_mm, pud, pmd);
>> + }
>> +
>>
>> - pte = clear_pte_bit(pte, cdata->clear_mask);
>> - pte = set_pte_bit(pte, cdata->set_mask);
>> + pmd = pmd_offset(pud, addr);
>> + if (pmd_none(*pmd)) {
>> + err = -EFAULT;
>> + goto out;
>> + }
>> +
>> + do {
>> + next = pmd_addr_end(addr, end);
>> + if (((addr | end) & ~SECTION_MASK) == 0) {
>
> Hi Laura,
>
> Why not like this?
> if (pmd_sect(*pmd) && ((addr | nest) & ~SECTION_MASK) == 0) {
Sorry, typo error, nest -> next
WARNING: multiple messages have this Message-ID (diff)
From: Xishi Qiu <qiuxishi@huawei.com>
To: Laura Abbott <labbott@fedoraproject.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
"Zhong Jiang" <zhongjiang@huawei.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, Kees Cook <keescook@chromium.org>,
"Mark Rutland" <mark.rutland@arm.com>
Subject: Re: [PATCHv2 2/2] arm64: Allow changing of attributes outside of modules
Date: Fri, 13 Nov 2015 16:32:13 +0800 [thread overview]
Message-ID: <5645A00D.6020005@huawei.com> (raw)
In-Reply-To: <56459EED.4030109@huawei.com>
>> +static int update_pmd_range(struct mm_struct *mm, pud_t *pud,
>> + unsigned long addr, unsigned long end,
>> + pgprot_t clear, pgprot_t set)
>> +{
>> + pmd_t *pmd;
>> + unsigned long next;
>> + int err = 0;
>> +
>> + if (pud_sect(*pud)) {
>> + if (!IS_ENABLED(CONFIG_DEBUG_CHANGE_PAGEATTR)) {
>> + err = -EINVAL;
>> + goto out;
>> + }
>> + pmd = pmd_alloc_one(&init_mm, addr);
>> + if (!pmd) {
>> + err = -ENOMEM;
>> + goto out;
>> + }
>> + split_pud(pud, pmd);
>> + pud_populate(&init_mm, pud, pmd);
>> + }
>> +
>>
>> - pte = clear_pte_bit(pte, cdata->clear_mask);
>> - pte = set_pte_bit(pte, cdata->set_mask);
>> + pmd = pmd_offset(pud, addr);
>> + if (pmd_none(*pmd)) {
>> + err = -EFAULT;
>> + goto out;
>> + }
>> +
>> + do {
>> + next = pmd_addr_end(addr, end);
>> + if (((addr | end) & ~SECTION_MASK) == 0) {
>
> Hi Laura,
>
> Why not like this?
> if (pmd_sect(*pmd) && ((addr | nest) & ~SECTION_MASK) == 0) {
Sorry, typo error, nest -> next
next prev parent reply other threads:[~2015-11-13 8:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 1:57 [PATCHv2 0/2] Support for set_memory_* outside of module space Laura Abbott
2015-11-11 1:57 ` Laura Abbott
2015-11-11 1:57 ` [PATCHv2 1/2] arm64: Get existing page protections in split_pmd Laura Abbott
2015-11-11 1:57 ` Laura Abbott
2015-11-15 7:32 ` Ard Biesheuvel
2015-11-15 7:32 ` Ard Biesheuvel
2015-11-11 1:57 ` [PATCHv2 2/2] arm64: Allow changing of attributes outside of modules Laura Abbott
2015-11-11 1:57 ` Laura Abbott
2015-11-12 11:55 ` zhong jiang
2015-11-12 11:55 ` zhong jiang
2015-11-12 16:31 ` Laura Abbott
2015-11-12 16:31 ` Laura Abbott
2015-11-13 2:05 ` zhong jiang
2015-11-13 2:05 ` zhong jiang
2015-11-13 19:05 ` Laura Abbott
2015-11-13 19:05 ` Laura Abbott
2015-11-13 2:37 ` zhong jiang
2015-11-13 2:37 ` zhong jiang
2015-11-13 8:27 ` Xishi Qiu
2015-11-13 8:27 ` Xishi Qiu
2015-11-13 8:32 ` Xishi Qiu [this message]
2015-11-13 8:32 ` Xishi Qiu
2015-11-13 19:09 ` Laura Abbott
2015-11-13 19:09 ` Laura Abbott
2015-11-24 23:39 ` [PATCHv2 0/2] Support for set_memory_* outside of module space Laura Abbott
2015-11-24 23:39 ` Laura Abbott
2015-11-25 12:05 ` Will Deacon
2015-11-25 12:05 ` Will Deacon
2016-01-12 0:47 ` Laura Abbott
2016-01-12 0:47 ` Laura Abbott
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=5645A00D.6020005@huawei.com \
--to=qiuxishi@huawei.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.