[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5645A00D.6020005@huawei.com>
Date: Fri, 13 Nov 2015 16:32:13 +0800
From: Xishi Qiu <qiuxishi@...wei.com>
To: Laura Abbott <labbott@...oraproject.org>
CC: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
"Zhong Jiang" <zhongjiang@...wei.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, Kees Cook <keescook@...omium.org>,
"Mark Rutland" <mark.rutland@....com>
Subject: Re: [PATCHv2 2/2] arm64: Allow changing of attributes outside of
modules
>> +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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists