mainline inclusion
from mainline-v6.13-rc1
commit fdfa648ab9393de8c1be21cad17c17bdced3a68a
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB8IC8
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
After commit 21175ca434c5 ("ext4: make prefetch_block_bitmaps default"),
we enable 'prefetch_block_bitmaps' by default, but this is not shown in
the '/proc/fs/ext4/sdx/options' procfs interface.
This makes it impossible to distinguish whether the feature is enabled by
default or not, so 'prefetch_block_bitmaps' is shown in the 'options'
procfs interface when prefetch_block_bitmaps is enabled by default.
This makes it easy to notice changes to the default mount options between
versions through the '/proc/fs/ext4/sdx/options' procfs interface.
Signed-off-by: Baokun Li <libaokun1(a)huawei.com>
Reviewed-by: Jan Kara <jack(a)suse.cz>
Link: https://patch.msgid.link/20241008120134.3758097-1-libaokun@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso(a)mit.edu>
Signed-off-by: Baokun Li <libaokun1(a)huawei.com>
---
fs/ext4/super.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 5c52881160e5..84bee249657d 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3155,6 +3155,9 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
SEQ_OPTS_PUTS("mb_optimize_scan=1");
}
+ if (nodefs && !test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS))
+ SEQ_OPTS_PUTS("prefetch_block_bitmaps");
+
ext4_show_quota_options(seq, sb);
return 0;
}
--
2.46.1
From: Sanjay K Kumar <sanjay.k.kumar(a)intel.com>
stable inclusion
from stable-v5.10.227
commit de9e7f68762585f7532de8a06de9485bf39dbd38
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRAV
CVE: CVE-2024-49993
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 3cf74230c139f208b7fb313ae0054386eee31a81 ]
If qi_submit_sync() is invoked with 0 invalidation descriptors (for
instance, for DMA draining purposes), we can run into a bug where a
submitting thread fails to detect the completion of invalidation_wait.
Subsequently, this led to a soft lockup. Currently, there is no impact
by this bug on the existing users because no callers are submitting
invalidations with 0 descriptors. This fix will enable future users
(such as DMA drain) calling qi_submit_sync() with 0 count.
Suppose thread T1 invokes qi_submit_sync() with non-zero descriptors, while
concurrently, thread T2 calls qi_submit_sync() with zero descriptors. Both
threads then enter a while loop, waiting for their respective descriptors
to complete. T1 detects its completion (i.e., T1's invalidation_wait status
changes to QI_DONE by HW) and proceeds to call reclaim_free_desc() to
reclaim all descriptors, potentially including adjacent ones of other
threads that are also marked as QI_DONE.
During this time, while T2 is waiting to acquire the qi->q_lock, the IOMMU
hardware may complete the invalidation for T2, setting its status to
QI_DONE. However, if T1's execution of reclaim_free_desc() frees T2's
invalidation_wait descriptor and changes its status to QI_FREE, T2 will
not observe the QI_DONE status for its invalidation_wait and will
indefinitely remain stuck.
This soft lockup does not occur when only non-zero descriptors are
submitted.In such cases, invalidation descriptors are interspersed among
wait descriptors with the status QI_IN_USE, acting as barriers. These
barriers prevent the reclaim code from mistakenly freeing descriptors
belonging to other submitters.
Considered the following example timeline:
T1 T2
========================================
ID1
WD1
while(WD1!=QI_DONE)
unlock
lock
WD1=QI_DONE* WD2
while(WD2!=QI_DONE)
unlock
lock
WD1==QI_DONE?
ID1=QI_DONE WD2=DONE*
reclaim()
ID1=FREE
WD1=FREE
WD2=FREE
unlock
soft lockup! T2 never sees QI_DONE in WD2
Where:
ID = invalidation descriptor
WD = wait descriptor
* Written by hardware
The root of the problem is that the descriptor status QI_DONE flag is used
for two conflicting purposes:
1. signal a descriptor is ready for reclaim (to be freed)
2. signal by the hardware that a wait descriptor is complete
The solution (in this patch) is state separation by using QI_FREE flag
for #1.
Once a thread's invalidation descriptors are complete, their status would
be set to QI_FREE. The reclaim_free_desc() function would then only
free descriptors marked as QI_FREE instead of those marked as
QI_DONE. This change ensures that T2 (from the previous example) will
correctly observe the completion of its invalidation_wait (marked as
QI_DONE).
Signed-off-by: Sanjay K Kumar <sanjay.k.kumar(a)intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan(a)linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian(a)intel.com>
Link: https://lore.kernel.org/r/20240728210059.1964602-1-jacob.jun.pan@linux.inte…
Signed-off-by: Lu Baolu <baolu.lu(a)linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel(a)suse.de>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Tirui Yin <yintirui(a)huawei.com>
Reviewed-by: Chen Jun <chenjun102(a)huawei.com>
---
drivers/iommu/intel/dmar.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 9e591594183e..fde7eb3d8103 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1204,9 +1204,7 @@ static void free_iommu(struct intel_iommu *iommu)
*/
static inline void reclaim_free_desc(struct q_inval *qi)
{
- while (qi->desc_status[qi->free_tail] == QI_DONE ||
- qi->desc_status[qi->free_tail] == QI_ABORT) {
- qi->desc_status[qi->free_tail] = QI_FREE;
+ while (qi->desc_status[qi->free_tail] == QI_FREE && qi->free_tail != qi->free_head) {
qi->free_tail = (qi->free_tail + 1) % QI_LENGTH;
qi->free_cnt++;
}
@@ -1361,8 +1359,16 @@ int qi_submit_sync(struct intel_iommu *iommu, struct qi_desc *desc,
raw_spin_lock(&qi->q_lock);
}
- for (i = 0; i < count; i++)
- qi->desc_status[(index + i) % QI_LENGTH] = QI_DONE;
+ /*
+ * The reclaim code can free descriptors from multiple submissions
+ * starting from the tail of the queue. When count == 0, the
+ * status of the standalone wait descriptor at the tail of the queue
+ * must be set to QI_FREE to allow the reclaim code to proceed.
+ * It is also possible that descriptors from one of the previous
+ * submissions has to be reclaimed by a subsequent submission.
+ */
+ for (i = 0; i <= count; i++)
+ qi->desc_status[(index + i) % QI_LENGTH] = QI_FREE;
reclaim_free_desc(qi);
raw_spin_unlock_irqrestore(&qi->q_lock, flags);
--
2.17.1
From: Sanjay K Kumar <sanjay.k.kumar(a)intel.com>
stable inclusion
from stable-v5.10.227
commit de9e7f68762585f7532de8a06de9485bf39dbd38
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRAV
CVE: CVE-2024-49993
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 3cf74230c139f208b7fb313ae0054386eee31a81 ]
If qi_submit_sync() is invoked with 0 invalidation descriptors (for
instance, for DMA draining purposes), we can run into a bug where a
submitting thread fails to detect the completion of invalidation_wait.
Subsequently, this led to a soft lockup. Currently, there is no impact
by this bug on the existing users because no callers are submitting
invalidations with 0 descriptors. This fix will enable future users
(such as DMA drain) calling qi_submit_sync() with 0 count.
Suppose thread T1 invokes qi_submit_sync() with non-zero descriptors, while
concurrently, thread T2 calls qi_submit_sync() with zero descriptors. Both
threads then enter a while loop, waiting for their respective descriptors
to complete. T1 detects its completion (i.e., T1's invalidation_wait status
changes to QI_DONE by HW) and proceeds to call reclaim_free_desc() to
reclaim all descriptors, potentially including adjacent ones of other
threads that are also marked as QI_DONE.
During this time, while T2 is waiting to acquire the qi->q_lock, the IOMMU
hardware may complete the invalidation for T2, setting its status to
QI_DONE. However, if T1's execution of reclaim_free_desc() frees T2's
invalidation_wait descriptor and changes its status to QI_FREE, T2 will
not observe the QI_DONE status for its invalidation_wait and will
indefinitely remain stuck.
This soft lockup does not occur when only non-zero descriptors are
submitted.In such cases, invalidation descriptors are interspersed among
wait descriptors with the status QI_IN_USE, acting as barriers. These
barriers prevent the reclaim code from mistakenly freeing descriptors
belonging to other submitters.
Considered the following example timeline:
T1 T2
========================================
ID1
WD1
while(WD1!=QI_DONE)
unlock
lock
WD1=QI_DONE* WD2
while(WD2!=QI_DONE)
unlock
lock
WD1==QI_DONE?
ID1=QI_DONE WD2=DONE*
reclaim()
ID1=FREE
WD1=FREE
WD2=FREE
unlock
soft lockup! T2 never sees QI_DONE in WD2
Where:
ID = invalidation descriptor
WD = wait descriptor
* Written by hardware
The root of the problem is that the descriptor status QI_DONE flag is used
for two conflicting purposes:
1. signal a descriptor is ready for reclaim (to be freed)
2. signal by the hardware that a wait descriptor is complete
The solution (in this patch) is state separation by using QI_FREE flag
for #1.
Once a thread's invalidation descriptors are complete, their status would
be set to QI_FREE. The reclaim_free_desc() function would then only
free descriptors marked as QI_FREE instead of those marked as
QI_DONE. This change ensures that T2 (from the previous example) will
correctly observe the completion of its invalidation_wait (marked as
QI_DONE).
Signed-off-by: Sanjay K Kumar <sanjay.k.kumar(a)intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan(a)linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian(a)intel.com>
Link: https://lore.kernel.org/r/20240728210059.1964602-1-jacob.jun.pan@linux.inte…
Signed-off-by: Lu Baolu <baolu.lu(a)linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel(a)suse.de>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Tirui Yin <yintirui(a)huawei.com>
---
drivers/iommu/intel/dmar.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 067e16944a7e..c2af96eb633f 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1203,9 +1203,7 @@ static void free_iommu(struct intel_iommu *iommu)
*/
static inline void reclaim_free_desc(struct q_inval *qi)
{
- while (qi->desc_status[qi->free_tail] == QI_DONE ||
- qi->desc_status[qi->free_tail] == QI_ABORT) {
- qi->desc_status[qi->free_tail] = QI_FREE;
+ while (qi->desc_status[qi->free_tail] == QI_FREE && qi->free_tail != qi->free_head) {
qi->free_tail = (qi->free_tail + 1) % QI_LENGTH;
qi->free_cnt++;
}
@@ -1360,8 +1358,16 @@ int qi_submit_sync(struct intel_iommu *iommu, struct qi_desc *desc,
raw_spin_lock(&qi->q_lock);
}
- for (i = 0; i < count; i++)
- qi->desc_status[(index + i) % QI_LENGTH] = QI_DONE;
+ /*
+ * The reclaim code can free descriptors from multiple submissions
+ * starting from the tail of the queue. When count == 0, the
+ * status of the standalone wait descriptor at the tail of the queue
+ * must be set to QI_FREE to allow the reclaim code to proceed.
+ * It is also possible that descriptors from one of the previous
+ * submissions has to be reclaimed by a subsequent submission.
+ */
+ for (i = 0; i <= count; i++)
+ qi->desc_status[(index + i) % QI_LENGTH] = QI_FREE;
reclaim_free_desc(qi);
raw_spin_unlock_irqrestore(&qi->q_lock, flags);
--
2.17.1
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 020e0507954f21291b7b3a0a280128270a0d8959
commit: 23b8024ef459f8b615c223df6175ea17c6b50c48 [2516/2516] drivers: update yunsilicon drivers to version 1.1.0.375
config: x86_64-randconfig-r063-20241203 (https://download.01.org/0day-ci/archive/20241203/202412031055.Ln9fvImq-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241203/202412031055.Ln9fvImq-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/202412031055.Ln9fvImq-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/net/ethernet/yunsilicon/xsc/pci/main.c:6:
In file included from drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h:11:
In file included from include/linux/pci.h:1499:
In file included from include/linux/dmapool.h:14:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:1579:
include/linux/vmstat.h:417:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
417 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
418 | item];
| ~~~~
include/linux/vmstat.h:424:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
424 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
425 | NR_VM_NUMA_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:436:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
436 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
437 | NR_VM_NUMA_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:445:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
445 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
446 | NR_VM_NUMA_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/ethernet/yunsilicon/xsc/pci/main.c:6:
drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h:1752:32: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
1752 | if (dev->caps.hw_feature_flag | XSC_HW_RDMA_SUPPORT)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/ethernet/yunsilicon/xsc/pci/main.c:13:
In file included from drivers/net/ethernet/yunsilicon/xsc/pci/devlink.h:9:
include/net/devlink.h:28:19: warning: arithmetic between different enumeration types ('enum devlink_reload_limit' and 'enum devlink_reload_action') [-Wenum-enum-conversion]
28 | u32 reload_stats[DEVLINK_RELOAD_STATS_ARRAY_SIZE];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/devlink.h:25:30: note: expanded from macro 'DEVLINK_RELOAD_STATS_ARRAY_SIZE'
25 | (__DEVLINK_RELOAD_LIMIT_MAX * __DEVLINK_RELOAD_ACTION_MAX)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/devlink.h:29:26: warning: arithmetic between different enumeration types ('enum devlink_reload_limit' and 'enum devlink_reload_action') [-Wenum-enum-conversion]
29 | u32 remote_reload_stats[DEVLINK_RELOAD_STATS_ARRAY_SIZE];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/devlink.h:25:30: note: expanded from macro 'DEVLINK_RELOAD_STATS_ARRAY_SIZE'
25 | (__DEVLINK_RELOAD_LIMIT_MAX * __DEVLINK_RELOAD_ACTION_MAX)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:136:4: warning: no previous prototype for function 'xsc_devid_to_pcie_no' [-Wmissing-prototypes]
136 | u8 xsc_devid_to_pcie_no(int dev_id)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:136:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
136 | u8 xsc_devid_to_pcie_no(int dev_id)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:288:5: warning: no previous prototype for function 'xsc_priv_init' [-Wmissing-prototypes]
288 | int xsc_priv_init(struct xsc_core_device *dev)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:288:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
288 | int xsc_priv_init(struct xsc_core_device *dev)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:302:5: warning: no previous prototype for function 'xsc_dev_res_init' [-Wmissing-prototypes]
302 | int xsc_dev_res_init(struct xsc_core_device *dev)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:302:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
302 | int xsc_dev_res_init(struct xsc_core_device *dev)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:321:6: warning: no previous prototype for function 'xsc_dev_res_cleanup' [-Wmissing-prototypes]
321 | void xsc_dev_res_cleanup(struct xsc_core_device *dev)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:321:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
321 | void xsc_dev_res_cleanup(struct xsc_core_device *dev)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:327:6: warning: no previous prototype for function 'xsc_init_reg_addr' [-Wmissing-prototypes]
327 | void xsc_init_reg_addr(struct xsc_core_device *dev)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:327:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
327 | void xsc_init_reg_addr(struct xsc_core_device *dev)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:519:5: warning: no previous prototype for function 'xsc_reset_function_resource' [-Wmissing-prototypes]
519 | int xsc_reset_function_resource(struct xsc_core_device *dev)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:519:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
519 | int xsc_reset_function_resource(struct xsc_core_device *dev)
| ^
| static
>> drivers/net/ethernet/yunsilicon/xsc/pci/main.c:613:19: error: no member named 'physfn' in 'struct pci_dev'
613 | if (!dev->pdev->physfn) {
| ~~~~~~~~~ ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:719:5: warning: no previous prototype for function 'xsc_load_one' [-Wmissing-prototypes]
719 | int xsc_load_one(struct xsc_core_device *dev, bool boot)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:719:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
719 | int xsc_load_one(struct xsc_core_device *dev, bool boot)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:801:5: warning: no previous prototype for function 'xsc_unload_one' [-Wmissing-prototypes]
801 | int xsc_unload_one(struct xsc_core_device *dev, bool cleanup)
| ^
drivers/net/ethernet/yunsilicon/xsc/pci/main.c:801:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
801 | int xsc_unload_one(struct xsc_core_device *dev, bool cleanup)
| ^
| static
16 warnings and 1 error generated.
--
In file included from drivers/net/ethernet/yunsilicon/xsc/pci/xsc_port_ctrl.c:10:
In file included from include/linux/mm.h:1579:
include/linux/vmstat.h:417:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
417 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
418 | item];
| ~~~~
include/linux/vmstat.h:424:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
424 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
425 | NR_VM_NUMA_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:436:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
436 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
437 | NR_VM_NUMA_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:445:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
445 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
446 | NR_VM_NUMA_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/ethernet/yunsilicon/xsc/pci/xsc_port_ctrl.c:12:
drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h:1752:32: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
1752 | if (dev->caps.hw_feature_flag | XSC_HW_RDMA_SUPPORT)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/yunsilicon/xsc/pci/xsc_port_ctrl.c:440:18: error: no member named 'physfn' in 'struct pci_dev'
440 | if (!dev->pdev->physfn) /*for vf passthrough vm*/
| ~~~~~~~~~ ^
drivers/net/ethernet/yunsilicon/xsc/pci/xsc_port_ctrl.c:443:38: error: no member named 'physfn' in 'struct pci_dev'
443 | pf_dev = pci_get_drvdata(dev->pdev->physfn);
| ~~~~~~~~~ ^
6 warnings and 2 errors generated.
vim +613 drivers/net/ethernet/yunsilicon/xsc/pci/main.c
518
> 519 int xsc_reset_function_resource(struct xsc_core_device *dev)
520 {
521 struct xsc_function_reset_mbox_in in;
522 struct xsc_function_reset_mbox_out out;
523 int err;
524
525 memset(&in, 0, sizeof(in));
526 in.hdr.opcode = cpu_to_be16(XSC_CMD_OP_FUNCTION_RESET);
527 in.glb_func_id = cpu_to_be16(dev->glb_func_id);
528 err = xsc_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
529 if (err || out.hdr.status)
530 return -EINVAL;
531
532 return 0;
533 }
534
535 static int xsc_fpga_not_supported(struct xsc_core_device *dev)
536 {
537 #define FPGA_VERSION_H 0x100
538 u32 ver_h;
539
540 if (!xsc_core_is_pf(dev))
541 return 0;
542
543 ver_h = REG_RD32(dev, HIF_CPM_CHIP_VERSION_H_REG_ADDR);
544 if (ver_h != FPGA_VERSION_H) {
545 xsc_core_err(dev, "fpga version 0x%x not supported\n", ver_h);
546 return 1;
547 }
548
549 return 0;
550 }
551
552 static int xsc_init_once(struct xsc_core_device *dev)
553 {
554 int err;
555
556 #ifndef COSIM
557 err = xsc_cmd_init(dev);
558 if (err) {
559 xsc_core_err(dev, "Failed initializing command interface, aborting\n");
560 goto err_cmd_init;
561 }
562 #endif
563 #ifdef RUN_WITH_PSV
564 err = xsc_cmd_query_psv_funcid(dev, &dev->caps);
565 if (err) {
566 xsc_core_err(dev, "Failed to query psv funcid, err=%d\n", err);
567 goto err_cmdq_ver_chk;
568 }
569
570 dev->glb_func_id = xsc_get_glb_func_id(dev);
571 #endif
572
573 err = xsc_check_cmdq_version(dev);
574 if (err) {
575 xsc_core_err(dev, "Failed to check cmdq version\n");
576 goto err_cmdq_ver_chk;
577 }
578
579 err = xsc_cmd_query_hca_cap(dev, &dev->caps);
580 if (err) {
581 xsc_core_err(dev, "Failed to query hca, err=%d\n", err);
582 goto err_cmdq_ver_chk;
583 }
584
585 err = xsc_reset_function_resource(dev);
586 if (err) {
587 xsc_core_err(dev, "Failed to reset function resource\n");
588 goto err_cmdq_ver_chk;
589 }
590
591 err = xsc_get_board_id(dev);
592 if (err) {
593 xsc_core_err(dev, "Failed to get board id, err=%d\n", err);
594 goto err_cmdq_ver_chk;
595 }
596 if (xsc_core_is_pf(dev)) {
597 err = xsc_pci_calc_pf_port(dev);
598 if (err) {
599 xsc_core_err(dev, "Failed to xsc_pci_calc_pf_port\n");
600 goto err_cmdq_ver_chk;
601 }
602 err = xsc_create_res(dev);
603 if (err) {
604 xsc_core_err(dev, "Failed to create resource, err=%d\n", err);
605 goto err_cmdq_ver_chk;
606 }
607 } else {
608 err = xsc_pci_calc_vf_port(dev);
609 if (err) {
610 xsc_core_err(dev, "Failed to xsc_pci_calc_vf_port\n");
611 goto err_cmdq_ver_chk;
612 }
> 613 if (!dev->pdev->physfn) {
614 err = xsc_create_res(dev);
615 if (err) {
616 xsc_core_err(dev, "Failed to create resource, err=%d\n", err);
617 goto err_cmdq_ver_chk;
618 }
619 }
620 }
621
622 xsc_init_cq_table(dev);
623 xsc_init_qp_table(dev);
624 xsc_eq_init(dev);
625
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi Ma,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 929a9df37c1b7dec73fd417d79a116d02a8f9380
commit: f43933b3f947a7f9314ec8d704c6ae01041dbbba [2439/2439] arm64: cpufeature: Enable PBHA for stage1 early via FDT
config: arm64-randconfig-004-20241117 (https://download.01.org/0day-ci/archive/20241203/202412031005.m61DNVfj-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241203/202412031005.m61DNVfj-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/202412031005.m61DNVfj-lkp@intel.com/
Note: functions only called from assembly code should be annotated with the asmlinkage attribute
All warnings (new ones prefixed by >>):
arch/arm64/kernel/cpufeature.c:1627:6: warning: no previous prototype for 'update_pbha_perf_only_bit' [-Wmissing-prototypes]
1627 | void update_pbha_perf_only_bit(const u8 *bits, int cnt)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/arm64/kernel/cpufeature.c:1729:13: warning: no previous prototype for 'early_pbha_init' [-Wmissing-prototypes]
1729 | void __init early_pbha_init(void)
| ^~~~~~~~~~~~~~~
vim +/early_pbha_init +1729 arch/arm64/kernel/cpufeature.c
1728
> 1729 void __init early_pbha_init(void)
1730 {
1731 void *fdt;
1732 int node;
1733 const u8 *prop;
1734 int size;
1735
1736 spin_lock(&pbha_dt_lock);
1737
1738 fdt = get_early_fdt_ptr();
1739 if (!fdt)
1740 goto unlock;
1741
1742 node = fdt_path_offset(fdt, "/cpus");
1743 if (node < 0)
1744 goto unlock;
1745
1746 prop = fdt_getprop(fdt, node, "arm,pbha-performance-only", &size);
1747 if (!prop)
1748 goto unlock;
1749
1750 if (!cpu_has_pbha())
1751 goto unlock;
1752
1753 update_pbha_perf_only_bit(prop, size);
1754 enable_pbha_inner();
1755
1756 pbha_enabled = true;
1757
1758 unlock:
1759 spin_unlock(&pbha_dt_lock);
1760 }
1761
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki