Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-06-15 Thread Chen, Rong A




On 5/26/2022 4:32 PM, Arnd Bergmann wrote:

On Wed, May 25, 2022 at 11:35 PM kernel test robot  wrote:

.__mulsi3.o.cmd: No such file or directory
Makefile:686: arch/h8300/Makefile: No such file or directory
Makefile:765: arch/h8300/Makefile: No such file or directory
arch/Kconfig:10: can't open file "arch/h8300/Kconfig"


Please stop building h8300  after the asm-generic tree is merged, the
architecture is getting removed.

 Arnd



Hi Arnd,

Thanks for the advice, we have stopped building h8300 for new kernel.

Best Regards,
Rong Chen


Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
On Thu, May 26, 2022 at 03:28:25PM +0100, Matthew Wilcox wrote:
> On Thu, May 26, 2022 at 11:48:32AM +0300, Dan Carpenter wrote:
> > On Thu, May 26, 2022 at 02:16:34AM +0100, Matthew Wilcox wrote:
> > > Bizarre this started showing up now.  The recent patch was:
> > > 
> > > -   info->alloced += compound_nr(page);
> > > -   inode->i_blocks += BLOCKS_PER_PAGE << compound_order(page);
> > > +   info->alloced += folio_nr_pages(folio);
> > > +   inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
> > > 
> > > so it could tell that compound_order() was small, but folio_order()
> > > might be large?
> > 
> > The old code also generates a warning on my test system.  Smatch thinks
> > both compound_order() and folio_order() are 0-255.  I guess because of
> > the "unsigned char compound_order;" in the struct page.
> 
> It'd be nice if we could annotate that as "contains a value between
> 1 and BITS_PER_LONG - PAGE_SHIFT".  Then be able to optionally enable
> a checker that ensures that's true on loads/stores.  Maybe we need a
> language that isn't C :-P  Ada can do this ... I don't think Rust can.

Machine Parsable Comments.  It's a matter of figuring out the best
format and writing the code.

In Smatch, I have table of hard coded return values in the format:
  
https://github.com/error27/smatch/blob/master/smatch_data/db/kernel.return_fixes
I don't have code to handle something like BITS_PER_LONG or PAGE_SHIFT.
To be honest, Smatch code always assumes that PAGE_SIZE is 4096 but I
should actually look it up...  It's not impossible to do.  The GFP_KERNEL
values changed enough so that I eventually made that look up the actual
defines.

I also have a table in the database where I could edit the values of
(struct page)->compound_order.

regards,
dan carpenter


Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Matthew Wilcox
On Thu, May 26, 2022 at 11:48:32AM +0300, Dan Carpenter wrote:
> On Thu, May 26, 2022 at 02:16:34AM +0100, Matthew Wilcox wrote:
> > Bizarre this started showing up now.  The recent patch was:
> > 
> > -   info->alloced += compound_nr(page);
> > -   inode->i_blocks += BLOCKS_PER_PAGE << compound_order(page);
> > +   info->alloced += folio_nr_pages(folio);
> > +   inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
> > 
> > so it could tell that compound_order() was small, but folio_order()
> > might be large?
> 
> The old code also generates a warning on my test system.  Smatch thinks
> both compound_order() and folio_order() are 0-255.  I guess because of
> the "unsigned char compound_order;" in the struct page.

It'd be nice if we could annotate that as "contains a value between
1 and BITS_PER_LONG - PAGE_SHIFT".  Then be able to optionally enable
a checker that ensures that's true on loads/stores.  Maybe we need a
language that isn't C :-P  Ada can do this ... I don't think Rust can.


Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
On Thu, May 26, 2022 at 02:16:34AM +0100, Matthew Wilcox wrote:
> Bizarre this started showing up now.  The recent patch was:
> 
> -   info->alloced += compound_nr(page);
> -   inode->i_blocks += BLOCKS_PER_PAGE << compound_order(page);
> +   info->alloced += folio_nr_pages(folio);
> +   inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
> 
> so it could tell that compound_order() was small, but folio_order()
> might be large?

The old code also generates a warning on my test system.  Smatch thinks
both compound_order() and folio_order() are 0-255.  I guess because of
the "unsigned char compound_order;" in the struct page.

regards,
dan carpenter



Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Arnd Bergmann
On Wed, May 25, 2022 at 11:35 PM kernel test robot  wrote:
> .__mulsi3.o.cmd: No such file or directory
> Makefile:686: arch/h8300/Makefile: No such file or directory
> Makefile:765: arch/h8300/Makefile: No such file or directory
> arch/Kconfig:10: can't open file "arch/h8300/Kconfig"

