>> +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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to