Kernel
  Threads by month 
                
            - ----- 2025 -----
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2024 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2023 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2022 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2021 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2020 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2019 -----
 - December
 
- 30 participants
 - 21063 discussions
 
                    
                        From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org>
mainline inclusion
from mainline-v6.14-rc1
commit 2b4c2094da6d84e69b843dd3317902e977bf64bd
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8H
CVE: CVE-2024-58001
Reference: https://git.kernel.org/stable/c/2b4c2094da6d84e69b843dd3317902e977bf64bd
--------------------------------
Patch series "Convert ocfs2 to use folios".
Mark did a conversion of ocfs2 to use folios and sent it to me as a
giant patch for review ;-)
So I've redone it as individual patches, and credited Mark for the patches
where his code is substantially the same.  It's not a bad way to do it;
his patch had some bugs and my patches had some bugs.  Hopefully all our
bugs were different from each other.  And hopefully Mark likes all the
changes I made to his code!
This patch (of 23):
If we can't read the buffer, be sure to unlock the page before returning.
Link: https://lkml.kernel.org/r/20241205171653.3179945-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20241205171653.3179945-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org>
Reviewed-by: Joseph Qi <joseph.qi(a)linux.alibaba.com>
Cc: Mark Fasheh <mark(a)fasheh.com>
Cc: Joel Becker <jlbec(a)evilplan.org>
Cc: Junxiao Bi <junxiao.bi(a)oracle.com>
Cc: Changwei Ge <gechangwei(a)live.cn>
Cc: Jun Piao <piaojun(a)huawei.com>
Cc: Mark Tinguely <mark.tinguely(a)oracle.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Luo Gengkun <luogengkun2(a)huawei.com>
---
 fs/ocfs2/symlink.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index 94cfacc9bad7..f3e80c00ca69 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -66,7 +66,7 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
 
 	if (status < 0) {
 		mlog_errno(status);
-		return status;
+		goto out;
 	}
 
 	fe = (struct ocfs2_dinode *) bh->b_data;
@@ -77,9 +77,10 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
 	memcpy(kaddr, link, len + 1);
 	kunmap_atomic(kaddr);
 	SetPageUptodate(page);
+out:
 	unlock_page(page);
 	brelse(bh);
-	return 0;
+	return status;
 }
 
 const struct address_space_operations ocfs2_fast_symlink_aops = {
-- 
2.34.1
                    
                  
                  
                          
                            
                            2
                            
                          
                          
                            
                            1
                            
                          
                          
                            
    
                          
                        
                    10 Mar '25
                    
                        From: Xinghai Cen <cenxinghai(a)h-partners.com>
Some bug fix patches for OLK-5.10 hns RoCE:
Junxian Huang (5):
  RDMA/hns: Change mtr member to pointer in hns QP/CQ/MR/SRQ/EQ struct
  RDMA/hns: Move mtr_node into the mtr struct
  RDMA/hns: Fix delayed destruction of db not taking effect
  RDMA/hns: Fix delay-destruction mechanism not processing kernel db
  RDMA/hns: Fix soft lockup by adding cond_resched() to bt pages loop
Xinghai Cen (1):
  RDMA/hns: Fix unmatched kmalloc and kvfree
Yuyu Li (1):
  RDMA/hns: Fix ifnullfree static warning
 drivers/infiniband/hw/hns/hns_roce_cq.c       |  35 ++---
 drivers/infiniband/hw/hns/hns_roce_db.c       |  86 +++++++----
 drivers/infiniband/hw/hns/hns_roce_dca.c      |   6 +-
 drivers/infiniband/hw/hns/hns_roce_device.h   |  69 ++++-----
 drivers/infiniband/hw/hns/hns_roce_ext.c      |   3 +-
 drivers/infiniband/hw/hns/hns_roce_hem.c      |  17 ++-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c    |  82 +++++-----
 drivers/infiniband/hw/hns/hns_roce_main.c     |  14 +-
 drivers/infiniband/hw/hns/hns_roce_mr.c       | 144 ++++++++----------
 drivers/infiniband/hw/hns/hns_roce_qp.c       |  35 ++---
 drivers/infiniband/hw/hns/hns_roce_restrack.c |   4 +-
 drivers/infiniband/hw/hns/hns_roce_srq.c      |  63 +++-----
 12 files changed, 271 insertions(+), 287 deletions(-)
-- 
2.33.0
                    
                  
                  
                          
                            
                            2
                            
                          
                          
                            
                            8
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [PATCH OLK-5.10] NFC: nci: Add bounds checking in nci_hci_create_pipe()
                        
                        
by Yang Yingliang 10 Mar '25
                    by Yang Yingliang 10 Mar '25
10 Mar '25
                    
                        From: Dan Carpenter <dan.carpenter(a)linaro.org>
mainline inclusion
from mainline-v6.14-rc1
commit 110b43ef05342d5a11284cc8b21582b698b4ef1c
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8J
CVE: CVE-2025-21735
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
The "pipe" variable is a u8 which comes from the network.  If it's more
than 127, then it results in memory corruption in the caller,
nci_hci_connect_gate().
Cc: stable(a)vger.kernel.org
Fixes: a1b0b9415817 ("NFC: nci: Create pipe on specific gate in nci_hci_connect_gate")
Signed-off-by: Dan Carpenter <dan.carpenter(a)linaro.org>
Reviewed-by: Simon Horman <horms(a)kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
Link: https://patch.msgid.link/bcf5453b-7204-4297-9c20-4d8c7dacf586@stanley.mount…
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
---
 net/nfc/nci/hci.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index 4fe336ff2bfa..f8140488b08a 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -548,6 +548,8 @@ static u8 nci_hci_create_pipe(struct nci_dev *ndev, u8 dest_host,
 
 	pr_debug("pipe created=%d\n", pipe);
 
+	if (pipe >= NCI_HCI_MAX_PIPES)
+		pipe = NCI_HCI_INVALID_PIPE;
 	return pipe;
 }
 
-- 
2.25.1
                    
                  
                  
                          
                            
                            2
                            
                          
                          
                            
                            1
                            
                          
                          
                            
    
                          
                        
                    
                    
                        From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org>
stable inclusion
from stable-v6.6.78
commit b6833b38984d1e9f20dd80f9ec9050c10d687f30
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8H
CVE: CVE-2024-58001
Reference: https://git.kernel.org/stable/c/b6833b38984d1e9f20dd80f9ec9050c10d687f30
--------------------------------
commit 2b4c2094da6d84e69b843dd3317902e977bf64bd upstream.
Patch series "Convert ocfs2 to use folios".
Mark did a conversion of ocfs2 to use folios and sent it to me as a
giant patch for review ;-)
So I've redone it as individual patches, and credited Mark for the patches
where his code is substantially the same.  It's not a bad way to do it;
his patch had some bugs and my patches had some bugs.  Hopefully all our
bugs were different from each other.  And hopefully Mark likes all the
changes I made to his code!
This patch (of 23):
If we can't read the buffer, be sure to unlock the page before returning.
Link: https://lkml.kernel.org/r/20241205171653.3179945-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20241205171653.3179945-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org>
Reviewed-by: Joseph Qi <joseph.qi(a)linux.alibaba.com>
Cc: Mark Fasheh <mark(a)fasheh.com>
Cc: Joel Becker <jlbec(a)evilplan.org>
Cc: Junxiao Bi <junxiao.bi(a)oracle.com>
Cc: Changwei Ge <gechangwei(a)live.cn>
Cc: Jun Piao <piaojun(a)huawei.com>
Cc: Mark Tinguely <mark.tinguely(a)oracle.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Luo Gengkun <luogengkun2(a)huawei.com>
---
 fs/ocfs2/symlink.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index d4c5fdcfa1e4..f5cf2255dc09 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -65,7 +65,7 @@ static int ocfs2_fast_symlink_read_folio(struct file *f, struct folio *folio)
 
 	if (status < 0) {
 		mlog_errno(status);
-		return status;
+		goto out;
 	}
 
 	fe = (struct ocfs2_dinode *) bh->b_data;
@@ -76,9 +76,10 @@ static int ocfs2_fast_symlink_read_folio(struct file *f, struct folio *folio)
 	memcpy(kaddr, link, len + 1);
 	kunmap_atomic(kaddr);
 	SetPageUptodate(page);
+out:
 	unlock_page(page);
 	brelse(bh);
-	return 0;
+	return status;
 }
 
 const struct address_space_operations ocfs2_fast_symlink_aops = {
-- 
2.34.1
                    
                  
                  
                          
                            
                            2
                            
                          
                          
                            
                            1
                            
                          
                          
                            
    
                          
                        
                    
                    
                        From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org>
mainline inclusion
from mainline-v6.14-rc1
commit b6833b38984d1e9f20dd80f9ec9050c10d687f30
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8H
CVE: CVE-2024-58001
Reference: https://git.kernel.org/stable/c/b6833b38984d1e9f20dd80f9ec9050c10d687f30
--------------------------------
commit 2b4c2094da6d84e69b843dd3317902e977bf64bd upstream.
Patch series "Convert ocfs2 to use folios".
Mark did a conversion of ocfs2 to use folios and sent it to me as a
giant patch for review ;-)
So I've redone it as individual patches, and credited Mark for the patches
where his code is substantially the same.  It's not a bad way to do it;
his patch had some bugs and my patches had some bugs.  Hopefully all our
bugs were different from each other.  And hopefully Mark likes all the
changes I made to his code!
This patch (of 23):
If we can't read the buffer, be sure to unlock the page before returning.
Link: https://lkml.kernel.org/r/20241205171653.3179945-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20241205171653.3179945-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org>
Reviewed-by: Joseph Qi <joseph.qi(a)linux.alibaba.com>
Cc: Mark Fasheh <mark(a)fasheh.com>
Cc: Joel Becker <jlbec(a)evilplan.org>
Cc: Junxiao Bi <junxiao.bi(a)oracle.com>
Cc: Changwei Ge <gechangwei(a)live.cn>
Cc: Jun Piao <piaojun(a)huawei.com>
Cc: Mark Tinguely <mark.tinguely(a)oracle.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Luo Gengkun <luogengkun2(a)huawei.com>
---
 fs/ocfs2/symlink.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index 94cfacc9bad7..f3e80c00ca69 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -66,7 +66,7 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
 
 	if (status < 0) {
 		mlog_errno(status);
-		return status;
+		goto out;
 	}
 
 	fe = (struct ocfs2_dinode *) bh->b_data;
@@ -77,9 +77,10 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
 	memcpy(kaddr, link, len + 1);
 	kunmap_atomic(kaddr);
 	SetPageUptodate(page);
+out:
 	unlock_page(page);
 	brelse(bh);