Please stop building h8300  after the asm-generic tree is merged, the
architecture is getting removed.

Arnd


Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
On Wed, May 25, 2022 at 02:50:56PM -0700, Andrew Morton wrote:
> On Thu, 26 May 2022 05:35:20 +0800 kernel test robot  wrote:
> 
> > tree/branch: 
> > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > branch HEAD: 8cb8311e95e3bb58bd84d6350365f14a718faa6d  Add linux-next 
> > specific files for 20220525
> > 
> > Error/Warning reports:
> > 
> > ...
> >
> > Unverified Error/Warning (likely false positive, please contact us if 
> > interested):
> 
> Could be so.
> 
> > mm/shmem.c:1948 shmem_getpage_gfp() warn: should '(((1) << 12) / 512) << 
> > folio_order(folio)' be a 64 bit type?
> 
> I've been seeing this one for a while.  And from this report I can't
> figure out what tool emitted it.  Clang?

This is a Smatch warning.

I normally look over Smatch warnings before forwarding kbuild-bot emails
but this email is a grab bag of static checker warnings from different
tools.

This warning has a high rate of false positives so I'm going to disable
it by default.

> 
> >
> > ...
> >
> > |-- i386-randconfig-m021
> > |   `-- 
> > mm-shmem.c-shmem_getpage_gfp()-warn:should-((()-)-)-folio_order(folio)-be-a-bit-type
> 
> If you're going to use randconfig then shouldn't you make the config
> available?  Or maybe quote the KCONFIG_SEED - presumably there's a way
> for others to regenerate.
> 
> Anyway, the warning seems wrong to me.
> 
> 
> #define PAGE_SIZE   (_AC(1,UL) << PAGE_SHIFT)
> 
> #define BLOCKS_PER_PAGE  (PAGE_SIZE/512)
> 
>   inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
> 
> so the RHS here should have unsigned long type.  Being able to generate
> the cpp output would be helpful.  That requires the .config.

The heuristic is that "inode->i_blocks" is a u64 but this .config must
be for a 32bit CPU.

I'm just going to turn off all these warnings until I can figure out a
better heuristic.

regards,
dan carpenter



Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-25 Thread Matthew Wilcox
On Wed, May 25, 2022 at 03:20:06PM -0700, Andrew Morton wrote:
> On Wed, 25 May 2022 23:07:35 +0100 Jessica Clarke  wrote:
> 
> > This is i386, so an unsigned long is 32-bit, but i_blocks is a blkcnt_t
> > i.e. a u64, which makes the shift without a cast of the LHS fishy.
> 
> Ah, of course, thanks.  I remember 32 bits ;)
> 
> --- a/mm/shmem.c~mm-shmemc-suppress-shift-warning
> +++ a/mm/shmem.c
> @@ -1945,7 +1945,7 @@ alloc_nohuge:
>  
>   spin_lock_irq(>lock);
>   info->alloced += folio_nr_pages(folio);
> - inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
> + inode->i_blocks += (blkcnt_t)BLOCKS_PER_PAGE << folio_order(folio);

Bizarre this started showing up now.  The recent patch was:

-   info->alloced += compound_nr(page);
-   inode->i_blocks += BLOCKS_PER_PAGE << compound_order(page);
+   info->alloced += folio_nr_pages(folio);
+   inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);

so it could tell that compound_order() was small, but folio_order()
might be large?

Silencing the warning is a good thing, but folio_order() can (at the
moment) be at most 9 on i386, so it isn't actually going to be
larger than 4096.


Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-25 Thread Andrew Morton
On Wed, 25 May 2022 23:07:35 +0100 Jessica Clarke  wrote:

> This is i386, so an unsigned long is 32-bit, but i_blocks is a blkcnt_t
> i.e. a u64, which makes the shift without a cast of the LHS fishy.

Ah, of course, thanks.  I remember 32 bits ;)

--- a/mm/shmem.c~mm-shmemc-suppress-shift-warning
+++ a/mm/shmem.c
@@ -1945,7 +1945,7 @@ alloc_nohuge:
 
spin_lock_irq(>lock);
info->alloced += folio_nr_pages(folio);
-   inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
+   inode->i_blocks += (blkcnt_t)BLOCKS_PER_PAGE << folio_order(folio);
shmem_recalc_inode(inode);
spin_unlock_irq(>lock);
alloced = true;
_



Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-25 Thread Jessica Clarke
On 25 May 2022, at 22:50, Andrew Morton  wrote:
> 
> On Thu, 26 May 2022 05:35:20 +0800 kernel test robot  wrote:
> 
>> tree/branch: 
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> branch HEAD: 8cb8311e95e3bb58bd84d6350365f14a718faa6d  Add linux-next 
>> specific files for 20220525
>> 
>> Error/Warning reports:
>> 
>> ...
>> 
>> Unverified Error/Warning (likely false positive, please contact us if 
>> interested):
> 
> Could be so.
> 
>> mm/shmem.c:1948 shmem_getpage_gfp() warn: should '(((1) << 12) / 512) << 
>> folio_order(folio)' be a 64 bit type?
> 
> I've been seeing this one for a while.  And from this report I can't
> figure out what tool emitted it.  Clang?
> 
>> 
>> ...
>> 
>> |-- i386-randconfig-m021
>> |   `-- 
>> mm-shmem.c-shmem_getpage_gfp()-warn:should-((()-)-)-folio_order(folio)-be-a-bit-type
> 
> If you're going to use randconfig then shouldn't you make the config
> available?  Or maybe quote the KCONFIG_SEED - presumably there's a way
> for others to regenerate.
> 
> Anyway, the warning seems wrong to me.
> 
> 
> #define PAGE_SIZE   (_AC(1,UL) << PAGE_SHIFT)
> 
> #define BLOCKS_PER_PAGE  (PAGE_SIZE/512)
> 
>   inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
> 
> so the RHS here should have unsigned long type.  Being able to generate
> the cpp output would be helpful.  That requires the .config.

