All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 5107/5720] arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
@ 2022-06-26  0:03 kernel test robot
  2022-06-27  5:55   ` Baolin Wang
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-06-26  0:03 UTC (permalink / raw)
  To: Baolin Wang
  Cc: kbuild-all, Linux Memory Management List, Andrew Morton, Mike Kravetz

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2f9cb3d3bd73fc2225d66aa8fcffb632ed3eb235
commit: 8f32147e69adb8259faa07d8e28360ab782363d0 [5107/5720] arm64/hugetlb: implement arm64 specific hugetlb_mask_last_page
config: arm64-randconfig-s031-20220626
compiler: aarch64-linux-gcc (GCC) 11.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-31-g4880bd19-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8f32147e69adb8259faa07d8e28360ab782363d0
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 8f32147e69adb8259faa07d8e28360ab782363d0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/arm64/mm/hugetlbpage.c: In function 'hugetlb_mask_last_page':
>> arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
     380 |         case PMD_SIZE:
         |         ^~~~
   arch/arm64/mm/hugetlbpage.c:376:9: note: previously used here
     376 |         case PUD_SIZE:
         |         ^~~~


vim +380 arch/arm64/mm/hugetlbpage.c

   370	
   371	unsigned long hugetlb_mask_last_page(struct hstate *h)
   372	{
   373		unsigned long hp_size = huge_page_size(h);
   374	
   375		switch (hp_size) {
   376		case PUD_SIZE:
   377			return PGDIR_SIZE - PUD_SIZE;
   378		case CONT_PMD_SIZE:
   379			return PUD_SIZE - CONT_PMD_SIZE;
 > 380		case PMD_SIZE:
   381			return PUD_SIZE - PMD_SIZE;
   382		case CONT_PTE_SIZE:
   383			return PMD_SIZE - CONT_PTE_SIZE;
   384		default:
   385			break;
   386		}
   387	
   388		return 0UL;
   389	}
   390	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 5107/5720] arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
  2022-06-26  0:03 [linux-next:master 5107/5720] arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value kernel test robot
@ 2022-06-27  5:55   ` Baolin Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2022-06-27  5:55 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, Linux Memory Management List, Andrew Morton, Mike Kravetz



On 6/26/2022 8:03 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   2f9cb3d3bd73fc2225d66aa8fcffb632ed3eb235
> commit: 8f32147e69adb8259faa07d8e28360ab782363d0 [5107/5720] arm64/hugetlb: implement arm64 specific hugetlb_mask_last_page
> config: arm64-randconfig-s031-20220626
> compiler: aarch64-linux-gcc (GCC) 11.3.0
> reproduce:
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          # apt-get install sparse
>          # sparse version: v0.6.4-31-g4880bd19-dirty
>          # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8f32147e69adb8259faa07d8e28360ab782363d0
>          git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>          git fetch --no-tags linux-next master
>          git checkout 8f32147e69adb8259faa07d8e28360ab782363d0
>          # save the config file
>          mkdir build_dir && cp config build_dir/.config
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>

Thanks for reporting. I missed the case that '__PAGETABLE_PMD_FOLDED', 
was defined, which PUD is same with PMD.

Andrew, could you help to fold below changes into the original patch? 
Thanks.

diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index c9e076683e5d..272dd30a26ce 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -373,8 +373,10 @@ unsigned long hugetlb_mask_last_page(struct hstate *h)
         unsigned long hp_size = huge_page_size(h);

         switch (hp_size) {
+#ifndef __PAGETABLE_PMD_FOLDED
         case PUD_SIZE:
                 return PGDIR_SIZE - PUD_SIZE;
+#endif
         case CONT_PMD_SIZE:
                 return PUD_SIZE - CONT_PMD_SIZE;
         case PMD_SIZE:

> All errors (new ones prefixed by >>):
> 
>     arch/arm64/mm/hugetlbpage.c: In function 'hugetlb_mask_last_page':
>>> arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
>       380 |         case PMD_SIZE:
>           |         ^~~~
>     arch/arm64/mm/hugetlbpage.c:376:9: note: previously used here
>       376 |         case PUD_SIZE:
>           |         ^~~~
> 
> 
> vim +380 arch/arm64/mm/hugetlbpage.c
> 
>     370	
>     371	unsigned long hugetlb_mask_last_page(struct hstate *h)
>     372	{
>     373		unsigned long hp_size = huge_page_size(h);
>     374	
>     375		switch (hp_size) {
>     376		case PUD_SIZE:
>     377			return PGDIR_SIZE - PUD_SIZE;
>     378		case CONT_PMD_SIZE:
>     379			return PUD_SIZE - CONT_PMD_SIZE;
>   > 380		case PMD_SIZE:
>     381			return PUD_SIZE - PMD_SIZE;
>     382		case CONT_PTE_SIZE:
>     383			return PMD_SIZE - CONT_PTE_SIZE;
>     384		default:
>     385			break;
>     386		}
>     387	
>     388		return 0UL;
>     389	}
>     390	
> 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 5107/5720] arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
@ 2022-06-27  5:55   ` Baolin Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2022-06-27  5:55 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3217 bytes --]



On 6/26/2022 8:03 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   2f9cb3d3bd73fc2225d66aa8fcffb632ed3eb235
> commit: 8f32147e69adb8259faa07d8e28360ab782363d0 [5107/5720] arm64/hugetlb: implement arm64 specific hugetlb_mask_last_page
> config: arm64-randconfig-s031-20220626
> compiler: aarch64-linux-gcc (GCC) 11.3.0
> reproduce:
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          # apt-get install sparse
>          # sparse version: v0.6.4-31-g4880bd19-dirty
>          # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8f32147e69adb8259faa07d8e28360ab782363d0
>          git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>          git fetch --no-tags linux-next master
>          git checkout 8f32147e69adb8259faa07d8e28360ab782363d0
>          # save the config file
>          mkdir build_dir && cp config build_dir/.config
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>

Thanks for reporting. I missed the case that '__PAGETABLE_PMD_FOLDED', 
was defined, which PUD is same with PMD.

Andrew, could you help to fold below changes into the original patch? 
Thanks.

diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index c9e076683e5d..272dd30a26ce 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -373,8 +373,10 @@ unsigned long hugetlb_mask_last_page(struct hstate *h)
         unsigned long hp_size = huge_page_size(h);

         switch (hp_size) {
+#ifndef __PAGETABLE_PMD_FOLDED
         case PUD_SIZE:
                 return PGDIR_SIZE - PUD_SIZE;
+#endif
         case CONT_PMD_SIZE:
                 return PUD_SIZE - CONT_PMD_SIZE;
         case PMD_SIZE:

> All errors (new ones prefixed by >>):
> 
>     arch/arm64/mm/hugetlbpage.c: In function 'hugetlb_mask_last_page':
>>> arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
>       380 |         case PMD_SIZE:
>           |         ^~~~
>     arch/arm64/mm/hugetlbpage.c:376:9: note: previously used here
>       376 |         case PUD_SIZE:
>           |         ^~~~
> 
> 
> vim +380 arch/arm64/mm/hugetlbpage.c
> 
>     370	
>     371	unsigned long hugetlb_mask_last_page(struct hstate *h)
>     372	{
>     373		unsigned long hp_size = huge_page_size(h);
>     374	
>     375		switch (hp_size) {
>     376		case PUD_SIZE:
>     377			return PGDIR_SIZE - PUD_SIZE;
>     378		case CONT_PMD_SIZE:
>     379			return PUD_SIZE - CONT_PMD_SIZE;
>   > 380		case PMD_SIZE:
>     381			return PUD_SIZE - PMD_SIZE;
>     382		case CONT_PTE_SIZE:
>     383			return PMD_SIZE - CONT_PTE_SIZE;
>     384		default:
>     385			break;
>     386		}
>     387	
>     388		return 0UL;
>     389	}
>     390	
> 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-27  5:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-26  0:03 [linux-next:master 5107/5720] arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value kernel test robot
2022-06-27  5:55 ` Baolin Wang
2022-06-27  5:55   ` Baolin Wang

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.