Re: [PATCH] mm: Change return type to vm_fault_t
On Sat, Jun 02, 2018 at 08:25:29PM +0530, Souptick Joarder wrote: > CHECK mm/gup.c > mm/gup.c:394:17: error: undefined identifier '__COUNTER__' > mm/gup.c:439:9: error: undefined identifier '__COUNTER__' > mm/gup.c:441:9: error: undefined identifier '__COUNTER__' > mm/gup.c:443:9: error: undefined identifier '__COUNTER__' > mm/gup.c:508:17: error: undefined identifier '__COUNTER__' > mm/gup.c:716:25: error: undefined identifier '__COUNTER__' > mm/gup.c:826:17: error: undefined identifier '__COUNTER__' > mm/gup.c:863:17: error: undefined identifier '__COUNTER__' > mm/gup.c:865:17: error: undefined identifier '__COUNTER__' > mm/gup.c:882:25: error: undefined identifier '__COUNTER__' > mm/gup.c:883:25: error: undefined identifier '__COUNTER__' > mm/gup.c:920:25: error: undefined identifier '__COUNTER__' > ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' It seems you're using a rather old version of sparse. Please use something more recent like v0.5.1 or v0.5.2. Regards, -- Luc
Re: [PATCH] mm: Change return type to vm_fault_t
On Sat, Jun 02, 2018 at 08:25:29PM +0530, Souptick Joarder wrote: > CHECK mm/gup.c > mm/gup.c:394:17: error: undefined identifier '__COUNTER__' > mm/gup.c:439:9: error: undefined identifier '__COUNTER__' > mm/gup.c:441:9: error: undefined identifier '__COUNTER__' > mm/gup.c:443:9: error: undefined identifier '__COUNTER__' > mm/gup.c:508:17: error: undefined identifier '__COUNTER__' > mm/gup.c:716:25: error: undefined identifier '__COUNTER__' > mm/gup.c:826:17: error: undefined identifier '__COUNTER__' > mm/gup.c:863:17: error: undefined identifier '__COUNTER__' > mm/gup.c:865:17: error: undefined identifier '__COUNTER__' > mm/gup.c:882:25: error: undefined identifier '__COUNTER__' > mm/gup.c:883:25: error: undefined identifier '__COUNTER__' > mm/gup.c:920:25: error: undefined identifier '__COUNTER__' > ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' It seems you're using a rather old version of sparse. Please use something more recent like v0.5.1 or v0.5.2. Regards, -- Luc
Re: [PATCH] mm: Change return type to vm_fault_t
On Wed, May 30, 2018 at 4:46 PM, Matthew Wilcox wrote: > On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: >> On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: >> > I see: >> > >> > mm/gup.c:817:15: warning: invalid assignment: |= >> > mm/gup.c:817:15:left side has type int >> > mm/gup.c:817:15:right side has type restricted vm_fault_t >> > >> > are you building with 'c=2' or 'C=2'? >> >> Building with C=2. >> Do I need to enable any separate FLAG ? > > Nope. Here's what I have: > > willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHECK arch/x86/purgatory/purgatory.c > CHECK arch/x86/purgatory/sha256.c > CHECK arch/x86/purgatory/string.c > arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' > was not declared. Should it be static? > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > DESCEND objtool > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHECK mm/gup.c > mm/gup.c:817:15: warning: invalid assignment: |= > mm/gup.c:817:15:left side has type int > mm/gup.c:817:15:right side has type restricted vm_fault_t > CC mm/gup.o > Matthew, Due to some unidentified error still not able to catch this warning in (X86_64 + sparse) compilation. It is constantly showing below error. Documents/linux-4.17-rc7$ make C=2 -j4 mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h DESCEND objtool CHK include/generated/utsrelease.h CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK mm/gup.c mm/gup.c:394:17: error: undefined identifier '__COUNTER__' mm/gup.c:439:9: error: undefined identifier '__COUNTER__' mm/gup.c:441:9: error: undefined identifier '__COUNTER__' mm/gup.c:443:9: error: undefined identifier '__COUNTER__' mm/gup.c:508:17: error: undefined identifier '__COUNTER__' mm/gup.c:716:25: error: undefined identifier '__COUNTER__' mm/gup.c:826:17: error: undefined identifier '__COUNTER__' mm/gup.c:863:17: error: undefined identifier '__COUNTER__' mm/gup.c:865:17: error: undefined identifier '__COUNTER__' mm/gup.c:882:25: error: undefined identifier '__COUNTER__' mm/gup.c:883:25: error: undefined identifier '__COUNTER__' mm/gup.c:920:25: error: undefined identifier '__COUNTER__' ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' But able to capture it in (powerpc + sparse) compilation. I will fix it in v2. /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/gup.c ./arch/powerpc/include/asm/book3s/64/pgtable.h:669:24: warning: restricted __be64 degrades to integer mm/gup.c:820:15: warning: incorrect type in assignment (different base types) mm/gup.c:820:15:expected int [signed] major mm/gup.c:820:15:got restricted vm_fault_t mm/gup.c:1247:24: warning: expression using sizeof bool mm/gup.c:1247:24: warning: expression using sizeof(void) mm/gup.c:1247:24: warning: expression using sizeof(void) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: warning: incorrect type in initializer (different base types) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:expected unsigned long long [unsigned] [usertype] mask ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:got restricted __be64 [usertype] mm/gup.c:1735:6: warning: symbol 'gup_fast_permitted' was not declared. Should it be static? CC mm/gup.o Also Sparse is throwing below warning -> /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/hugetlb.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/hugetlb.c mm/hugetlb.c:3778:33: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:31: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:29: warning: incorrect type in assignment (different base types) mm/hugetlb.c:3777:29:expected
Re: [PATCH] mm: Change return type to vm_fault_t
On Wed, May 30, 2018 at 4:46 PM, Matthew Wilcox wrote: > On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: >> On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: >> > I see: >> > >> > mm/gup.c:817:15: warning: invalid assignment: |= >> > mm/gup.c:817:15:left side has type int >> > mm/gup.c:817:15:right side has type restricted vm_fault_t >> > >> > are you building with 'c=2' or 'C=2'? >> >> Building with C=2. >> Do I need to enable any separate FLAG ? > > Nope. Here's what I have: > > willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHECK arch/x86/purgatory/purgatory.c > CHECK arch/x86/purgatory/sha256.c > CHECK arch/x86/purgatory/string.c > arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' > was not declared. Should it be static? > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > DESCEND objtool > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHECK mm/gup.c > mm/gup.c:817:15: warning: invalid assignment: |= > mm/gup.c:817:15:left side has type int > mm/gup.c:817:15:right side has type restricted vm_fault_t > CC mm/gup.o > Matthew, Due to some unidentified error still not able to catch this warning in (X86_64 + sparse) compilation. It is constantly showing below error. Documents/linux-4.17-rc7$ make C=2 -j4 mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h DESCEND objtool CHK include/generated/utsrelease.h CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK mm/gup.c mm/gup.c:394:17: error: undefined identifier '__COUNTER__' mm/gup.c:439:9: error: undefined identifier '__COUNTER__' mm/gup.c:441:9: error: undefined identifier '__COUNTER__' mm/gup.c:443:9: error: undefined identifier '__COUNTER__' mm/gup.c:508:17: error: undefined identifier '__COUNTER__' mm/gup.c:716:25: error: undefined identifier '__COUNTER__' mm/gup.c:826:17: error: undefined identifier '__COUNTER__' mm/gup.c:863:17: error: undefined identifier '__COUNTER__' mm/gup.c:865:17: error: undefined identifier '__COUNTER__' mm/gup.c:882:25: error: undefined identifier '__COUNTER__' mm/gup.c:883:25: error: undefined identifier '__COUNTER__' mm/gup.c:920:25: error: undefined identifier '__COUNTER__' ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' But able to capture it in (powerpc + sparse) compilation. I will fix it in v2. /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/gup.c ./arch/powerpc/include/asm/book3s/64/pgtable.h:669:24: warning: restricted __be64 degrades to integer mm/gup.c:820:15: warning: incorrect type in assignment (different base types) mm/gup.c:820:15:expected int [signed] major mm/gup.c:820:15:got restricted vm_fault_t mm/gup.c:1247:24: warning: expression using sizeof bool mm/gup.c:1247:24: warning: expression using sizeof(void) mm/gup.c:1247:24: warning: expression using sizeof(void) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: warning: incorrect type in initializer (different base types) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:expected unsigned long long [unsigned] [usertype] mask ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:got restricted __be64 [usertype] mm/gup.c:1735:6: warning: symbol 'gup_fast_permitted' was not declared. Should it be static? CC mm/gup.o Also Sparse is throwing below warning -> /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/hugetlb.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/hugetlb.c mm/hugetlb.c:3778:33: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:31: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:29: warning: incorrect type in assignment (different base types) mm/hugetlb.c:3777:29:expected
Re: [PATCH] mm: Change return type to vm_fault_t
Please ignoe this mail. I send it by mistake. On Sat, Jun 2, 2018 at 8:14 PM, Souptick Joarder wrote: > On Wed, May 30, 2018 at 4:46 PM, Matthew Wilcox wrote: >> On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: >>> On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox >>> wrote: >>> > I see: >>> > >>> > mm/gup.c:817:15: warning: invalid assignment: |= >>> > mm/gup.c:817:15:left side has type int >>> > mm/gup.c:817:15:right side has type restricted vm_fault_t >>> > >>> > are you building with 'c=2' or 'C=2'? >>> >>> Building with C=2. >>> Do I need to enable any separate FLAG ? >> >> Nope. Here's what I have: >> >> willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o >> CHK include/config/kernel.release >> CHK include/generated/uapi/linux/version.h >> CHK include/generated/utsrelease.h >> CHECK arch/x86/purgatory/purgatory.c >> CHECK arch/x86/purgatory/sha256.c >> CHECK arch/x86/purgatory/string.c >> arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' >> was not declared. Should it be static? >> CHK include/generated/bounds.h >> CHK include/generated/timeconst.h >> CHK include/generated/asm-offsets.h >> CALLscripts/checksyscalls.sh >> DESCEND objtool >> CHECK scripts/mod/empty.c >> CHK scripts/mod/devicetable-offsets.h >> CHECK mm/gup.c >> mm/gup.c:817:15: warning: invalid assignment: |= >> mm/gup.c:817:15:left side has type int >> mm/gup.c:817:15:right side has type restricted vm_fault_t >> CC mm/gup.o >> > > Matthew, > > Due to some unidentified error still not able to catch this warning > in (X86_64 + sparse) compilation. It is constantly showing below error. > > Documents/linux-4.17-rc7$ make C=2 -j4 mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > DESCEND objtool > CHK include/generated/utsrelease.h > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > CHECK mm/gup.c > mm/gup.c:394:17: error: undefined identifier '__COUNTER__' > mm/gup.c:439:9: error: undefined identifier '__COUNTER__' > mm/gup.c:441:9: error: undefined identifier '__COUNTER__' > mm/gup.c:443:9: error: undefined identifier '__COUNTER__' > mm/gup.c:508:17: error: undefined identifier '__COUNTER__' > mm/gup.c:716:25: error: undefined identifier '__COUNTER__' > mm/gup.c:826:17: error: undefined identifier '__COUNTER__' > mm/gup.c:863:17: error: undefined identifier '__COUNTER__' > mm/gup.c:865:17: error: undefined identifier '__COUNTER__' > mm/gup.c:882:25: error: undefined identifier '__COUNTER__' > mm/gup.c:883:25: error: undefined identifier '__COUNTER__' > mm/gup.c:920:25: error: undefined identifier '__COUNTER__' > ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' > > > But able to capture it in (powerpc + sparse) compilation. > I will fix it in v2. > > /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc > CROSS_COMPILE=powerpc-linux-gnu- mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHECK mm/gup.c > ./arch/powerpc/include/asm/book3s/64/pgtable.h:669:24: warning: > restricted __be64 degrades to integer > mm/gup.c:820:15: warning: incorrect type in assignment (different base types) > mm/gup.c:820:15:expected int [signed] major > mm/gup.c:820:15:got restricted vm_fault_t > mm/gup.c:1247:24: warning: expression using sizeof bool > mm/gup.c:1247:24: warning: expression using sizeof(void) > mm/gup.c:1247:24: warning: expression using sizeof(void) > ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: warning: > incorrect type in initializer (different base types) > ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:expected > unsigned long long [unsigned] [usertype] mask > ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:got > restricted __be64 [usertype] > mm/gup.c:1735:6: warning: symbol 'gup_fast_permitted' was not > declared. Should it be static? > CC mm/gup.o > > > Sparse is throwing below warning -> > > /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc > CROSS_COMPILE=powerpc-linux-gnu- mm/hugetlb.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > CHECK scripts/mod/empty.c > CHK
Re: [PATCH] mm: Change return type to vm_fault_t
Please ignoe this mail. I send it by mistake. On Sat, Jun 2, 2018 at 8:14 PM, Souptick Joarder wrote: > On Wed, May 30, 2018 at 4:46 PM, Matthew Wilcox wrote: >> On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: >>> On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox >>> wrote: >>> > I see: >>> > >>> > mm/gup.c:817:15: warning: invalid assignment: |= >>> > mm/gup.c:817:15:left side has type int >>> > mm/gup.c:817:15:right side has type restricted vm_fault_t >>> > >>> > are you building with 'c=2' or 'C=2'? >>> >>> Building with C=2. >>> Do I need to enable any separate FLAG ? >> >> Nope. Here's what I have: >> >> willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o >> CHK include/config/kernel.release >> CHK include/generated/uapi/linux/version.h >> CHK include/generated/utsrelease.h >> CHECK arch/x86/purgatory/purgatory.c >> CHECK arch/x86/purgatory/sha256.c >> CHECK arch/x86/purgatory/string.c >> arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' >> was not declared. Should it be static? >> CHK include/generated/bounds.h >> CHK include/generated/timeconst.h >> CHK include/generated/asm-offsets.h >> CALLscripts/checksyscalls.sh >> DESCEND objtool >> CHECK scripts/mod/empty.c >> CHK scripts/mod/devicetable-offsets.h >> CHECK mm/gup.c >> mm/gup.c:817:15: warning: invalid assignment: |= >> mm/gup.c:817:15:left side has type int >> mm/gup.c:817:15:right side has type restricted vm_fault_t >> CC mm/gup.o >> > > Matthew, > > Due to some unidentified error still not able to catch this warning > in (X86_64 + sparse) compilation. It is constantly showing below error. > > Documents/linux-4.17-rc7$ make C=2 -j4 mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > DESCEND objtool > CHK include/generated/utsrelease.h > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > CHECK mm/gup.c > mm/gup.c:394:17: error: undefined identifier '__COUNTER__' > mm/gup.c:439:9: error: undefined identifier '__COUNTER__' > mm/gup.c:441:9: error: undefined identifier '__COUNTER__' > mm/gup.c:443:9: error: undefined identifier '__COUNTER__' > mm/gup.c:508:17: error: undefined identifier '__COUNTER__' > mm/gup.c:716:25: error: undefined identifier '__COUNTER__' > mm/gup.c:826:17: error: undefined identifier '__COUNTER__' > mm/gup.c:863:17: error: undefined identifier '__COUNTER__' > mm/gup.c:865:17: error: undefined identifier '__COUNTER__' > mm/gup.c:882:25: error: undefined identifier '__COUNTER__' > mm/gup.c:883:25: error: undefined identifier '__COUNTER__' > mm/gup.c:920:25: error: undefined identifier '__COUNTER__' > ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' > > > But able to capture it in (powerpc + sparse) compilation. > I will fix it in v2. > > /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc > CROSS_COMPILE=powerpc-linux-gnu- mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHECK mm/gup.c > ./arch/powerpc/include/asm/book3s/64/pgtable.h:669:24: warning: > restricted __be64 degrades to integer > mm/gup.c:820:15: warning: incorrect type in assignment (different base types) > mm/gup.c:820:15:expected int [signed] major > mm/gup.c:820:15:got restricted vm_fault_t > mm/gup.c:1247:24: warning: expression using sizeof bool > mm/gup.c:1247:24: warning: expression using sizeof(void) > mm/gup.c:1247:24: warning: expression using sizeof(void) > ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: warning: > incorrect type in initializer (different base types) > ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:expected > unsigned long long [unsigned] [usertype] mask > ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:got > restricted __be64 [usertype] > mm/gup.c:1735:6: warning: symbol 'gup_fast_permitted' was not > declared. Should it be static? > CC mm/gup.o > > > Sparse is throwing below warning -> > > /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc > CROSS_COMPILE=powerpc-linux-gnu- mm/hugetlb.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > CHECK scripts/mod/empty.c > CHK
Re: [PATCH] mm: Change return type to vm_fault_t
On Wed, May 30, 2018 at 4:46 PM, Matthew Wilcox wrote: > On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: >> On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: >> > I see: >> > >> > mm/gup.c:817:15: warning: invalid assignment: |= >> > mm/gup.c:817:15:left side has type int >> > mm/gup.c:817:15:right side has type restricted vm_fault_t >> > >> > are you building with 'c=2' or 'C=2'? >> >> Building with C=2. >> Do I need to enable any separate FLAG ? > > Nope. Here's what I have: > > willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHECK arch/x86/purgatory/purgatory.c > CHECK arch/x86/purgatory/sha256.c > CHECK arch/x86/purgatory/string.c > arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' > was not declared. Should it be static? > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > DESCEND objtool > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHECK mm/gup.c > mm/gup.c:817:15: warning: invalid assignment: |= > mm/gup.c:817:15:left side has type int > mm/gup.c:817:15:right side has type restricted vm_fault_t > CC mm/gup.o > Matthew, Due to some unidentified error still not able to catch this warning in (X86_64 + sparse) compilation. It is constantly showing below error. Documents/linux-4.17-rc7$ make C=2 -j4 mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h DESCEND objtool CHK include/generated/utsrelease.h CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK mm/gup.c mm/gup.c:394:17: error: undefined identifier '__COUNTER__' mm/gup.c:439:9: error: undefined identifier '__COUNTER__' mm/gup.c:441:9: error: undefined identifier '__COUNTER__' mm/gup.c:443:9: error: undefined identifier '__COUNTER__' mm/gup.c:508:17: error: undefined identifier '__COUNTER__' mm/gup.c:716:25: error: undefined identifier '__COUNTER__' mm/gup.c:826:17: error: undefined identifier '__COUNTER__' mm/gup.c:863:17: error: undefined identifier '__COUNTER__' mm/gup.c:865:17: error: undefined identifier '__COUNTER__' mm/gup.c:882:25: error: undefined identifier '__COUNTER__' mm/gup.c:883:25: error: undefined identifier '__COUNTER__' mm/gup.c:920:25: error: undefined identifier '__COUNTER__' ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' But able to capture it in (powerpc + sparse) compilation. I will fix it in v2. /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/gup.c ./arch/powerpc/include/asm/book3s/64/pgtable.h:669:24: warning: restricted __be64 degrades to integer mm/gup.c:820:15: warning: incorrect type in assignment (different base types) mm/gup.c:820:15:expected int [signed] major mm/gup.c:820:15:got restricted vm_fault_t mm/gup.c:1247:24: warning: expression using sizeof bool mm/gup.c:1247:24: warning: expression using sizeof(void) mm/gup.c:1247:24: warning: expression using sizeof(void) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: warning: incorrect type in initializer (different base types) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:expected unsigned long long [unsigned] [usertype] mask ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:got restricted __be64 [usertype] mm/gup.c:1735:6: warning: symbol 'gup_fast_permitted' was not declared. Should it be static? CC mm/gup.o Sparse is throwing below warning -> /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/hugetlb.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/hugetlb.c mm/hugetlb.c:3778:33: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:31: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:29: warning: incorrect type in assignment (different base types) mm/hugetlb.c:3777:29:expected
Re: [PATCH] mm: Change return type to vm_fault_t
On Wed, May 30, 2018 at 4:46 PM, Matthew Wilcox wrote: > On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: >> On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: >> > I see: >> > >> > mm/gup.c:817:15: warning: invalid assignment: |= >> > mm/gup.c:817:15:left side has type int >> > mm/gup.c:817:15:right side has type restricted vm_fault_t >> > >> > are you building with 'c=2' or 'C=2'? >> >> Building with C=2. >> Do I need to enable any separate FLAG ? > > Nope. Here's what I have: > > willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHECK arch/x86/purgatory/purgatory.c > CHECK arch/x86/purgatory/sha256.c > CHECK arch/x86/purgatory/string.c > arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' > was not declared. Should it be static? > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALLscripts/checksyscalls.sh > DESCEND objtool > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHECK mm/gup.c > mm/gup.c:817:15: warning: invalid assignment: |= > mm/gup.c:817:15:left side has type int > mm/gup.c:817:15:right side has type restricted vm_fault_t > CC mm/gup.o > Matthew, Due to some unidentified error still not able to catch this warning in (X86_64 + sparse) compilation. It is constantly showing below error. Documents/linux-4.17-rc7$ make C=2 -j4 mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h DESCEND objtool CHK include/generated/utsrelease.h CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK mm/gup.c mm/gup.c:394:17: error: undefined identifier '__COUNTER__' mm/gup.c:439:9: error: undefined identifier '__COUNTER__' mm/gup.c:441:9: error: undefined identifier '__COUNTER__' mm/gup.c:443:9: error: undefined identifier '__COUNTER__' mm/gup.c:508:17: error: undefined identifier '__COUNTER__' mm/gup.c:716:25: error: undefined identifier '__COUNTER__' mm/gup.c:826:17: error: undefined identifier '__COUNTER__' mm/gup.c:863:17: error: undefined identifier '__COUNTER__' mm/gup.c:865:17: error: undefined identifier '__COUNTER__' mm/gup.c:882:25: error: undefined identifier '__COUNTER__' mm/gup.c:883:25: error: undefined identifier '__COUNTER__' mm/gup.c:920:25: error: undefined identifier '__COUNTER__' ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' But able to capture it in (powerpc + sparse) compilation. I will fix it in v2. /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/gup.c ./arch/powerpc/include/asm/book3s/64/pgtable.h:669:24: warning: restricted __be64 degrades to integer mm/gup.c:820:15: warning: incorrect type in assignment (different base types) mm/gup.c:820:15:expected int [signed] major mm/gup.c:820:15:got restricted vm_fault_t mm/gup.c:1247:24: warning: expression using sizeof bool mm/gup.c:1247:24: warning: expression using sizeof(void) mm/gup.c:1247:24: warning: expression using sizeof(void) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: warning: incorrect type in initializer (different base types) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:expected unsigned long long [unsigned] [usertype] mask ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20:got restricted __be64 [usertype] mm/gup.c:1735:6: warning: symbol 'gup_fast_permitted' was not declared. Should it be static? CC mm/gup.o Sparse is throwing below warning -> /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/hugetlb.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/hugetlb.c mm/hugetlb.c:3778:33: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:31: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:29: warning: incorrect type in assignment (different base types) mm/hugetlb.c:3777:29:expected
Re: [PATCH] mm: Change return type to vm_fault_t
On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: > On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: > > I see: > > > > mm/gup.c:817:15: warning: invalid assignment: |= > > mm/gup.c:817:15:left side has type int > > mm/gup.c:817:15:right side has type restricted vm_fault_t > > > > are you building with 'c=2' or 'C=2'? > > Building with C=2. > Do I need to enable any separate FLAG ? Nope. Here's what I have: willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHECK arch/x86/purgatory/purgatory.c CHECK arch/x86/purgatory/sha256.c CHECK arch/x86/purgatory/string.c arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' was not declared. Should it be static? CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh DESCEND objtool CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/gup.c mm/gup.c:817:15: warning: invalid assignment: |= mm/gup.c:817:15:left side has type int mm/gup.c:817:15:right side has type restricted vm_fault_t CC mm/gup.o
Re: [PATCH] mm: Change return type to vm_fault_t
On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: > On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: > > I see: > > > > mm/gup.c:817:15: warning: invalid assignment: |= > > mm/gup.c:817:15:left side has type int > > mm/gup.c:817:15:right side has type restricted vm_fault_t > > > > are you building with 'c=2' or 'C=2'? > > Building with C=2. > Do I need to enable any separate FLAG ? Nope. Here's what I have: willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHECK arch/x86/purgatory/purgatory.c CHECK arch/x86/purgatory/sha256.c CHECK arch/x86/purgatory/string.c arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' was not declared. Should it be static? CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALLscripts/checksyscalls.sh DESCEND objtool CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/gup.c mm/gup.c:817:15: warning: invalid assignment: |= mm/gup.c:817:15:left side has type int mm/gup.c:817:15:right side has type restricted vm_fault_t CC mm/gup.o
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: > On Tue, May 29, 2018 at 09:25:05PM +0530, Souptick Joarder wrote: >> On Tue, May 29, 2018 at 8:20 PM, Matthew Wilcox wrote: >> > On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: >> >> Use new return type vm_fault_t for fault handler. For >> >> now, this is just documenting that the function returns >> >> a VM_FAULT value rather than an errno. Once all instances >> >> are converted, vm_fault_t will become a distinct type. >> > >> > I don't believe you've checked this with sparse. >> > >> >> @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct >> >> mm_struct *mm, >> >>bool *unlocked) >> >> { >> >> struct vm_area_struct *vma; >> >> - int ret, major = 0; >> >> + int major = 0; >> >> + vm_fault_t ret; >> >> >> >> if (unlocked) >> >> fault_flags |= FAULT_FLAG_ALLOW_RETRY; >> > >> > ... >> > major |= ret & VM_FAULT_MAJOR; >> > >> > That should be throwing a warning. >> >> Sorry, but I verified again and didn't see similar warnings. >> >> steps followed - >> >> apply the patch >> make c=2 -j4 ( build for x86_64) >> looking for warnings in files because of this patch. >> >> The only error I am seeing "error: undefined identifier '__COUNTER__' " >> which is pointing to BUG(). There are few warnings but those are not >> related to this patch. >> >> In my test tree the final patch to create new vm_fault_t type is >> already applied. >> >> Do you want me to verify in some other way ? > > I see: > > mm/gup.c:817:15: warning: invalid assignment: |= > mm/gup.c:817:15:left side has type int > mm/gup.c:817:15:right side has type restricted vm_fault_t > > are you building with 'c=2' or 'C=2'? Building with C=2. Do I need to enable any separate FLAG ?
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: > On Tue, May 29, 2018 at 09:25:05PM +0530, Souptick Joarder wrote: >> On Tue, May 29, 2018 at 8:20 PM, Matthew Wilcox wrote: >> > On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: >> >> Use new return type vm_fault_t for fault handler. For >> >> now, this is just documenting that the function returns >> >> a VM_FAULT value rather than an errno. Once all instances >> >> are converted, vm_fault_t will become a distinct type. >> > >> > I don't believe you've checked this with sparse. >> > >> >> @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct >> >> mm_struct *mm, >> >>bool *unlocked) >> >> { >> >> struct vm_area_struct *vma; >> >> - int ret, major = 0; >> >> + int major = 0; >> >> + vm_fault_t ret; >> >> >> >> if (unlocked) >> >> fault_flags |= FAULT_FLAG_ALLOW_RETRY; >> > >> > ... >> > major |= ret & VM_FAULT_MAJOR; >> > >> > That should be throwing a warning. >> >> Sorry, but I verified again and didn't see similar warnings. >> >> steps followed - >> >> apply the patch >> make c=2 -j4 ( build for x86_64) >> looking for warnings in files because of this patch. >> >> The only error I am seeing "error: undefined identifier '__COUNTER__' " >> which is pointing to BUG(). There are few warnings but those are not >> related to this patch. >> >> In my test tree the final patch to create new vm_fault_t type is >> already applied. >> >> Do you want me to verify in some other way ? > > I see: > > mm/gup.c:817:15: warning: invalid assignment: |= > mm/gup.c:817:15:left side has type int > mm/gup.c:817:15:right side has type restricted vm_fault_t > > are you building with 'c=2' or 'C=2'? Building with C=2. Do I need to enable any separate FLAG ?
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 09:25:05PM +0530, Souptick Joarder wrote: > On Tue, May 29, 2018 at 8:20 PM, Matthew Wilcox wrote: > > On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: > >> Use new return type vm_fault_t for fault handler. For > >> now, this is just documenting that the function returns > >> a VM_FAULT value rather than an errno. Once all instances > >> are converted, vm_fault_t will become a distinct type. > > > > I don't believe you've checked this with sparse. > > > >> @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct > >> mm_struct *mm, > >>bool *unlocked) > >> { > >> struct vm_area_struct *vma; > >> - int ret, major = 0; > >> + int major = 0; > >> + vm_fault_t ret; > >> > >> if (unlocked) > >> fault_flags |= FAULT_FLAG_ALLOW_RETRY; > > > > ... > > major |= ret & VM_FAULT_MAJOR; > > > > That should be throwing a warning. > > Sorry, but I verified again and didn't see similar warnings. > > steps followed - > > apply the patch > make c=2 -j4 ( build for x86_64) > looking for warnings in files because of this patch. > > The only error I am seeing "error: undefined identifier '__COUNTER__' " > which is pointing to BUG(). There are few warnings but those are not > related to this patch. > > In my test tree the final patch to create new vm_fault_t type is > already applied. > > Do you want me to verify in some other way ? I see: mm/gup.c:817:15: warning: invalid assignment: |= mm/gup.c:817:15:left side has type int mm/gup.c:817:15:right side has type restricted vm_fault_t are you building with 'c=2' or 'C=2'?
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 09:25:05PM +0530, Souptick Joarder wrote: > On Tue, May 29, 2018 at 8:20 PM, Matthew Wilcox wrote: > > On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: > >> Use new return type vm_fault_t for fault handler. For > >> now, this is just documenting that the function returns > >> a VM_FAULT value rather than an errno. Once all instances > >> are converted, vm_fault_t will become a distinct type. > > > > I don't believe you've checked this with sparse. > > > >> @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct > >> mm_struct *mm, > >>bool *unlocked) > >> { > >> struct vm_area_struct *vma; > >> - int ret, major = 0; > >> + int major = 0; > >> + vm_fault_t ret; > >> > >> if (unlocked) > >> fault_flags |= FAULT_FLAG_ALLOW_RETRY; > > > > ... > > major |= ret & VM_FAULT_MAJOR; > > > > That should be throwing a warning. > > Sorry, but I verified again and didn't see similar warnings. > > steps followed - > > apply the patch > make c=2 -j4 ( build for x86_64) > looking for warnings in files because of this patch. > > The only error I am seeing "error: undefined identifier '__COUNTER__' " > which is pointing to BUG(). There are few warnings but those are not > related to this patch. > > In my test tree the final patch to create new vm_fault_t type is > already applied. > > Do you want me to verify in some other way ? I see: mm/gup.c:817:15: warning: invalid assignment: |= mm/gup.c:817:15:left side has type int mm/gup.c:817:15:right side has type restricted vm_fault_t are you building with 'c=2' or 'C=2'?
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 8:20 PM, Matthew Wilcox wrote: > On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: >> Use new return type vm_fault_t for fault handler. For >> now, this is just documenting that the function returns >> a VM_FAULT value rather than an errno. Once all instances >> are converted, vm_fault_t will become a distinct type. > > I don't believe you've checked this with sparse. > >> @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct >> mm_struct *mm, >>bool *unlocked) >> { >> struct vm_area_struct *vma; >> - int ret, major = 0; >> + int major = 0; >> + vm_fault_t ret; >> >> if (unlocked) >> fault_flags |= FAULT_FLAG_ALLOW_RETRY; > > ... > major |= ret & VM_FAULT_MAJOR; > > That should be throwing a warning. Sorry, but I verified again and didn't see similar warnings. steps followed - apply the patch make c=2 -j4 ( build for x86_64) looking for warnings in files because of this patch. The only error I am seeing "error: undefined identifier '__COUNTER__' " which is pointing to BUG(). There are few warnings but those are not related to this patch. In my test tree the final patch to create new vm_fault_t type is already applied. Do you want me to verify in some other way ?
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 8:20 PM, Matthew Wilcox wrote: > On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: >> Use new return type vm_fault_t for fault handler. For >> now, this is just documenting that the function returns >> a VM_FAULT value rather than an errno. Once all instances >> are converted, vm_fault_t will become a distinct type. > > I don't believe you've checked this with sparse. > >> @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct >> mm_struct *mm, >>bool *unlocked) >> { >> struct vm_area_struct *vma; >> - int ret, major = 0; >> + int major = 0; >> + vm_fault_t ret; >> >> if (unlocked) >> fault_flags |= FAULT_FLAG_ALLOW_RETRY; > > ... > major |= ret & VM_FAULT_MAJOR; > > That should be throwing a warning. Sorry, but I verified again and didn't see similar warnings. steps followed - apply the patch make c=2 -j4 ( build for x86_64) looking for warnings in files because of this patch. The only error I am seeing "error: undefined identifier '__COUNTER__' " which is pointing to BUG(). There are few warnings but those are not related to this patch. In my test tree the final patch to create new vm_fault_t type is already applied. Do you want me to verify in some other way ?
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: > Use new return type vm_fault_t for fault handler. For > now, this is just documenting that the function returns > a VM_FAULT value rather than an errno. Once all instances > are converted, vm_fault_t will become a distinct type. I don't believe you've checked this with sparse. > @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct > mm_struct *mm, >bool *unlocked) > { > struct vm_area_struct *vma; > - int ret, major = 0; > + int major = 0; > + vm_fault_t ret; > > if (unlocked) > fault_flags |= FAULT_FLAG_ALLOW_RETRY; ... major |= ret & VM_FAULT_MAJOR; That should be throwing a warning.
Re: [PATCH] mm: Change return type to vm_fault_t
On Tue, May 29, 2018 at 08:01:26PM +0530, Souptick Joarder wrote: > Use new return type vm_fault_t for fault handler. For > now, this is just documenting that the function returns > a VM_FAULT value rather than an errno. Once all instances > are converted, vm_fault_t will become a distinct type. I don't believe you've checked this with sparse. > @@ -802,7 +802,8 @@ int fixup_user_fault(struct task_struct *tsk, struct > mm_struct *mm, >bool *unlocked) > { > struct vm_area_struct *vma; > - int ret, major = 0; > + int major = 0; > + vm_fault_t ret; > > if (unlocked) > fault_flags |= FAULT_FLAG_ALLOW_RETRY; ... major |= ret & VM_FAULT_MAJOR; That should be throwing a warning.
[PATCH] mm: Change return type to vm_fault_t
Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") The aim is to change the return type of finish_fault() and handle_mm_fault() to vm_fault_t type. As part of that clean up return type of all other recursively called functions have been changed to vm_fault_t type. The places from where handle_mm_fault() is getting invoked will be change to vm_fault_t type but in a separate patch. vmf_error() is the newly introduce inline function in 4.17-rc6. Signed-off-by: Souptick Joarder --- fs/userfaultfd.c | 6 +-- include/linux/huge_mm.h | 10 +++-- include/linux/hugetlb.h | 2 +- include/linux/mm.h| 14 +++ include/linux/oom.h | 2 +- include/linux/swapops.h | 5 ++- include/linux/userfaultfd_k.h | 5 ++- kernel/memremap.c | 2 +- mm/gup.c | 5 ++- mm/huge_memory.c | 25 ++-- mm/hugetlb.c | 34 mm/internal.h | 2 +- mm/khugepaged.c | 3 +- mm/memory.c | 90 ++- mm/shmem.c| 17 15 files changed, 114 insertions(+), 108 deletions(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index cec550c..bf60c6a 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -336,17 +336,15 @@ static inline bool userfaultfd_must_wait(struct userfaultfd_ctx *ctx, * fatal_signal_pending()s, and the mmap_sem must be released before * returning it. */ -int handle_userfault(struct vm_fault *vmf, unsigned long reason) +vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason) { struct mm_struct *mm = vmf->vma->vm_mm; struct userfaultfd_ctx *ctx; struct userfaultfd_wait_queue uwq; - int ret; + vm_fault_t ret = VM_FAULT_SIGBUS; bool must_wait, return_to_userland; long blocking_state; - ret = VM_FAULT_SIGBUS; - /* * We don't do userfault handling for the final child pid update. * diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index a8a1262..8c4f0a6 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -3,10 +3,11 @@ #define _LINUX_HUGE_MM_H #include +#include #include /* only for vma_is_dax() */ -extern int do_huge_pmd_anonymous_page(struct vm_fault *vmf); +extern vm_fault_t do_huge_pmd_anonymous_page(struct vm_fault *vmf); extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, struct vm_area_struct *vma); @@ -23,7 +24,7 @@ static inline void huge_pud_set_accessed(struct vm_fault *vmf, pud_t orig_pud) } #endif -extern int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd); +extern vm_fault_t do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd); extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd, @@ -216,7 +217,7 @@ struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long addr, struct page *follow_devmap_pud(struct vm_area_struct *vma, unsigned long addr, pud_t *pud, int flags); -extern int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd); +extern vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd); extern struct page *huge_zero_page; @@ -321,7 +322,8 @@ static inline spinlock_t *pud_trans_huge_lock(pud_t *pud, return NULL; } -static inline int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd) +static inline vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf, + pmd_t orig_pmd) { return 0; } diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 36fa6a2..c779b2f 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -105,7 +105,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, int hugetlb_report_node_meminfo(int, char *); void hugetlb_show_meminfo(void); unsigned long hugetlb_total_pages(void); -int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, +vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, unsigned int flags); int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, diff --git a/include/linux/mm.h b/include/linux/mm.h index 02a616e..2971bff 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -694,10 +694,10 @@ static inline pte_t maybe_mkwrite(pte_t pte,
[PATCH] mm: Change return type to vm_fault_t
Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") The aim is to change the return type of finish_fault() and handle_mm_fault() to vm_fault_t type. As part of that clean up return type of all other recursively called functions have been changed to vm_fault_t type. The places from where handle_mm_fault() is getting invoked will be change to vm_fault_t type but in a separate patch. vmf_error() is the newly introduce inline function in 4.17-rc6. Signed-off-by: Souptick Joarder --- fs/userfaultfd.c | 6 +-- include/linux/huge_mm.h | 10 +++-- include/linux/hugetlb.h | 2 +- include/linux/mm.h| 14 +++ include/linux/oom.h | 2 +- include/linux/swapops.h | 5 ++- include/linux/userfaultfd_k.h | 5 ++- kernel/memremap.c | 2 +- mm/gup.c | 5 ++- mm/huge_memory.c | 25 ++-- mm/hugetlb.c | 34 mm/internal.h | 2 +- mm/khugepaged.c | 3 +- mm/memory.c | 90 ++- mm/shmem.c| 17 15 files changed, 114 insertions(+), 108 deletions(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index cec550c..bf60c6a 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -336,17 +336,15 @@ static inline bool userfaultfd_must_wait(struct userfaultfd_ctx *ctx, * fatal_signal_pending()s, and the mmap_sem must be released before * returning it. */ -int handle_userfault(struct vm_fault *vmf, unsigned long reason) +vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason) { struct mm_struct *mm = vmf->vma->vm_mm; struct userfaultfd_ctx *ctx; struct userfaultfd_wait_queue uwq; - int ret; + vm_fault_t ret = VM_FAULT_SIGBUS; bool must_wait, return_to_userland; long blocking_state; - ret = VM_FAULT_SIGBUS; - /* * We don't do userfault handling for the final child pid update. * diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index a8a1262..8c4f0a6 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -3,10 +3,11 @@ #define _LINUX_HUGE_MM_H #include +#include #include /* only for vma_is_dax() */ -extern int do_huge_pmd_anonymous_page(struct vm_fault *vmf); +extern vm_fault_t do_huge_pmd_anonymous_page(struct vm_fault *vmf); extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, struct vm_area_struct *vma); @@ -23,7 +24,7 @@ static inline void huge_pud_set_accessed(struct vm_fault *vmf, pud_t orig_pud) } #endif -extern int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd); +extern vm_fault_t do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd); extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd, @@ -216,7 +217,7 @@ struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long addr, struct page *follow_devmap_pud(struct vm_area_struct *vma, unsigned long addr, pud_t *pud, int flags); -extern int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd); +extern vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd); extern struct page *huge_zero_page; @@ -321,7 +322,8 @@ static inline spinlock_t *pud_trans_huge_lock(pud_t *pud, return NULL; } -static inline int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t orig_pmd) +static inline vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf, + pmd_t orig_pmd) { return 0; } diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 36fa6a2..c779b2f 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -105,7 +105,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, int hugetlb_report_node_meminfo(int, char *); void hugetlb_show_meminfo(void); unsigned long hugetlb_total_pages(void); -int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, +vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, unsigned int flags); int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, diff --git a/include/linux/mm.h b/include/linux/mm.h index 02a616e..2971bff 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -694,10 +694,10 @@ static inline pte_t maybe_mkwrite(pte_t pte,