This is i386, so an unsigned long is 32-bit, but i_blocks is a blkcnt_t
i.e. a u64, which makes the shift without a cast of the LHS fishy.

Jess



Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-25 Thread Andrew Morton
On Thu, 26 May 2022 05:35:20 +0800 kernel test robot  wrote:

> tree/branch: 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> branch HEAD: 8cb8311e95e3bb58bd84d6350365f14a718faa6d  Add linux-next 
> specific files for 20220525
> 
> Error/Warning reports:
> 
> ...
>
> Unverified Error/Warning (likely false positive, please contact us if 
> interested):

Could be so.

> mm/shmem.c:1948 shmem_getpage_gfp() warn: should '(((1) << 12) / 512) << 
> folio_order(folio)' be a 64 bit type?

I've been seeing this one for a while.  And from this report I can't
figure out what tool emitted it.  Clang?

>
> ...
>
> |-- i386-randconfig-m021
> |   `-- 
> mm-shmem.c-shmem_getpage_gfp()-warn:should-((()-)-)-folio_order(folio)-be-a-bit-type

If you're going to use randconfig then shouldn't you make the config
available?  Or maybe quote the KCONFIG_SEED - presumably there's a way
for others to regenerate.

Anyway, the warning seems wrong to me.


#define PAGE_SIZE   (_AC(1,UL) << PAGE_SHIFT)

#define BLOCKS_PER_PAGE  (PAGE_SIZE/512)

inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);

so the RHS here should have unsigned long type.  Being able to generate
the cpp output would be helpful.  That requires the .config.



[linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-25 Thread kernel test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
branch HEAD: 8cb8311e95e3bb58bd84d6350365f14a718faa6d  Add linux-next specific 
files for 20220525

Error/Warning reports:

https://lore.kernel.org/linux-mm/202204291924.vtgzmeri-...@intel.com
https://lore.kernel.org/linux-mm/202205031017.4twman3l-...@intel.com
https://lore.kernel.org/linux-mm/202205041248.wgcwpcev-...@intel.com
https://lore.kernel.org/linux-mm/202205150051.3rzuooag-...@intel.com
https://lore.kernel.org/linux-mm/202205150117.sd6hzbvm-...@intel.com
https://lore.kernel.org/lkml/202205100617.5uum3uet-...@intel.com
https://lore.kernel.org/llvm/202205251645.gusu3spl-...@intel.com

Error/Warning: (recently discovered and may have been fixed)

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1364:5: warning: no previous 
prototype for 'amdgpu_discovery_get_mall_info' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/soc21.c:171:6: warning: no previous prototype for 
'soc21_grbm_select' [-Wmissing-prototypes]
drivers/gpu/drm/solomon/ssd130x-spi.c:154:35: warning: 'ssd130x_spi_table' 
defined but not used [-Wunused-const-variable=]
drivers/net/wireless/intel/iwlwifi/pcie/trans.c:1093:9: warning: 'CAUSE' macro 
redefined [-Wmacro-redefined]
drivers/video/fbdev/omap/hwa742.c:492:5: warning: no previous prototype for 
'hwa742_update_window_async' [-Wmissing-prototypes]
fs/buffer.c:2254:5: warning: stack frame size (2144) exceeds limit (1024) in 
'block_read_full_folio' [-Wframe-larger-than]
fs/ntfs/aops.c:378:12: warning: stack frame size (2216) exceeds limit (1024) in 
'ntfs_read_folio' [-Wframe-larger-than]

Unverified Error/Warning (likely false positive, please contact us if 
interested):

.__mulsi3.o.cmd: No such file or directory
Makefile:686: arch/h8300/Makefile: No such file or directory
Makefile:765: arch/h8300/Makefile: No such file or directory
arch/Kconfig:10: can't open file "arch/h8300/Kconfig"
arch/riscv/purgatory/kexec-purgatory.c:1860:9: sparse: sparse: trying to 
concatenate 29720-character string (8191 bytes max)
drivers/gpu/drm/bridge/adv7511/adv7511.h:229:17: warning: 
'ADV7511_REG_CEC_RX_FRAME_HDR' defined but not used [-Wunused-const-variable=]
drivers/gpu/drm/bridge/adv7511/adv7511.h:235:17: warning: 
'ADV7511_REG_CEC_RX_FRAME_LEN' defined but not used [-Wunused-const-variable=]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:309:9: sparse: sparse: dubious: x & 
!y
drivers/pinctrl/meson/pinctrl-meson8-pmx.c:60:25: warning: Value stored to 
'func' during its initialization is never read 
[clang-analyzer-deadcode.DeadStores]
drivers/staging/vt6655/card.c:758:16: sparse: sparse: cast to restricted __le64
drivers/vhost/vdpa.c:595 vhost_vdpa_unlocked_ioctl() warn: maybe return -EFAULT 
instead of the bytes remaining?
kernel/bpf/helpers.c:1468:29: sparse: sparse: symbol 
'bpf_dynptr_from_mem_proto' was not declared. Should it be static?
kernel/bpf/helpers.c:1490:29: sparse: sparse: symbol 
'bpf_dynptr_from_mem_proto' was not declared. Should it be static?
kernel/bpf/helpers.c:1516:29: sparse: sparse: symbol 'bpf_dynptr_read_proto' 
was not declared. Should it be static?
kernel/bpf/helpers.c:1542:29: sparse: sparse: symbol 'bpf_dynptr_write_proto' 
was not declared. Should it be static?
kernel/bpf/helpers.c:1569:29: sparse: sparse: symbol 'bpf_dynptr_data_proto' 
was not declared. Should it be static?
make[1]: *** No rule to make target 'arch/h8300/Makefile'.
mm/shmem.c:1948 shmem_getpage_gfp() warn: should '(((1) << 12) / 512) << 
folio_order(folio)' be a 64 bit type?
sound/soc/intel/avs/ipc.c:87:5-24: atomic_dec_and_test variation before object 
free at line 88.
{standard input}:3488: Error: unknown pseudo-op: `.l28'

