Re: [PATCH v1 2/8] powerpc: hugetlb: Convert set_huge_pte_at() to take vma

Ryan Roberts
2023-09-22T07:19:41Z

On 22/09/2023 07:44, Christophe Leroy wrote:
>
>
> Le 21/09/2023 à 20:43, Christophe Leroy a écrit :
>>
>>
>> Le 21/09/2023 à 18:20, Ryan Roberts a écrit :
>>> In order to fix a bug, arm64 needs access to the vma inside it's
>>> implementation of set_huge_pte_at(). Provide for this by converting the
>>> mm parameter to be a vma. Any implementations that require the mm can
>>> access it via vma->vm_mm.
>>>
>>> This commit makes the required powerpc modifications. Separate commits
>>> update the other arches and core code, before the actual bug is fixed in
>>> arm64.
>>>
>>> No behavioral changes intended.
>>
>> This patch doesn't build, allthough I have also applied patch 1. Is
>> something missing ?
>>
>> CALL scripts/checksyscalls.sh
>> CC arch/powerpc/kernel/setup-common.o
>> In file included from arch/powerpc/kernel/setup-common.c:37:
>> ./include/linux/hugetlb.h: In function 'huge_ptep_modify_prot_commit':
>> ./include/linux/hugetlb.h:987:28: error: passing argument 1 of
>> 'set_huge_pte_at' from incompatible pointer type
>> [-Werror=incompatible-pointer-types]
>> 987 | set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
>> | ~~~^~~~~~~
>> | |
>> | struct mm_struct *
>> In file included from ./arch/powerpc/include/asm/hugetlb.h:13,
>> from ./include/linux/hugetlb.h:815:
>> ./arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h:49:45: note: expected
>> 'struct vm_area_struct *' but argument is of type 'struct mm_struct *'
>> 49 | void set_huge_pte_at(struct vm_area_struct *vma, unsigned long
>> addr, pte_t *ptep, pte_t pte);
>> | ~~~~~~~~~~~~~~~~~~~~~~~^~~
>> cc1: all warnings being treated as errors
>> make[4]: *** [scripts/Makefile.build:243:
>
> Oh, I realised that it requires patch 6 to build properly. This is not
> good. Your series should be bisectable, that means it must build and run
> successfully after each patch. Therefore you have to squash patches 1 to
> 7 all togethers.

Yeah my bad - sorry about that. I thought it would be better to separate the
changes for each arch. But as already suggested by Andrew and Catalin, I'll
squash the first 7 patches into 1 for v2.

>
> I'll send you comments on the powerpc part in another mail.
>
> Christophe