-	return 0;
+	return status;
 }
 
 const struct address_space_operations ocfs2_fast_symlink_aops = {
-- 
2.34.1
                    
                  
                  
                          
                            
                            2
                            
                          
                          
                            
                            1
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [openeuler:openEuler-1.0-LTS 1473/1473] drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:72:28: sparse: sparse: symbol 'nic_cmd_support_vf' was not declared. Should it be static?
                        
                        
by kernel test robot 10 Mar '25
                    by kernel test robot 10 Mar '25
10 Mar '25
                    
                        tree:   https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head:   1584a68cf2ef23ac87ba506e8ab8ca7e261813c1
commit: 746ea35981b1f77e988d48642409d73f0470b3eb [1473/1473] net: hinic: Add Hardware Abstract Layer
config: arm64-randconfig-r132-20250309 (https://download.01.org/0day-ci/archive/20250310/202503101044.1ARqFaAp-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250310/202503101044.1ARqFaAp-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503101044.1ARqFaAp-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:72:28: sparse: sparse: symbol 'nic_cmd_support_vf' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:398:5: sparse: sparse: symbol 'hinic_hiovs_set_cpath_vlan' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:424:5: sparse: sparse: symbol 'hinic_hiovs_del_cpath_vlan' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1541:30: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] group_index @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1541:30: sparse:     expected unsigned int [usertype] group_index
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1541:30: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1544:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] size @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1544:23: sparse:     expected unsigned int [usertype] size
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1544:23: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1546:22: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] ctx @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1546:22: sparse:     expected unsigned int [usertype] ctx
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1546:22: sparse:     got restricted __be32 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1728:32: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] group_index @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1728:32: sparse:     expected unsigned int [usertype] group_index
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1728:32: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1735:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1735:31: sparse:     expected unsigned int [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1735:31: sparse:     got restricted __be32 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1742:25: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] size @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1742:25: sparse:     expected unsigned int [usertype] size
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1742:25: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1754:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] offset @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1754:27: sparse:     expected unsigned int [usertype] offset
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1754:27: sparse:     got restricted __be32 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1755:25: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] size @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1755:25: sparse:     expected unsigned int [usertype] size
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1755:25: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:2349:5: sparse: sparse: symbol 'nic_pf_mbox_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:3237:5: sparse: sparse: symbol 'hw_speed_convert' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:398:5: warning: no previous prototype for 'hinic_hiovs_set_cpath_vlan' [-Wmissing-prototypes]
     398 | int hinic_hiovs_set_cpath_vlan(void *hwdev, u16 vlan_id, u16 pf_id)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:424:5: warning: no previous prototype for 'hinic_hiovs_del_cpath_vlan' [-Wmissing-prototypes]
     424 | int hinic_hiovs_del_cpath_vlan(void *hwdev, u16 vlan_id, u16 pf_id)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:2349:5: warning: no previous prototype for 'nic_pf_mbox_handler' [-Wmissing-prototypes]
    2349 | int nic_pf_mbox_handler(void *hwdev, u16 vf_id, u8 cmd, void *buf_in,
         |     ^~~~~~~~~~~~~~~~~~~
--
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:346:6: sparse: sparse: symbol 'hinic_qp_prepare_cmdq_header' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:379:24: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:365:6: sparse: sparse: symbol 'hinic_sq_prepare_ctxt' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:441:24: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:427:6: sparse: sparse: symbol 'hinic_rq_prepare_ctxt' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:843:16: sparse: sparse: cast to restricted __be16
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:913:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [addressable] [usertype] db_info @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:913:23: sparse:     expected unsigned int [addressable] [usertype] db_info
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:913:23: sparse:     got restricted __be32 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse:     got unsigned long long [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:974:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __be16 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:974:27: sparse:     expected unsigned short [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:974:27: sparse:     got restricted __be16 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:346:6: warning: no previous prototype for 'hinic_qp_prepare_cmdq_header' [-Wmissing-prototypes]
     346 | void hinic_qp_prepare_cmdq_header(struct hinic_qp_ctxt_header *qp_ctxt_hdr,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:365:6: warning: no previous prototype for 'hinic_sq_prepare_ctxt' [-Wmissing-prototypes]
     365 | void hinic_sq_prepare_ctxt(struct hinic_sq *sq, u16 global_qpn,
         |      ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:427:6: warning: no previous prototype for 'hinic_rq_prepare_ctxt' [-Wmissing-prototypes]
     427 | void hinic_rq_prepare_ctxt(struct hinic_rq *rq, struct hinic_rq_ctxt *rq_ctxt)
         |      ^~~~~~~~~~~~~~~~~~~~~
--
>> drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:100:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected unsigned short @@     got restricted __be16 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:100:24: sparse:     expected unsigned short
   drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:100:24: sparse:     got restricted __be16 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:159:22: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:37:16: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse:     expected unsigned int [usertype] val
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:552:29: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned char [noderef] [usertype] __iomem *cfg_regs_base @@     got void *cfg_reg_base @@
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:552:29: sparse:     expected unsigned char [noderef] [usertype] __iomem *cfg_regs_base
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:552:29: sparse:     got void *cfg_reg_base
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:553:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned char [noderef] [usertype] __iomem *intr_regs_base @@     got void *intr_reg_base @@
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:553:30: sparse:     expected unsigned char [noderef] [usertype] __iomem *intr_regs_base
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:553:30: sparse:     got void *intr_reg_base
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:557:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned char [noderef] [usertype] __iomem *db_base @@     got void *db_base @@
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:557:23: sparse:     expected unsigned char [noderef] [usertype] __iomem *db_base
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:557:23: sparse:     got void *db_base
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:558:28: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *dwqe_mapping @@     got void *dwqe_mapping @@
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:558:28: sparse:     expected void [noderef] __iomem *dwqe_mapping
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:558:28: sparse:     got void *dwqe_mapping
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:620:65: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected restricted gfp_t [usertype] flag @@     got unsigned int flag @@
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:620:65: sparse:     expected restricted gfp_t [usertype] flag
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:620:65: sparse:     got unsigned int flag
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:635:65: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected restricted gfp_t [usertype] flag @@     got unsigned int flag @@
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:635:65: sparse:     expected restricted gfp_t [usertype] flag
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:635:65: sparse:     got unsigned int flag
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:52: warning: Function parameter or member 'hwdev' not described in 'hwif_ready'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:52: warning: Excess function parameter 'hwif' description in 'hwif_ready'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'hwdev' not described in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'cfg_reg_base' not described in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'intr_reg_base' not described in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'db_base_phy' not described in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'db_base' not described in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'dwqe_mapping' not described in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Excess function parameter 'hwif' description in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Excess function parameter 'pdev' description in 'hinic_init_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:607: warning: Function parameter or member 'hwdev' not described in 'hinic_free_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:607: warning: Excess function parameter 'hwif' description in 'hinic_free_hwif'
   drivers/net/ethernet/huawei/hinic/hinic_hwif.c:607: warning: Excess function parameter 'pdev' description in 'hinic_free_hwif'
--
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:418:29: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:39: sparse: sparse: mixing different enum types:
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:39: sparse:    unsigned int enum hinic_aeq_type
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:39: sparse:    unsigned int enum hinic_ucode_event_type
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:431:37: sparse: sparse: cast to restricted __be64
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:479:24: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:765:25: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:765:25: sparse:     expected unsigned int [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:765:25: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:783:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] desc @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:783:28: sparse:     expected unsigned int [usertype] desc
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:783:28: sparse:     got restricted __be32 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c: In function 'aeq_irq_handler':
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:37: warning: implicit conversion from 'enum hinic_aeq_type' to 'enum hinic_ucode_event_type' [-Wenum-conversion]
     426 |                         ucode_event = event;
         |                                     ^
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_register_hw_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Function parameter or member 'hwe_cb' not described in 'hinic_aeq_register_hw_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Excess function parameter 'eqs' description in 'hinic_aeq_register_hw_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Excess function parameter 'handle' description in 'hinic_aeq_register_hw_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Excess function parameter 'hw_cb' description in 'hinic_aeq_register_hw_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:258: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_unregister_hw_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:258: warning: Excess function parameter 'eqs' description in 'hinic_aeq_unregister_hw_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_register_swe_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Function parameter or member 'aeq_swe_cb' not described in 'hinic_aeq_register_swe_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Excess function parameter 'eqs' description in 'hinic_aeq_register_swe_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Excess function parameter 'handle' description in 'hinic_aeq_register_swe_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Excess function parameter 'sw_cb' description in 'hinic_aeq_register_swe_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:300: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_unregister_swe_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:300: warning: Excess function parameter 'eqs' description in 'hinic_aeq_unregister_swe_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Function parameter or member 'hwdev' not described in 'hinic_ceq_register_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Function parameter or member 'callback' not described in 'hinic_ceq_register_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Excess function parameter 'ceqs' description in 'hinic_ceq_register_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Excess function parameter 'handle' description in 'hinic_ceq_register_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Excess function parameter 'ceq_cb' description in 'hinic_ceq_register_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:342: warning: Function parameter or member 'hwdev' not described in 'hinic_ceq_unregister_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:342: warning: Excess function parameter 'ceqs' description in 'hinic_ceq_unregister_cb'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:361: warning: Function parameter or member 'arm_state' not described in 'set_eq_cons_idx'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:382: warning: Function parameter or member 'ceqs' not described in 'ceq_event_handler'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:382: warning: Excess function parameter 'eqs' description in 'ceq_event_handler'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:954: warning: Function parameter or member 'hwdev' not described in 'init_eq'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:954: warning: Excess function parameter 'hwif' description in 'init_eq'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:954: warning: Excess function parameter 'page_size' description in 'init_eq'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Function parameter or member 'hwdev' not described in 'hinic_aeqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Function parameter or member 'num_aeqs' not described in 'hinic_aeqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'aeqs' description in 'hinic_aeqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'hwif' description in 'hinic_aeqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'num_ceqs' description in 'hinic_aeqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'q_len' description in 'hinic_aeqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'page_size' description in 'hinic_aeqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1139: warning: Function parameter or member 'hwdev' not described in 'hinic_aeqs_free'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1139: warning: Excess function parameter 'aeqs' description in 'hinic_aeqs_free'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Function parameter or member 'hwdev' not described in 'hinic_ceqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'ceqs' description in 'hinic_ceqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'hwif' description in 'hinic_ceqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'q_len' description in 'hinic_ceqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'page_size' description in 'hinic_ceqs_init'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1222: warning: Function parameter or member 'hwdev' not described in 'hinic_ceqs_free'
   drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1222: warning: Excess function parameter 'ceqs' description in 'hinic_ceqs_free'
--
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:735:5: sparse: sparse: symbol 'set_vf_mbox_random_id' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:813:21: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:787:6: sparse: sparse: symbol 'check_vf_mbox_random_id' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:893:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned char [usertype] * @@
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:893:54: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:893:54: sparse:     got unsigned char [usertype] *
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:909:58: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned char [usertype] * @@
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:909:58: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:909:58: sparse:     got unsigned char [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:947:6: sparse: sparse: symbol 'dump_mox_reg' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:962:22: sparse: sparse: cast to restricted __be64
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:1450:25: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned char [usertype] *data @@     got unsigned char [noderef] [usertype] __iomem * @@
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:1450:25: sparse:     expected unsigned char [usertype] *data
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:1450:25: sparse:     got unsigned char [noderef] [usertype] __iomem *
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:735:5: warning: no previous prototype for 'set_vf_mbox_random_id' [-Wmissing-prototypes]
     735 | int set_vf_mbox_random_id(struct hinic_hwdev *hwdev, u16 func_id)
         |     ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:787:6: warning: no previous prototype for 'check_vf_mbox_random_id' [-Wmissing-prototypes]
     787 | bool check_vf_mbox_random_id(struct hinic_mbox_func_to_func *func_to_func,
         |      ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:947:6: warning: no previous prototype for 'dump_mox_reg' [-Wmissing-prototypes]
     947 | void dump_mox_reg(struct hinic_hwdev *hwdev)
         |      ^~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:265: warning: Function parameter or member 'hwdev' not described in 'hinic_register_ppf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:265: warning: Excess function parameter 'func_to_func' description in 'hinic_register_ppf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:287: warning: Function parameter or member 'hwdev' not described in 'hinic_register_pf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:287: warning: Excess function parameter 'func_to_func' description in 'hinic_register_pf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:309: warning: Function parameter or member 'hwdev' not described in 'hinic_register_vf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:309: warning: Excess function parameter 'func_to_func' description in 'hinic_register_vf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:331: warning: Function parameter or member 'hwdev' not described in 'hinic_register_ppf_to_pf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:331: warning: Excess function parameter 'func_to_func' description in 'hinic_register_ppf_to_pf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:350: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_ppf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:350: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_ppf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:364: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_pf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:364: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_pf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:378: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_vf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:378: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_vf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:392: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_ppf_to_pf_mbox_cb'
   drivers/net/ethernet/huawei/hinic/hinic_mbox.c:392: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_ppf_to_pf_mbox_cb'
--
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:160:31: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:241:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:241:20: sparse:     expected unsigned long long [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:241:20: sparse:     got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:302:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] desc @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:302:20: sparse:     expected unsigned long long [usertype] desc
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:302:20: sparse:     got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:353:20: sparse: sparse: cast to restricted __be32
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:357:25: sparse: sparse: cast to restricted __be64
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:417:31: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:776:41: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] hw_cmd_paddr @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:776:41: sparse:     expected unsigned long long [usertype] hw_cmd_paddr
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:776:41: sparse:     got restricted __be64 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:782:42: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] hw_cmd_paddr @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:782:42: sparse:     expected unsigned long long [usertype] hw_cmd_paddr
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:782:42: sparse:     got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:809:37: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] hw_wb_resp_paddr @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:809:37: sparse:     expected unsigned long long [usertype] hw_wb_resp_paddr
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:809:37: sparse:     got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:887:43: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] next_cell_paddr @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:887:43: sparse:     expected unsigned long long [usertype] next_cell_paddr
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:887:43: sparse:     got restricted __be64 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:930:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] next_cell_paddr @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:930:31: sparse:     expected unsigned long long [usertype] next_cell_paddr
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:930:31: sparse:     got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:999:47: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected unsigned int flag @@     got restricted gfp_t @@
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:999:47: sparse:     expected unsigned int flag
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:999:47: sparse:     got restricted gfp_t
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:515:17: sparse: sparse: context imbalance in 'api_cmd' - different lock contexts for basic block
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c: In function 'api_chain_init':
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1033:41: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
    1033 |                 sema_deinit(&chain->sem);
         |                                         ^
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c: In function 'api_chain_free':
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1056:41: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
    1056 |                 sema_deinit(&chain->sem);
         |                                         ^
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:197: warning: Function parameter or member 'cmd_size' not described in 'get_cell_data_size'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:411: warning: Function parameter or member 'ctxt' not described in 'wait_for_resp_polling'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:411: warning: Excess function parameter 'chain' description in 'wait_for_resp_polling'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:443: warning: Function parameter or member 'ctxt' not described in 'wait_for_api_cmd_completion'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:443: warning: Function parameter or member 'ack' not described in 'wait_for_api_cmd_completion'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:443: warning: Function parameter or member 'ack_size' not described in 'wait_for_api_cmd_completion'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Function parameter or member 'cmd_size' not described in 'api_cmd'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Function parameter or member 'ack' not described in 'api_cmd'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Function parameter or member 'ack_size' not described in 'api_cmd'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Excess function parameter 'size' description in 'api_cmd'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:565: warning: Function parameter or member 'cmd_chain' not described in 'api_cmd_hw_restart'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:565: warning: Excess function parameter 'chain' description in 'api_cmd_hw_restart'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1068: warning: Function parameter or member 'cmd_chain' not described in 'api_cmd_create_chain'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1068: warning: Excess function parameter 'chain' description in 'api_cmd_create_chain'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1132: warning: Function parameter or member 'hwdev' not described in 'hinic_api_cmd_init'
   drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1132: warning: Excess function parameter 'hwif' description in 'hinic_api_cmd_init'
--
>> drivers/net/ethernet/huawei/hinic/hinic_wq.c:208:55: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected unsigned int flag @@     got restricted gfp_t @@
   drivers/net/ethernet/huawei/hinic/hinic_wq.c:208:55: sparse:     expected unsigned int flag
   drivers/net/ethernet/huawei/hinic/hinic_wq.c:208:55: sparse:     got restricted gfp_t
>> drivers/net/ethernet/huawei/hinic/hinic_wq.c:214:24: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_wq.c:214:24: sparse:     expected unsigned long long [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_wq.c:214:24: sparse:     got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_wq.c:587:16: sparse: sparse: cast to restricted __be64
--
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:366:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [addressable] [usertype] db_info @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:366:20: sparse:     expected unsigned int [addressable] [usertype] db_info
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:366:20: sparse:     got restricted __be32 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned char [usertype] * @@
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse:     got unsigned char [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:511:31: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:517:40: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] @@     got restricted __be64 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:517:40: sparse:     expected unsigned long long [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:517:40: sparse:     got restricted __be64 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:531:21: sparse: sparse: cast to restricted __be32
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1080:27: sparse: sparse: cast to restricted __be32
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1151:25: sparse: sparse: cast to restricted __be32
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1217:37: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1245:31: sparse: sparse: cast to restricted __be64
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:26: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned char [noderef] [usertype] __iomem *db_base @@     got unsigned char [usertype] * @@
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:23: sparse:     expected unsigned char [noderef] [usertype] __iomem *db_base
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:23: sparse:     got unsigned char [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1334:5: sparse: sparse: symbol 'hinic_set_cmdq_ctxts' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1334:5: warning: no previous prototype for 'hinic_set_cmdq_ctxts' [-Wmissing-prototypes]
    1334 | int hinic_set_cmdq_ctxts(struct hinic_hwdev *hwdev)
         |     ^~~~~~~~~~~~~~~~~~~~
--
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:223:5: sparse: sparse: symbol 'hinic_hw_rx_buf_size' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:629:28: sparse: sparse: symbol 'hw_cmd_support_vf' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:659:30: sparse: sparse: symbol 'mgmt_status_log' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:722:6: sparse: sparse: symbol 'hinic_print_status_info' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1039:5: sparse: sparse: symbol 'hinic_msg_to_mgmt_no_ack' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1106:22: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1106:22: sparse:     expected unsigned int [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1106:22: sparse:     got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1128:24: sparse: sparse: cast to restricted __be32
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1826:5: sparse: sparse: symbol 'hinic_sync_heartbeat_status' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1928:5: sparse: sparse: symbol 'comm_pf_mbox_handler' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2617:5: sparse: sparse: symbol 'ppf_ht_gpa_set' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2663:5: sparse: sparse: symbol 'hinic_ppf_ht_gpa_init' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2709:6: sparse: sparse: symbol 'hinic_ppf_ht_gpa_deinit' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4205:6: sparse: sparse: symbol 'pf_fault_event_handler' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4213:6: sparse: sparse: symbol 'mgmt_watchdog_event_handler' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4220:6: sparse: sparse: symbol 'mgmt_fmw_act_event_handler' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4227:6: sparse: sparse: symbol 'mgmt_pcie_dfx_event_handler' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4234:6: sparse: sparse: symbol 'mgmt_get_mctp_event_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4517:5: sparse: sparse: symbol '_set_led_status' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4603:5: sparse: sparse: symbol 'hinic_get_phy_init_status' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4807:5: sparse: sparse: symbol 'hinic_read_reg' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4985:23: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4991:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [addressable] [assigned] [usertype] val @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4991:21: sparse:     expected unsigned int [addressable] [assigned] [usertype] val
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4991:21: sparse:     got restricted __be32 [usertype]
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:722:6: warning: no previous prototype for 'hinic_print_status_info' [-Wmissing-prototypes]
     722 | void hinic_print_status_info(void *hwdev, enum hinic_mod_type mod, u8 cmd,
         |      ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1039:5: warning: no previous prototype for 'hinic_msg_to_mgmt_no_ack' [-Wmissing-prototypes]
    1039 | int hinic_msg_to_mgmt_no_ack(void *hwdev, enum hinic_mod_type mod, u8 cmd,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1826:5: warning: no previous prototype for 'hinic_sync_heartbeat_status' [-Wmissing-prototypes]
    1826 | int hinic_sync_heartbeat_status(struct hinic_hwdev *hwdev,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1928:5: warning: no previous prototype for 'comm_pf_mbox_handler' [-Wmissing-prototypes]
    1928 | int comm_pf_mbox_handler(void *handle, u16 vf_id, u8 cmd, void *buf_in,
         |     ^~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2617:5: warning: no previous prototype for 'ppf_ht_gpa_set' [-Wmissing-prototypes]
    2617 | int ppf_ht_gpa_set(struct hinic_hwdev *hwdev, struct hinic_page_addr *pg0,
         |     ^~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2663:5: warning: no previous prototype for 'hinic_ppf_ht_gpa_init' [-Wmissing-prototypes]
    2663 | int hinic_ppf_ht_gpa_init(struct hinic_hwdev *hwdev)
         |     ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2709:6: warning: no previous prototype for 'hinic_ppf_ht_gpa_deinit' [-Wmissing-prototypes]
    2709 | void hinic_ppf_ht_gpa_deinit(struct hinic_hwdev *hwdev)
         |      ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2786:5: warning: no previous prototype for 'mqm_eqm_try_alloc_mem' [-Wmissing-prototypes]
    2786 | int mqm_eqm_try_alloc_mem(struct hinic_hwdev *hwdev, u32 page_size,
         |     ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2823:5: warning: no previous prototype for 'mqm_eqm_alloc_page_mem' [-Wmissing-prototypes]
    2823 | int mqm_eqm_alloc_page_mem(struct hinic_hwdev *hwdev)
         |     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2848:6: warning: no previous prototype for 'mqm_eqm_free_page_mem' [-Wmissing-prototypes]
    2848 | void mqm_eqm_free_page_mem(struct hinic_hwdev *hwdev)
         |      ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2864:5: warning: no previous prototype for 'mqm_eqm_set_cfg_2_hw' [-Wmissing-prototypes]
    2864 | int mqm_eqm_set_cfg_2_hw(struct hinic_hwdev *hwdev, u32 valid)
         |     ^~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2889:5: warning: no previous prototype for 'mqm_eqm_set_page_2_hw' [-Wmissing-prototypes]
    2889 | int mqm_eqm_set_page_2_hw(struct hinic_hwdev *hwdev)
         |     ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2967:5: warning: no previous prototype for 'mqm_eqm_init' [-Wmissing-prototypes]
    2967 | int mqm_eqm_init(struct hinic_hwdev *hwdev)
         |     ^~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3030:6: warning: no previous prototype for 'mqm_eqm_deinit' [-Wmissing-prototypes]
    3030 | void mqm_eqm_deinit(struct hinic_hwdev *hwdev)
         |      ^~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3932:6: warning: no previous prototype for 'print_hilink_info' [-Wmissing-prototypes]
    3932 | void print_hilink_info(struct hinic_hwdev *hwdev,
         |      ^~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4205:6: warning: no previous prototype for 'pf_fault_event_handler' [-Wmissing-prototypes]
    4205 | void pf_fault_event_handler(void *hwdev,
         |      ^~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4213:6: warning: no previous prototype for 'mgmt_watchdog_event_handler' [-Wmissing-prototypes]
    4213 | void mgmt_watchdog_event_handler(void *hwdev, void *buf_in, u16 in_size,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4220:6: warning: no previous prototype for 'mgmt_fmw_act_event_handler' [-Wmissing-prototypes]
    4220 | void mgmt_fmw_act_event_handler(void *hwdev, void *buf_in, u16 in_size,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4227:6: warning: no previous prototype for 'mgmt_pcie_dfx_event_handler' [-Wmissing-prototypes]
    4227 | void mgmt_pcie_dfx_event_handler(void *hwdev, void *buf_in, u16 in_size,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4234:6: warning: no previous prototype for 'mgmt_get_mctp_event_handler' [-Wmissing-prototypes]
    4234 | void mgmt_get_mctp_event_handler(void *hwdev, void *buf_in, u16 in_size,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4517:5: warning: no previous prototype for '_set_led_status' [-Wmissing-prototypes]
    4517 | int _set_led_status(struct hinic_hwdev *hwdev, u8 port,
         |     ^~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4603:5: warning: no previous prototype for 'hinic_get_phy_init_status' [-Wmissing-prototypes]
    4603 | int hinic_get_phy_init_status(void *hwdev,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4807:5: warning: no previous prototype for 'hinic_read_reg' [-Wmissing-prototypes]
    4807 | int hinic_read_reg(void *hwdev, u32 reg_addr, u32 *val)
         |     ^~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4894:5: warning: no previous prototype for 'hinic_register_fault_recover' [-Wmissing-prototypes]
    4894 | int hinic_register_fault_recover(void *hwdev, void *pri_handle,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4916:5: warning: no previous prototype for 'hinic_unregister_fault_recover' [-Wmissing-prototypes]
    4916 | int hinic_unregister_fault_recover(void *hwdev)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c: In function '__print_cable_info.isra':
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3849:29: warning: ', Temperature: ' directive output may be truncated writing 15 bytes into a region of size between 0 and 511 [-Wformat-truncation=]
    3849 |                          "%s, Temperature: %u", tmp_str,
         |                             ^~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3849:26: note: directive argument in the range [0, 255]
    3849 |                          "%s, Temperature: %u", tmp_str,
         |                          ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3848:17: note: 'snprintf' output between 17 and 530 bytes into a destination of size 511
    3848 |                 snprintf(tmp_str, sizeof(tmp_str) - 1,
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3849 |                          "%s, Temperature: %u", tmp_str,
         |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3850 |                          info->cable_temp);
         |                          ~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3848:17: warning: 'snprintf' argument 4 overlaps destination object 'tmp_str' [-Wrestrict]
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3812:14: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
    3812 |         char tmp_str[512] = {0};
         |              ^~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1721: warning: Function parameter or member 'hwdev' not described in 'set_pf_dma_attr_entry'
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1721: warning: Excess function parameter 'hwif' description in 'set_pf_dma_attr_entry'
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1780: warning: Function parameter or member 'hwdev' not described in 'dma_attr_table_init'
   drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1780: warning: Excess function parameter 'hwif' description in 'dma_attr_table_init'
--
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:41:6: sparse: sparse: symbol 'g_test_qpc_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:42:6: sparse: sparse: symbol 'g_test_qpc_resvd_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:43:6: sparse: sparse: symbol 'g_test_pagesize_reorder' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:44:6: sparse: sparse: symbol 'g_test_xid_alloc_mode' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:45:6: sparse: sparse: symbol 'g_test_gpa_check_enable' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:46:6: sparse: sparse: symbol 'g_test_qpc_alloc_mode' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:47:6: sparse: sparse: symbol 'g_test_scqc_alloc_mode' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:48:6: sparse: sparse: symbol 'g_test_max_conn' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:49:6: sparse: sparse: symbol 'g_test_max_cache_conn' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:50:6: sparse: sparse: symbol 'g_test_scqc_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:51:6: sparse: sparse: symbol 'g_test_mpt_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:52:6: sparse: sparse: symbol 'g_test_mpt_resvd' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:53:6: sparse: sparse: symbol 'g_test_scq_resvd' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:54:6: sparse: sparse: symbol 'g_test_hash_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:55:6: sparse: sparse: symbol 'g_test_reorder_num' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1411:5: sparse: sparse: symbol 'init_cfg_mgmt' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1458:6: sparse: sparse: symbol 'free_cfg_mgmt' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1493:5: sparse: sparse: symbol 'init_capability' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1522:6: sparse: sparse: symbol 'free_capability' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1732:5: sparse: sparse: symbol 'cfg_set_func_sf_en' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1770:5: sparse: sparse: symbol 'cfg_get_func_sf_en' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1096:5: warning: no previous prototype for 'hinic_vector_to_irq' [-Wmissing-prototypes]
    1096 | int hinic_vector_to_irq(void *hwdev, enum hinic_service_type type, int vector)
         |     ^~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1411:5: warning: no previous prototype for 'init_cfg_mgmt' [-Wmissing-prototypes]
    1411 | int init_cfg_mgmt(struct hinic_hwdev *dev)
         |     ^~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1458:6: warning: no previous prototype for 'free_cfg_mgmt' [-Wmissing-prototypes]
    1458 | void free_cfg_mgmt(struct hinic_hwdev *dev)
         |      ^~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1493:5: warning: no previous prototype for 'init_capability' [-Wmissing-prototypes]
    1493 | int init_capability(struct hinic_hwdev *dev)
         |     ^~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1522:6: warning: no previous prototype for 'free_capability' [-Wmissing-prototypes]
    1522 | void free_capability(struct hinic_hwdev *dev)
         |      ^~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1732:5: warning: no previous prototype for 'cfg_set_func_sf_en' [-Wmissing-prototypes]
    1732 | int cfg_set_func_sf_en(void *hwdev, u32 enbits, u32 enmask)
         |     ^~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1770:5: warning: no previous prototype for 'cfg_get_func_sf_en' [-Wmissing-prototypes]
    1770 | int cfg_get_func_sf_en(void *hwdev, u32 *enbits)
         |     ^~~~~~~~~~~~~~~~~~
--
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:66:6: sparse: sparse: symbol 'get_slave_host_enable' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:589:6: sparse: sparse: symbol 'comm_ppf_to_pf_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:607:5: sparse: sparse: symbol 'hinic_nic_ppf_mbox_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:616:6: sparse: sparse: symbol 'hinic_nic_ppf_to_pf_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:625:5: sparse: sparse: symbol 'hinic_register_slave_ppf' was not declared. Should it be static?
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:66:6: warning: no previous prototype for 'get_slave_host_enable' [-Wmissing-prototypes]
      66 | bool get_slave_host_enable(struct hinic_hwdev *hwdev, u8 host_id)
         |      ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:209:5: warning: no previous prototype for '__mbox_to_host' [-Wmissing-prototypes]
     209 | int __mbox_to_host(struct hinic_hwdev *hwdev, enum hinic_mod_type mod,
         |     ^~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:483:5: warning: no previous prototype for 'sw_func_ppf_mbox_handler' [-Wmissing-prototypes]
     483 | int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:506:5: warning: no previous prototype for '__ppf_process_mbox_msg' [-Wmissing-prototypes]
     506 | int __ppf_process_mbox_msg(struct hinic_hwdev *hwdev, u16 pf_idx, u16 vf_id,
         |     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:580:5: warning: no previous prototype for 'comm_ppf_mbox_handler' [-Wmissing-prototypes]
     580 | int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
         |     ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:589:6: warning: no previous prototype for 'comm_ppf_to_pf_handler' [-Wmissing-prototypes]
     589 | void comm_ppf_to_pf_handler(void *handle, u8 cmd,
         |      ^~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:598:5: warning: no previous prototype for 'hilink_ppf_mbox_handler' [-Wmissing-prototypes]
     598 | int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
         |     ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:607:5: warning: no previous prototype for 'hinic_nic_ppf_mbox_handler' [-Wmissing-prototypes]
     607 | int hinic_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:616:6: warning: no previous prototype for 'hinic_nic_ppf_to_pf_handler' [-Wmissing-prototypes]
     616 | void hinic_nic_ppf_to_pf_handler(void *handle, u8 cmd,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:625:5: warning: no previous prototype for 'hinic_register_slave_ppf' [-Wmissing-prototypes]
     625 | int hinic_register_slave_ppf(struct hinic_hwdev *hwdev, bool registered)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:686:5: warning: no previous prototype for 'set_slave_func_nic_state' [-Wmissing-prototypes]
     686 | int set_slave_func_nic_state(struct hinic_hwdev *hwdev, u16 func_idx, u8 en)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/nic_cmd_support_vf +72 drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c
    71	
  > 72	struct vf_cmd_check_handle nic_cmd_support_vf[] = {
    73		{HINIC_PORT_CMD_VF_REGISTER, NULL},
    74		{HINIC_PORT_CMD_VF_UNREGISTER, NULL},
    75	
    76		{HINIC_PORT_CMD_CHANGE_MTU, hinic_mbox_check_func_id_8B},
    77	
    78		{HINIC_PORT_CMD_ADD_VLAN, hinic_mbox_check_func_id_8B},
    79		{HINIC_PORT_CMD_DEL_VLAN, hinic_mbox_check_func_id_8B},
    80	
    81		{HINIC_PORT_CMD_SET_MAC, hinic_mbox_check_func_id_8B},
    82		{HINIC_PORT_CMD_GET_MAC, hinic_mbox_check_func_id_8B},
    83		{HINIC_PORT_CMD_DEL_MAC, hinic_mbox_check_func_id_8B},
    84	
    85		{HINIC_PORT_CMD_SET_RX_MODE, hinic_mbox_check_func_id_8B},
    86	
    87		{HINIC_PORT_CMD_GET_PAUSE_INFO, hinic_mbox_check_func_id_8B},
    88	
    89		{HINIC_PORT_CMD_GET_LINK_STATE, hinic_mbox_check_func_id_8B},
    90		{HINIC_PORT_CMD_SET_LRO, hinic_mbox_check_func_id_8B},
    91		{HINIC_PORT_CMD_SET_RX_CSUM, hinic_mbox_check_func_id_8B},
    92		{HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD, hinic_mbox_check_func_id_8B},
    93	
    94		{HINIC_PORT_CMD_GET_VPORT_STAT, hinic_mbox_check_func_id_8B},
    95		{HINIC_PORT_CMD_CLEAN_VPORT_STAT, hinic_mbox_check_func_id_8B},
    96	
    97		{HINIC_PORT_CMD_GET_RSS_TEMPLATE_INDIR_TBL,
    98		 hinic_mbox_check_func_id_8B},
    99		{HINIC_PORT_CMD_SET_RSS_TEMPLATE_INDIR_TBL,
   100		 hinic_mbox_check_func_id_8B},
   101		{HINIC_PORT_CMD_SET_RSS_TEMPLATE_TBL, hinic_mbox_check_func_id_8B},
   102		{HINIC_PORT_CMD_GET_RSS_TEMPLATE_TBL, hinic_mbox_check_func_id_8B},
   103		{HINIC_PORT_CMD_SET_RSS_HASH_ENGINE, hinic_mbox_check_func_id_8B},
   104		{HINIC_PORT_CMD_GET_RSS_HASH_ENGINE, hinic_mbox_check_func_id_8B},
   105		{HINIC_PORT_CMD_GET_RSS_CTX_TBL, hinic_mbox_check_func_id_8B},
   106		{HINIC_PORT_CMD_SET_RSS_CTX_TBL, hinic_mbox_check_func_id_8B},
   107		{HINIC_PORT_CMD_RSS_TEMP_MGR, hinic_mbox_check_func_id_8B},
   108		{HINIC_PORT_CMD_RSS_CFG, hinic_mbox_check_func_id_8B},
   109	
   110		{HINIC_PORT_CMD_INIT_FUNC, check_func_table},
   111		{HINIC_PORT_CMD_SET_LLI_PRI, hinic_mbox_check_func_id_8B},
   112	
   113		{HINIC_PORT_CMD_GET_MGMT_VERSION, NULL},
   114		{HINIC_PORT_CMD_GET_BOOT_VERSION, NULL},
   115		{HINIC_PORT_CMD_GET_MICROCODE_VERSION, NULL},
   116	
   117		{HINIC_PORT_CMD_GET_VPORT_ENABLE, hinic_mbox_check_func_id_8B},
   118		{HINIC_PORT_CMD_SET_VPORT_ENABLE, hinic_mbox_check_func_id_8B},
   119	
   120		{HINIC_PORT_CMD_GET_LRO, hinic_mbox_check_func_id_8B},
   121		{HINIC_PORT_CMD_GET_GLOBAL_QPN, hinic_mbox_check_func_id_8B},
   122	
   123		{HINIC_PORT_CMD_SET_TSO, hinic_mbox_check_func_id_8B},
   124		{HINIC_PORT_CMD_SET_RQ_IQ_MAP, hinic_mbox_check_func_id_8B},
   125		{HINIC_PORT_CMD_LINK_STATUS_REPORT, hinic_mbox_check_func_id_8B},
   126		{HINIC_PORT_CMD_UPDATE_MAC, hinic_mbox_check_func_id_8B},
   127	
   128		{HINIC_PORT_CMD_GET_PORT_INFO, hinic_mbox_check_func_id_8B},
   129	
   130		{HINIC_PORT_CMD_SET_IPSU_MAC, hinic_mbox_check_func_id_10B},
   131		{HINIC_PORT_CMD_GET_IPSU_MAC, hinic_mbox_check_func_id_10B},
   132	
   133		{HINIC_PORT_CMD_GET_LINK_MODE, hinic_mbox_check_func_id_8B},
   134	
   135		{HINIC_PORT_CMD_CLEAR_SQ_RES, hinic_mbox_check_func_id_8B},
   136		{HINIC_PORT_CMD_SET_SUPER_CQE, hinic_mbox_check_func_id_8B},
   137	
   138		{HINIC_PORT_CMD_GET_VF_COS, NULL},
   139		{HINIC_PORT_CMD_SET_VHD_CFG, hinic_mbox_check_func_id_8B},
   140	
   141		{HINIC_PORT_CMD_SET_VLAN_FILTER, hinic_mbox_check_func_id_8B},
   142	};
   143	
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    10 Mar '25
                    
                        From: Zheng Yejian <zhengyejian1(a)huawei.com>
stable inclusion
from stable-v4.19.253
commit eb622d5580b9e2ff694f62da6410618bd73853cb
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6IV
CVE: CVE-2022-49648
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
commit 7edc3945bdce9c39198a10d6129377a5c53559c2 upstream.
This reverts commit 46bbe5c671e06f070428b9be142cc4ee5cedebac.
As commit 46bbe5c671e0 ("tracing: fix double free") said, the
"double free" problem reported by clang static analyzer is:
  > In parse_var_defs() if there is a problem allocating
  > var_defs.expr, the earlier var_defs.name is freed.
  > This free is duplicated by free_var_defs() which frees
  > the rest of the list.
However, if there is a problem allocating N-th var_defs.expr:
  + in parse_var_defs(), the freed 'earlier var_defs.name' is
    actually the N-th var_defs.name;
  + then in free_var_defs(), the names from 0th to (N-1)-th are freed;
                        IF ALLOCATING PROBLEM HAPPENED HERE!!! -+
                                                                 \
                                                                  |
          0th           1th                 (N-1)-th      N-th    V
          +-------------+-------------+-----+-------------+-----------
var_defs: | name | expr | name | expr | ... | name | expr | name | ///
          +-------------+-------------+-----+-------------+-----------
These two frees don't act on same name, so there was no "double free"
problem before. Conversely, after that commit, we get a "memory leak"
problem because the above "N-th var_defs.name" is not freed.
If enable CONFIG_DEBUG_KMEMLEAK and inject a fault at where the N-th
var_defs.expr allocated, then execute on shell like:
  $ echo 'hist:key=call_site:val=$v1,$v2:v1=bytes_req,v2=bytes_alloc' > \
/sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
Then kmemleak reports:
  unreferenced object 0xffff8fb100ef3518 (size 8):
    comm "bash", pid 196, jiffies 4295681690 (age 28.538s)
    hex dump (first 8 bytes):
      76 31 00 00 b1 8f ff ff                          v1......
    backtrace:
      [<0000000038fe4895>] kstrdup+0x2d/0x60
      [<00000000c99c049a>] event_hist_trigger_parse+0x206f/0x20e0
      [<00000000ae70d2cc>] trigger_process_regex+0xc0/0x110
      [<0000000066737a4c>] event_trigger_write+0x75/0xd0
      [<000000007341e40c>] vfs_write+0xbb/0x2a0
      [<0000000087fde4c2>] ksys_write+0x59/0xd0
      [<00000000581e9cdf>] do_syscall_64+0x3a/0x80
      [<00000000cf3b065c>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
Link: https://lkml.kernel.org/r/20220711014731.69520-1-zhengyejian1@huawei.com
Cc: stable(a)vger.kernel.org
Fixes: 46bbe5c671e0 ("tracing: fix double free")
Reported-by: Hulk Robot <hulkci(a)huawei.com>
Suggested-by: Steven Rostedt <rostedt(a)goodmis.org>
Reviewed-by: Tom Zanussi <tom.zanussi(a)linux.intel.com>
Signed-off-by: Zheng Yejian <zhengyejian1(a)huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Li Huafei <lihuafei1(a)huawei.com>
---
 kernel/trace/trace_events_hist.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 638566ea7839..2f57eb241ac9 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -4155,6 +4155,8 @@ static int parse_var_defs(struct hist_trigger_data *hist_data)
 
 			s = kstrdup(field_str, GFP_KERNEL);
 			if (!s) {
+				kfree(hist_data->attrs->var_defs.name[n_vars]);
+				hist_data->attrs->var_defs.name[n_vars] = NULL;
 				ret = -ENOMEM;
 				goto free;
 			}
-- 
2.25.1
                    
                  
                  
                          
                            
                            2
                            
                          
                          
                            
                            1
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [openeuler:OLK-6.6 2007/2007] kernel/kexec_core.c:1066: undefined reference to `machine_crash_shutdown'
                        
                        
by kernel test robot 09 Mar '25
                    by kernel test robot 09 Mar '25
09 Mar '25
                    
                        tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   944ce05f6b83ba40c4382c6b90b7b94f529118d3
commit: 47ff774cbb440dfc3cf5d5bc7cf82b41d4d99966 [2007/2007] x86, crash: wrap crash dumping code into crash related ifdefs
config: x86_64-randconfig-r121-20250309 (https://download.01.org/0day-ci/archive/20250309/202503091909.W4esTcVo-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250309/202503091909.W4esTcVo-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503091909.W4esTcVo-lkp@intel.com/
All errors (new ones prefixed by >>):
   ld: kernel/kexec_core.o: in function `__crash_kexec':
>> kernel/kexec_core.c:1066: undefined reference to `machine_crash_shutdown'
   ld: kernel/kexec.o: in function `do_kexec_load':
>> kernel/kexec.c:105: undefined reference to `arch_kexec_unprotect_crashkres'
>> ld: kernel/kexec.c:166: undefined reference to `arch_kexec_protect_crashkres'
   ld: kernel/kexec_file.o: in function `__do_sys_kexec_file_load':
>> kernel/kexec_file.c:350: undefined reference to `arch_kexec_unprotect_crashkres'
>> ld: kernel/kexec_file.c:415: undefined reference to `arch_kexec_protect_crashkres'
vim +1066 kernel/kexec_core.c
7e99f8b69c11c1 Ricardo Ribalda    2023-01-04  1044  
7bbee5ca3896f6 Hidehiro Kawai     2015-12-14  1045  /*
7bbee5ca3896f6 Hidehiro Kawai     2015-12-14  1046   * No panic_cpu check version of crash_kexec().  This function is called
7bbee5ca3896f6 Hidehiro Kawai     2015-12-14  1047   * only when panic_cpu holds the current CPU number; this is the only CPU
7bbee5ca3896f6 Hidehiro Kawai     2015-12-14  1048   * which processes crash_kexec routines.
7bbee5ca3896f6 Hidehiro Kawai     2015-12-14  1049   */
c207aee48037ab Josh Poimboeuf     2017-06-28  1050  void __noclone __crash_kexec(struct pt_regs *regs)
2965faa5e03d1e Dave Young         2015-09-09  1051  {
05c6257433b721 Valentin Schneider 2022-06-30  1052  	/* Take the kexec_lock here to prevent sys_kexec_load
2965faa5e03d1e Dave Young         2015-09-09  1053  	 * running on one cpu from replacing the crash kernel
2965faa5e03d1e Dave Young         2015-09-09  1054  	 * we are using after a panic on a different cpu.
2965faa5e03d1e Dave Young         2015-09-09  1055  	 *
2965faa5e03d1e Dave Young         2015-09-09  1056  	 * If the crash kernel was not located in a fixed area
2965faa5e03d1e Dave Young         2015-09-09  1057  	 * of memory the xchg(&kexec_crash_image) would be
2965faa5e03d1e Dave Young         2015-09-09  1058  	 * sufficient.  But since I reuse the memory...
2965faa5e03d1e Dave Young         2015-09-09  1059  	 */
05c6257433b721 Valentin Schneider 2022-06-30  1060  	if (kexec_trylock()) {
2965faa5e03d1e Dave Young         2015-09-09  1061  		if (kexec_crash_image) {
2965faa5e03d1e Dave Young         2015-09-09  1062  			struct pt_regs fixed_regs;
2965faa5e03d1e Dave Young         2015-09-09  1063  
2965faa5e03d1e Dave Young         2015-09-09  1064  			crash_setup_regs(&fixed_regs, regs);
2965faa5e03d1e Dave Young         2015-09-09  1065  			crash_save_vmcoreinfo();
2965faa5e03d1e Dave Young         2015-09-09 @1066  			machine_crash_shutdown(&fixed_regs);
2965faa5e03d1e Dave Young         2015-09-09  1067  			machine_kexec(kexec_crash_image);
2965faa5e03d1e Dave Young         2015-09-09  1068  		}
05c6257433b721 Valentin Schneider 2022-06-30  1069  		kexec_unlock();
2965faa5e03d1e Dave Young         2015-09-09  1070  	}
2965faa5e03d1e Dave Young         2015-09-09  1071  }
c207aee48037ab Josh Poimboeuf     2017-06-28  1072  STACK_FRAME_NON_STANDARD(__crash_kexec);
2965faa5e03d1e Dave Young         2015-09-09  1073  
:::::: The code at line 1066 was first introduced by commit
:::::: 2965faa5e03d1e71e9ff9aa143fff39e0a77543a kexec: split kexec_load syscall from kexec core code
:::::: TO: Dave Young <dyoung(a)redhat.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [openeuler:OLK-6.6 2007/2007] ld: kernel/kexec.c:105: undefined reference to `arch_kexec_unprotect_crashkres'
                        
                        
by kernel test robot 09 Mar '25
                    by kernel test robot 09 Mar '25
09 Mar '25
                    
                        tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   944ce05f6b83ba40c4382c6b90b7b94f529118d3
commit: 47ff774cbb440dfc3cf5d5bc7cf82b41d4d99966 [2007/2007] x86, crash: wrap crash dumping code into crash related ifdefs
config: x86_64-randconfig-123-20250309 (https://download.01.org/0day-ci/archive/20250309/202503091725.g6h6oRC3-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250309/202503091725.g6h6oRC3-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503091725.g6h6oRC3-lkp@intel.com/
All errors (new ones prefixed by >>):
   ld: vmlinux.o: in function `__crash_kexec':
   kernel/kexec_core.c:1066: undefined reference to `machine_crash_shutdown'
   ld: vmlinux.o: in function `do_kexec_load':
>> kernel/kexec.c:166: undefined reference to `arch_kexec_protect_crashkres'
>> ld: kernel/kexec.c:105: undefined reference to `arch_kexec_unprotect_crashkres'
   ld: vmlinux.o: in function `__do_sys_kexec_file_load':
   kernel/kexec_file.c:350: undefined reference to `arch_kexec_unprotect_crashkres'
   ld: kernel/kexec_file.c:415: undefined reference to `arch_kexec_protect_crashkres'
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [openeuler:openEuler-1.0-LTS 1473/1473] mm/khugepaged.c:974:21: sparse: sparse: invalid assignment: |=
                        
                        
by kernel test robot 09 Mar '25
                    by kernel test robot 09 Mar '25
09 Mar '25
                    
                        tree:   https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head:   1584a68cf2ef23ac87ba506e8ab8ca7e261813c1
commit: ff0fb9e816fac221fa24a1810dd895745406070b [1473/1473] mm: thp: Add memory reliable support for hugepaged collapse
config: arm64-randconfig-r113-20250309 (https://download.01.org/0day-ci/archive/20250309/202503091715.gswAJqxr-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250309/202503091715.gswAJqxr-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503091715.gswAJqxr-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> mm/khugepaged.c:974:21: sparse: sparse: invalid assignment: |=
   mm/khugepaged.c:974:21: sparse:    left side has type restricted gfp_t
   mm/khugepaged.c:974:21: sparse:    right side has type unsigned int
   mm/khugepaged.c:1352:21: sparse: sparse: invalid assignment: |=
   mm/khugepaged.c:1352:21: sparse:    left side has type restricted gfp_t
   mm/khugepaged.c:1352:21: sparse:    right side has type unsigned int
   mm/khugepaged.c:1378:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1378:9: sparse:     expected void **slot
   mm/khugepaged.c:1378:9: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1378:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1378:9: sparse:     expected void **slot
   mm/khugepaged.c:1378:9: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1409:56: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1409:56: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1409:56: sparse:     got void **slot
   mm/khugepaged.c:1458:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1458:22: sparse:     expected void **slot
   mm/khugepaged.c:1458:22: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1459:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1459:17: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1459:17: sparse:     got void **slot
   mm/khugepaged.c:1483:60: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1483:60: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1483:60: sparse:     got void **slot
   mm/khugepaged.c:1486:47: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1486:47: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1486:47: sparse:     got void **slot
   mm/khugepaged.c:1486:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1486:22: sparse:     expected void **slot
   mm/khugepaged.c:1486:22: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1378:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1378:9: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1378:9: sparse:     got void **slot
   mm/khugepaged.c:1378:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1378:9: sparse:     expected void **slot
   mm/khugepaged.c:1378:9: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1578:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1578:17: sparse:     expected void **slot
   mm/khugepaged.c:1578:17: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1578:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1578:17: sparse:     expected void **slot
   mm/khugepaged.c:1578:17: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1597:68: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1597:68: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1597:68: sparse:     got void **slot
   mm/khugepaged.c:1598:55: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1598:55: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1598:55: sparse:     got void **slot
   mm/khugepaged.c:1598:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1598:30: sparse:     expected void **slot
   mm/khugepaged.c:1598:30: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1578:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1578:17: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1578:17: sparse:     got void **slot
   mm/khugepaged.c:1578:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1578:17: sparse:     expected void **slot
   mm/khugepaged.c:1578:17: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1633:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1633:9: sparse:     expected void **slot
   mm/khugepaged.c:1633:9: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1633:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1633:9: sparse:     expected void **slot
   mm/khugepaged.c:1633:9: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1637:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1637:46: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1637:46: sparse:     got void **slot
   mm/khugepaged.c:1639:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1639:30: sparse:     expected void **slot
   mm/khugepaged.c:1639:30: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1682:55: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1682:55: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1682:55: sparse:     got void **slot
   mm/khugepaged.c:1682:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1682:30: sparse:     expected void **slot
   mm/khugepaged.c:1682:30: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c:1633:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __rcu **slot @@     got void **slot @@
   mm/khugepaged.c:1633:9: sparse:     expected void [noderef] __rcu **slot
   mm/khugepaged.c:1633:9: sparse:     got void **slot
   mm/khugepaged.c:1633:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void **slot @@     got void [noderef] __rcu ** @@
   mm/khugepaged.c:1633:9: sparse:     expected void **slot
   mm/khugepaged.c:1633:9: sparse:     got void [noderef] __rcu **
   mm/khugepaged.c: note: in included file (through include/linux/mm.h):
   include/linux/gfp.h:457:34: sparse: sparse: restricted gfp_t degrades to integer
   In file included from arch/arm64/include/asm/atomic.h:36,
                    from include/linux/atomic.h:7,
                    from include/asm-generic/bitops/atomic.h:5,
                    from arch/arm64/include/asm/bitops.h:37,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:11,
                    from include/asm-generic/bug.h:18,
                    from arch/arm64/include/asm/bug.h:37,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:10,
                    from mm/khugepaged.c:4:
   In function '__cmpxchg_case_acq_4',
       inlined from '__cmpxchg_acq' at arch/arm64/include/asm/cmpxchg.h:141:1,
       inlined from 'queued_spin_lock' at include/asm-generic/qspinlock.h:85:8,
       inlined from 'do_raw_spin_lock' at include/linux/spinlock.h:180:2,
       inlined from '__raw_spin_lock' at include/linux/spinlock_api_smp.h:143:2,
       inlined from 'spin_lock' at include/linux/spinlock.h:329:2,
vim +974 mm/khugepaged.c
   949	
   950	static void collapse_huge_page(struct mm_struct *mm,
   951					   unsigned long address,
   952					   struct page **hpage,
   953					   int node, int referenced, int unmapped,
   954					   bool reliable)
   955	{
   956		pmd_t *pmd, _pmd;
   957		pte_t *pte;
   958		pgtable_t pgtable;
   959		struct page *new_page;
   960		spinlock_t *pmd_ptl, *pte_ptl;
   961		int isolated = 0, result = 0;
   962		struct mem_cgroup *memcg;
   963		struct vm_area_struct *vma;
   964		unsigned long mmun_start;	/* For mmu_notifiers */
   965		unsigned long mmun_end;		/* For mmu_notifiers */
   966		gfp_t gfp;
   967	
   968		VM_BUG_ON(address & ~HPAGE_PMD_MASK);
   969	
   970		/* Only allocate from the target node */
   971		gfp = alloc_hugepage_khugepaged_gfpmask() | __GFP_THISNODE;
   972	
   973		if (reliable)
 > 974			gfp |= ___GFP_RELIABILITY;
   975	
   976		/*
   977		 * Before allocating the hugepage, release the mmap_sem read lock.
   978		 * The allocation can take potentially a long time if it involves
   979		 * sync compaction, and we do not need to hold the mmap_sem during
   980		 * that. We will recheck the vma after taking it again in write mode.
   981		 */
   982		up_read(&mm->mmap_sem);
   983		new_page = khugepaged_alloc_page(hpage, gfp, node);
   984		if (!new_page) {
   985			result = SCAN_ALLOC_HUGE_PAGE_FAIL;
   986			goto out_nolock;
   987		}
   988	
   989		if (unlikely(mem_cgroup_try_charge(new_page, mm, gfp, &memcg, true))) {
   990			result = SCAN_CGROUP_CHARGE_FAIL;
   991			goto out_nolock;
   992		}
   993	
   994		down_read(&mm->mmap_sem);
   995		result = hugepage_vma_revalidate(mm, address, &vma);
   996		if (result) {
   997			mem_cgroup_cancel_charge(new_page, memcg, true);
   998			up_read(&mm->mmap_sem);
   999			goto out_nolock;
  1000		}
  1001	
  1002		pmd = mm_find_pmd(mm, address);
  1003		if (!pmd) {
  1004			result = SCAN_PMD_NULL;
  1005			mem_cgroup_cancel_charge(new_page, memcg, true);
  1006			up_read(&mm->mmap_sem);
  1007			goto out_nolock;
  1008		}
  1009	
  1010		/*
  1011		 * __collapse_huge_page_swapin always returns with mmap_sem locked.
  1012		 * If it fails, we release mmap_sem and jump out_nolock.
  1013		 * Continuing to collapse causes inconsistency.
  1014		 */
  1015		if (unmapped && !__collapse_huge_page_swapin(mm, vma, address,
  1016							     pmd, referenced)) {
  1017			mem_cgroup_cancel_charge(new_page, memcg, true);
  1018			up_read(&mm->mmap_sem);
  1019			goto out_nolock;
  1020		}
  1021	
  1022		up_read(&mm->mmap_sem);
  1023		/*
  1024		 * Prevent all access to pagetables with the exception of
  1025		 * gup_fast later handled by the ptep_clear_flush and the VM
  1026		 * handled by the anon_vma lock + PG_lock.
  1027		 */
  1028		down_write(&mm->mmap_sem);
  1029		result = hugepage_vma_revalidate(mm, address, &vma);
  1030		if (result)
  1031			goto out;
  1032		/* check if the pmd is still valid */
  1033		if (mm_find_pmd(mm, address) != pmd)
  1034			goto out;
  1035	
  1036		anon_vma_lock_write(vma->anon_vma);
  1037	
  1038		pte = pte_offset_map(pmd, address);
  1039		pte_ptl = pte_lockptr(mm, pmd);
  1040	
  1041		mmun_start = address;
  1042		mmun_end   = address + HPAGE_PMD_SIZE;
  1043		mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
  1044		pmd_ptl = pmd_lock(mm, pmd); /* probably unnecessary */
  1045		/*
  1046		 * After this gup_fast can't run anymore. This also removes
  1047		 * any huge TLB entry from the CPU so we won't allow
  1048		 * huge and small TLB entries for the same virtual address
  1049		 * to avoid the risk of CPU bugs in that area.
  1050		 */
  1051		_pmd = pmdp_collapse_flush(vma, address, pmd);
  1052		spin_unlock(pmd_ptl);
  1053		mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
  1054	
  1055		spin_lock(pte_ptl);
  1056		isolated = __collapse_huge_page_isolate(vma, address, pte);
  1057		spin_unlock(pte_ptl);
  1058	
  1059		if (unlikely(!isolated)) {
  1060			pte_unmap(pte);
  1061			spin_lock(pmd_ptl);
  1062			BUG_ON(!pmd_none(*pmd));
  1063			/*
  1064			 * We can only use set_pmd_at when establishing
  1065			 * hugepmds and never for establishing regular pmds that
  1066			 * points to regular pagetables. Use pmd_populate for that
  1067			 */
  1068			pmd_populate(mm, pmd, pmd_pgtable(_pmd));
  1069			spin_unlock(pmd_ptl);
  1070			anon_vma_unlock_write(vma->anon_vma);
  1071			result = SCAN_FAIL;
  1072			goto out;
  1073		}
  1074	
  1075		/*
  1076		 * All pages are isolated and locked so anon_vma rmap
  1077		 * can't run anymore.
  1078		 */
  1079		anon_vma_unlock_write(vma->anon_vma);
  1080	
  1081		__collapse_huge_page_copy(pte, new_page, vma, address, pte_ptl);
  1082		pte_unmap(pte);
  1083		__SetPageUptodate(new_page);
  1084		pgtable = pmd_pgtable(_pmd);
  1085	
  1086		_pmd = mk_huge_pmd(new_page, vma->vm_page_prot);
  1087		_pmd = maybe_pmd_mkwrite(pmd_mkdirty(_pmd), vma);
  1088	
  1089		/*
  1090		 * spin_lock() below is not the equivalent of smp_wmb(), so
  1091		 * this is needed to avoid the copy_huge_page writes to become
  1092		 * visible after the set_pmd_at() write.
  1093		 */
  1094		smp_wmb();
  1095	
  1096		spin_lock(pmd_ptl);
  1097		BUG_ON(!pmd_none(*pmd));
  1098		page_add_new_anon_rmap(new_page, vma, address, true);
  1099		mem_cgroup_commit_charge(new_page, memcg, false, true);
  1100		count_memcg_events(memcg, THP_COLLAPSE_ALLOC, 1);
  1101		lru_cache_add_active_or_unevictable(new_page, vma);
  1102		pgtable_trans_huge_deposit(mm, pmd, pgtable);
  1103		set_pmd_at(mm, address, pmd, _pmd);
  1104		update_mmu_cache_pmd(vma, address, pmd);
  1105		spin_unlock(pmd_ptl);
  1106	
  1107		*hpage = NULL;
  1108	
  1109		khugepaged_pages_collapsed++;
  1110		result = SCAN_SUCCEED;
  1111	out_up_write:
  1112		up_write(&mm->mmap_sem);
  1113	out_nolock:
  1114		trace_mm_collapse_huge_page(mm, isolated, result);
  1115		return;
  1116	out:
  1117		mem_cgroup_cancel_charge(new_page, memcg, true);
  1118		goto out_up_write;
  1119	}
  1120	
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0