Error/Warning ids grouped by kconfigs:

gcc_recent_errors
|-- alpha-allmodconfig
|   |-- 
drivers-gpu-drm-amd-amdgpu-amdgpu_discovery.c:warning:no-previous-prototype-for-amdgpu_discovery_get_mall_info
|   `-- 
drivers-gpu-drm-amd-amdgpu-soc21.c:warning:no-previous-prototype-for-soc21_grbm_select
|-- alpha-allyesconfig
|   |-- 
drivers-gpu-drm-amd-amdgpu-amdgpu_discovery.c:warning:no-previous-prototype-for-amdgpu_discovery_get_mall_info
|   |-- 
drivers-gpu-drm-amd-amdgpu-soc21.c:warning:no-previous-prototype-for-soc21_grbm_select
|   |-- 
drivers-pci-pci.c:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-restricted-pci_power_t-assigned-usertype-state-got-int
|   `-- drivers-staging-vt6655-card.c:sparse:sparse:cast-to-restricted-__le64
|-- arc-allyesconfig
|   |-- 
drivers-gpu-drm-amd-amdgpu-amdgpu_discovery.c:warning:no-previous-prototype-for-amdgpu_discovery_get_mall_info
|   |-- 
drivers-gpu-drm-amd-amdgpu-soc21.c:warning:no-previous-prototype-for-soc21_grbm_select
|   |-- 
drivers-pci-pci.c:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-restricted-pci_power_t-assigned-usertype-state-got-int
|   `-- drivers-staging-vt6655-card.c:sparse:sparse:cast-to-restricted-__le64
|-- arm-allmodconfig
|   |--