mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • 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
kernel@openeuler.org

  • 44 participants
  • 18219 discussions
[PATCH OLK-5.10] HID: core: zero-initialize the report buffer
by Tirui Yin 04 Dec '24

04 Dec '24
From: Jiri Kosina <jkosina(a)suse.com> stable inclusion from stable-v5.10.230 commit d7dc68d82ab3fcfc3f65322465da3d7031d4ab46 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB5AVT CVE: CVE-2024-50302 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 177f25d1292c7e16e1199b39c85480f7f8815552 ] Since the report buffer is used by all kinds of drivers in various ways, let's zero-initialize it during allocation to make sure that it can't be ever used to leak kernel memory via specially-crafted report. Fixes: 27ce405039bf ("HID: fix data access in implement()") Reported-by: Benoît Sevens <bsevens(a)google.com> Acked-by: Benjamin Tissoires <bentiss(a)kernel.org> Signed-off-by: Jiri Kosina <jkosina(a)suse.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Tirui Yin <yintirui(a)huawei.com> Reviewed-by: yongqiang Liu <liuyongqiang13(a)huawei.com> --- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 5281d693b32d..0fef4bdb90f1 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1664,7 +1664,7 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags) u32 len = hid_report_len(report) + 7; - return kmalloc(len, flags); + return kzalloc(len, flags); } EXPORT_SYMBOL_GPL(hid_alloc_report_buf); -- 2.17.1
2 1
0 0
[OLK-5.10] HID: core: zero-initialize the report buffer
by Tirui Yin 04 Dec '24

04 Dec '24
From: Jiri Kosina <jkosina(a)suse.com> stable inclusion from stable-v5.10.230 commit d7dc68d82ab3fcfc3f65322465da3d7031d4ab46 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB5AVT CVE: CVE-2024-50302 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 177f25d1292c7e16e1199b39c85480f7f8815552 ] Since the report buffer is used by all kinds of drivers in various ways, let's zero-initialize it during allocation to make sure that it can't be ever used to leak kernel memory via specially-crafted report. Fixes: 27ce405039bf ("HID: fix data access in implement()") Reported-by: Benoît Sevens <bsevens(a)google.com> Acked-by: Benjamin Tissoires <bentiss(a)kernel.org> Signed-off-by: Jiri Kosina <jkosina(a)suse.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Tirui Yin <yintirui(a)huawei.com> Reviewed-by: yongqiang Liu <liuyongqiang13(a)huawei.com> --- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 5281d693b32d..0fef4bdb90f1 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1664,7 +1664,7 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags) u32 len = hid_report_len(report) + 7; - return kmalloc(len, flags); + return kzalloc(len, flags); } EXPORT_SYMBOL_GPL(hid_alloc_report_buf); -- 2.17.1
1 0
0 0
[openEuler-22.03-LTS-SP1] vp_vdpa: fix id_table array not null terminated error
by liukai 04 Dec '24

04 Dec '24
From: Xiaoguang Wang <lege.wang(a)jaguarmicro.com> stable inclusion from stable-v6.1.119 commit 870d68fe17b5d9032049dcad98b5781a344a8657 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB8IUJ CVE: CVE-2024-53110 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- commit 4e39ecadf1d2a08187139619f1f314b64ba7d947 upstream. Allocate one extra virtio_device_id as null terminator, otherwise vdpa_mgmtdev_get_classes() may iterate multiple times and visit undefined memory. Fixes: ffbda8e9df10 ("vdpa/vp_vdpa : add vdpa tool support in vp_vdpa") Cc: stable(a)vger.kernel.org Suggested-by: Parav Pandit <parav(a)nvidia.com> Signed-off-by: Angus Chen <angus.chen(a)jaguarmicro.com> Signed-off-by: Xiaoguang Wang <lege.wang(a)jaguarmicro.com> Message-Id: <20241105133518.1494-1-lege.wang(a)jaguarmicro.com> Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com> Reviewed-by: Parav Pandit <parav(a)nvidia.com> Acked-by: Jason Wang <jasowang(a)redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org> Signed-off-by: Liu Kai <liukai284(a)huawei.com> --- drivers/vdpa/virtio_pci/vp_vdpa.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c index bc0bdcc7bcea..4e513a38df60 100644 --- a/drivers/vdpa/virtio_pci/vp_vdpa.c +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c @@ -574,7 +574,11 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto mdev_err; } - mdev_id = kzalloc(sizeof(struct virtio_device_id), GFP_KERNEL); + /* + * id_table should be a null terminated array, so allocate one additional + * entry here, see vdpa_mgmtdev_get_classes(). + */ + mdev_id = kcalloc(2, sizeof(struct virtio_device_id), GFP_KERNEL); if (!mdev_id) { err = -ENOMEM; goto mdev_id_err; @@ -594,8 +598,8 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto probe_err; } - mdev_id->device = mdev->id.device; - mdev_id->vendor = mdev->id.vendor; + mdev_id[0].device = mdev->id.device; + mdev_id[0].vendor = mdev->id.vendor; mgtdev->id_table = mdev_id; mgtdev->max_supported_vqs = vp_modern_get_num_queues(mdev); mgtdev->supported_features = vp_modern_get_features(mdev); -- 2.34.1
1 0
0 0
[openeuler:OLK-6.6 1584/1584] drivers/ata/ahci_zhaoxin_sgpio.c:31:5: warning: no previous prototype for function 'ahci_wait_em_reset'
by kernel test robot 04 Dec '24

04 Dec '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 8a512be8da229a21f36ac0a0253414f2fb9ac174 commit: fb43492008c11fe89e510dd63383a2d37ea3cf8e [1584/1584] ata: ahci: Add support for AHCI SGPIO Enclosure Management config: x86_64-buildonly-randconfig-006 (https://download.01.org/0day-ci/archive/20241204/202412041754.ZiNZbWX3-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/20241204/202412041754.ZiNZbWX3-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/202412041754.ZiNZbWX3-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from drivers/ata/ahci_zhaoxin_sgpio.c:10: In file included from include/linux/blkdev.h:9: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:8: In file included from include/linux/cacheflush.h:5: In file included from arch/x86/include/asm/cacheflush.h:5: In file included from include/linux/mm.h:2235: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 537 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ >> drivers/ata/ahci_zhaoxin_sgpio.c:31:5: warning: no previous prototype for function 'ahci_wait_em_reset' [-Wmissing-prototypes] 31 | int ahci_wait_em_reset(struct sgpio_zhaoxin *sgpio_zhaoxin, u32 retry) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:31:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 31 | int ahci_wait_em_reset(struct sgpio_zhaoxin *sgpio_zhaoxin, u32 retry) | ^ | static >> drivers/ata/ahci_zhaoxin_sgpio.c:55:6: warning: no previous prototype for function 'ahci_zhaoxin_set_em_sgpio' [-Wmissing-prototypes] 55 | void ahci_zhaoxin_set_em_sgpio(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:55:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 55 | void ahci_zhaoxin_set_em_sgpio(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ | static >> drivers/ata/ahci_zhaoxin_sgpio.c:99:6: warning: no previous prototype for function 'ahci_zhaoxin_set_em_sgpio_gpmode' [-Wmissing-prototypes] 99 | void ahci_zhaoxin_set_em_sgpio_gpmode(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:99:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 99 | void ahci_zhaoxin_set_em_sgpio_gpmode(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ | static >> drivers/ata/ahci_zhaoxin_sgpio.c:601:6: warning: no previous prototype for function 'set_em_messages' [-Wmissing-prototypes] 601 | void set_em_messages(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:601:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 601 | void set_em_messages(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ | static >> drivers/ata/ahci_zhaoxin_sgpio.c:621:5: warning: no previous prototype for function 'add_sgpio_zhaoxin' [-Wmissing-prototypes] 621 | int add_sgpio_zhaoxin(void) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:621:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 621 | int add_sgpio_zhaoxin(void) | ^ | static >> drivers/ata/ahci_zhaoxin_sgpio.c:673:6: warning: no previous prototype for function 'remove_sgpio_zhaoxin' [-Wmissing-prototypes] 673 | void remove_sgpio_zhaoxin(void) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:673:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 673 | void remove_sgpio_zhaoxin(void) | ^ | static 11 warnings generated. vim +/ahci_wait_em_reset +31 drivers/ata/ahci_zhaoxin_sgpio.c 25 26 static unsigned int zhaoxin_em_type __read_mostly = AHCI_EM_MSG_LED_MODE; /*LED protocol*/ 27 module_param(zhaoxin_em_type, int, 0644); 28 MODULE_PARM_DESC(zhaoxin_em_type, 29 "AHCI Enclosure Management Message type control (1 = led on, 2 = sgpio on,3 = sgpio gp on)"); 30 > 31 int ahci_wait_em_reset(struct sgpio_zhaoxin *sgpio_zhaoxin, u32 retry) 32 { 33 void __iomem *mmio = sgpio_zhaoxin->mmio; 34 u32 em_ctl; 35 36 if (!sgpio_zhaoxin || retry == 0) { 37 pr_err("In ahci wait em reset, invalid param\n"); 38 return -EINVAL; 39 } 40 41 while (retry--) { /*EM_CTL needs reset at least 64ms*/ 42 em_ctl = readl(mmio + HOST_EM_CTL); 43 if (em_ctl & EM_CTL_RST) 44 usleep_range(10000, 20000); /*EM_CTL still in reset, usleep 10ms*/ 45 else 46 break; 47 48 if (!retry) 49 pr_err("Wait for EM_CTL reset, time out\n"); 50 } 51 52 return 0; 53 } 54 > 55 void ahci_zhaoxin_set_em_sgpio(struct sgpio_zhaoxin *sgpio_zhaoxin) 56 { 57 void __iomem *mmio = sgpio_zhaoxin->mmio; 58 void __iomem *em_mmio = mmio + SGPIO_OFFSET; 59 60 u32 read; 61 62 sgpio_zhaoxin->sgpio_reg.cfg_0.enable = 1; 63 64 sgpio_zhaoxin->sgpio_reg.cfg_1.blink_gen_a = 0x7; 65 sgpio_zhaoxin->sgpio_reg.cfg_1.blink_gen_b = 0x3; 66 sgpio_zhaoxin->sgpio_reg.cfg_1.blink_gen_c = 0x0; 67 sgpio_zhaoxin->sgpio_reg.cfg_1.stretch_act_on = 0; 68 sgpio_zhaoxin->sgpio_reg.cfg_1.stretch_act_off = 0; 69 sgpio_zhaoxin->sgpio_reg.cfg_1.max_act_on = 2; 70 sgpio_zhaoxin->sgpio_reg.cfg_1.force_act_off = 1; 71 72 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sload = 0xf; 73 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.count = 0x0; 74 75 sgpio_zhaoxin->sgpio_reg.transmit_0.sgpio_tx_0 = 0; 76 sgpio_zhaoxin->sgpio_reg.transmit_1.sgpio_tx_1 = 0; 77 sgpio_zhaoxin->sgpio_reg.gp_transmit_reg.sgpio_tx_gp = 0; 78 79 sgpio_zhaoxin->sgpio_reg.receive_reg.sgpio_rx = 0x07070707; 80 sgpio_zhaoxin->sgpio_reg.gp_receive_reg.sgpio_rx_gp = 0; 81 82 /*Setup SGPIO type*/ 83 read = readl(mmio + sgpio_zhaoxin->em_loc); 84 read = read | SGPIO_MESSAGE_HEAD; /*LED register MSG_HEAD, select SGPIO*/ 85 writel(read, mmio + sgpio_zhaoxin->em_loc); 86 87 /*Setup gp mode*/ 88 writel(sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sgpio_tx_gp_cfg, em_mmio + 0x38); 89 90 /*Initial SGPIO CFG1*/ 91 writel(sgpio_zhaoxin->sgpio_reg.cfg_1.sgpio_cfg_1, em_mmio + 0x4); 92 93 /*Initial SGPIO CFG0*/ 94 read = readl(em_mmio); 95 read |= sgpio_zhaoxin->sgpio_reg.cfg_0.sgpio_cfg_0; 96 writel(read, em_mmio); 97 } 98 > 99 void ahci_zhaoxin_set_em_sgpio_gpmode(struct sgpio_zhaoxin *sgpio_zhaoxin) 100 { 101 void __iomem *mmio = sgpio_zhaoxin->mmio; 102 void __iomem *em_mmio = mmio + SGPIO_OFFSET; 103 u32 read; 104 105 sgpio_zhaoxin->sgpio_reg.cfg_0.enable = 1; 106 107 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sload = 0xf; 108 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.count = 0xff; 109 110 sgpio_zhaoxin->sgpio_reg.transmit_0.sgpio_tx_0 = 0; 111 sgpio_zhaoxin->sgpio_reg.transmit_1.sgpio_tx_1 = 0; 112 sgpio_zhaoxin->sgpio_reg.gp_transmit_reg.sgpio_tx_gp = 0; 113 114 sgpio_zhaoxin->sgpio_reg.receive_reg.sgpio_rx = 0; 115 sgpio_zhaoxin->sgpio_reg.gp_receive_reg.sgpio_rx_gp = 0xff0f0000; 116 117 /*Setup SGPIO type*/ 118 read = readl(mmio + sgpio_zhaoxin->em_loc); 119 read |= SGPIO_MESSAGE_HEAD; 120 writel(read, mmio + sgpio_zhaoxin->em_loc); 121 122 /*Setup gp mode*/ 123 writel(sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sgpio_tx_gp_cfg, em_mmio + 0x38); 124 125 /*Enable SGPIO*/ 126 writel(sgpio_zhaoxin->sgpio_reg.cfg_0.sgpio_cfg_0, em_mmio); 127 } 128 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-5.10 2439/2439] include/linux/compiler_attributes.h:221:41: warning: attribute 'fallthrough' not preceding a case label or default label
by kernel test robot 04 Dec '24

04 Dec '24
Hi Ze, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: b61a367ade32ff42d5f3066b9750e855dc98dd29 commit: 0695e18bbaebbfbe22b049104bbb9a4300a9f30c [2439/2439] mm: Add PMU based memory sampling abstract layer config: arm64-randconfig-004-20241117 (https://download.01.org/0day-ci/archive/20241204/202412041721.uYCyd8sz-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241204/202412041721.uYCyd8sz-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/202412041721.uYCyd8sz-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from include/linux/compiler_types.h:65, from <command-line>: drivers/arm/spe/spe.c: In function '__arm_spe_dev_probe': >> include/linux/compiler_attributes.h:221:41: warning: attribute 'fallthrough' not preceding a case label or default label 221 | # define fallthrough __attribute__((__fallthrough__)) | ^~~~~~~~~~~~~ drivers/arm/spe/spe.c:492:17: note: in expansion of macro 'fallthrough' 492 | fallthrough; | ^~~~~~~~~~~ >> include/linux/compiler_attributes.h:221:41: warning: attribute 'fallthrough' not preceding a case label or default label 221 | # define fallthrough __attribute__((__fallthrough__)) | ^~~~~~~~~~~~~ drivers/arm/spe/spe.c:514:17: note: in expansion of macro 'fallthrough' 514 | fallthrough; | ^~~~~~~~~~~ Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for ARM_SPE_MEM_SAMPLING Depends on [n]: ARM64 [=y] && !ARM_SPE_PMU [=y] Selected by [y]: - MEM_SAMPLING [=y] && ARM64 [=y] vim +/fallthrough +221 include/linux/compiler_attributes.h 294f69e662d157 Joe Perches 2019-10-05 209 294f69e662d157 Joe Perches 2019-10-05 210 /* 294f69e662d157 Joe Perches 2019-10-05 211 * Add the pseudo keyword 'fallthrough' so case statement blocks 294f69e662d157 Joe Perches 2019-10-05 212 * must end with any of these keywords: 294f69e662d157 Joe Perches 2019-10-05 213 * break; 294f69e662d157 Joe Perches 2019-10-05 214 * fallthrough; 294f69e662d157 Joe Perches 2019-10-05 215 * goto <label>; 294f69e662d157 Joe Perches 2019-10-05 216 * return [expression]; 294f69e662d157 Joe Perches 2019-10-05 217 * 294f69e662d157 Joe Perches 2019-10-05 218 * gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attr… 294f69e662d157 Joe Perches 2019-10-05 219 */ 294f69e662d157 Joe Perches 2019-10-05 220 #if __has_attribute(__fallthrough__) 294f69e662d157 Joe Perches 2019-10-05 @221 # define fallthrough __attribute__((__fallthrough__)) 294f69e662d157 Joe Perches 2019-10-05 222 #else 294f69e662d157 Joe Perches 2019-10-05 223 # define fallthrough do {} while (0) /* fallthrough */ a3f8a30f3f0079 Miguel Ojeda 2018-08-30 224 #endif a3f8a30f3f0079 Miguel Ojeda 2018-08-30 225 :::::: The code at line 221 was first introduced by commit :::::: 294f69e662d1570703e9b56e95be37a9fd3afba5 compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use :::::: TO: Joe Perches <joe(a)perches.com> :::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-5.10 2516/2516] drivers/ub/urma/ubcore/ubcore_netdev.c:213:5: warning: no previous prototype for 'ubcore_unset_port_netdev'
by kernel test robot 04 Dec '24

04 Dec '24
Hi Yizhen, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: b71af6f00ede58be00cb7306c9acb2660ec90947 commit: 37c6170f742ef3a18a3131a2a157dd7b7aa08103 [2516/2516] ub: Fix bugs in urma kernel and user lib config: arm64-randconfig-003-20241203 (https://download.01.org/0day-ci/archive/20241204/202412041601.Eu6aB1G8-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241204/202412041601.Eu6aB1G8-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/202412041601.Eu6aB1G8-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/ub/urma/ubcore/ubcore_netdev.c:51:5: warning: no previous prototype for 'ubcore_check_port_state' [-Wmissing-prototypes] 51 | int ubcore_check_port_state(struct ubcore_device *dev, uint8_t port_idx) | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:75:6: warning: no previous prototype for 'ubcore_find_port_netdev' [-Wmissing-prototypes] 75 | void ubcore_find_port_netdev(struct ubcore_device *dev, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:133:5: warning: no previous prototype for 'ubcore_set_port_netdev' [-Wmissing-prototypes] 133 | int ubcore_set_port_netdev(struct ubcore_device *dev, struct net_device *ndev, | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/ub/urma/ubcore/ubcore_netdev.c:213:5: warning: no previous prototype for 'ubcore_unset_port_netdev' [-Wmissing-prototypes] 213 | int ubcore_unset_port_netdev(struct ubcore_device *dev, struct net_device *ndev, | ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:242:6: warning: no previous prototype for 'ubcore_put_port_netdev' [-Wmissing-prototypes] 242 | void ubcore_put_port_netdev(struct ubcore_device *dev) | ^~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:262:10: warning: no previous prototype for 'ubcore_sip_idx_alloc' [-Wmissing-prototypes] 262 | uint32_t ubcore_sip_idx_alloc(uint32_t idx) | ^~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:290:5: warning: no previous prototype for 'ubcore_sip_idx_free' [-Wmissing-prototypes] 290 | int ubcore_sip_idx_free(uint32_t idx) | ^~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:303:6: warning: no previous prototype for 'ubcore_sip_table_init' [-Wmissing-prototypes] 303 | void ubcore_sip_table_init(void) | ^~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:309:6: warning: no previous prototype for 'ubcore_sip_table_uninit' [-Wmissing-prototypes] 309 | void ubcore_sip_table_uninit(void) | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:324:5: warning: no previous prototype for 'ubcore_add_sip_entry' [-Wmissing-prototypes] 324 | int ubcore_add_sip_entry(const struct ubcore_sip_info *sip, uint32_t idx) | ^~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:344:5: warning: no previous prototype for 'ubcore_del_sip_entry' [-Wmissing-prototypes] 344 | int ubcore_del_sip_entry(uint32_t idx) | ^~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:358:5: warning: no previous prototype for 'ubcore_lookup_sip_idx' [-Wmissing-prototypes] 358 | int ubcore_lookup_sip_idx(struct ubcore_sip_info *sip, uint32_t *idx) | ^~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:379:10: warning: no previous prototype for 'ubcore_get_sip_max_cnt' [-Wmissing-prototypes] 379 | uint32_t ubcore_get_sip_max_cnt(void) | ^~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:384:25: warning: no previous prototype for 'ubcore_lookup_sip_info' [-Wmissing-prototypes] 384 | struct ubcore_sip_info *ubcore_lookup_sip_info(uint32_t idx) | ^~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:395:5: warning: no previous prototype for 'ubcore_notify_uvs_del_sip' [-Wmissing-prototypes] 395 | int ubcore_notify_uvs_del_sip(struct ubcore_device *dev, | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/ub/urma/ubcore/ubcore_netdev.c:437:5: warning: no previous prototype for 'ubcore_notify_uvs_add_sip' [-Wmissing-prototypes] 437 | int ubcore_notify_uvs_add_sip(struct ubcore_device *dev, | ^~~~~~~~~~~~~~~~~~~~~~~~~ vim +/ubcore_unset_port_netdev +213 drivers/ub/urma/ubcore/ubcore_netdev.c 212 > 213 int ubcore_unset_port_netdev(struct ubcore_device *dev, struct net_device *ndev, 214 unsigned int port_id) 215 { 216 struct ubcore_ndev_port *port_info; 217 218 if (dev == NULL || ndev == NULL) { 219 ubcore_log_err("invalid input parameter.\n"); 220 return -1; 221 } 222 down_write(&g_port_list_lock); 223 list_for_each_entry(port_info, &dev->port_list, node) { 224 if (port_info->ndev == ndev) { 225 if (ubcore_del_port(port_info, (uint8_t)port_id, dev, ndev) != 0) { 226 up_write(&g_port_list_lock); 227 ubcore_log_err("Failed to do ubcore_del_port"); 228 return -1; 229 } 230 up_write(&g_port_list_lock); 231 return 0; 232 } 233 } 234 up_write(&g_port_list_lock); 235 236 ubcore_log_err("Failed to find and remove ndev:%s dev_name: %s bound port: %u\n", 237 netdev_name(ndev), dev->dev_name, port_id); 238 return -1; 239 } 240 EXPORT_SYMBOL(ubcore_unset_port_netdev); 241 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 1320/1320] arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[2]' is partly outside array bounds of 'struct sk_buff_head[1]'
by kernel test robot 04 Dec '24

04 Dec '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 98beb6bc5000f977169e4f633e450f4e3e9d84d1 commit: 71e217e85c3dff8a9151707ed3afc7b4b054a2d4 [1320/1320] selinux: use kernel linux/socket.h for genheaders and mdp config: arm64-randconfig-002 (https://download.01.org/0day-ci/archive/20241204/202412041542.hMfB2LmU-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241204/202412041542.hMfB2LmU-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/202412041542.hMfB2LmU-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from arch/arm64/include/asm/atomic.h:34, 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/linux/moduleparam.h:7, from net/core/netpoll.c:14: 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_flags' at include/linux/spinlock.h:191:2, inlined from '__raw_spin_lock_irqsave' at include/linux/spinlock_api_smp.h:119:2, inlined from 'refill_skbs' at net/core/netpoll.c:230:2: >> arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[2]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ net/core/netpoll.c: In function 'refill_skbs': net/core/netpoll.c:47:28: note: at offset 20 into object 'skb_pool' of size 24 47 | static struct sk_buff_head skb_pool; | ^~~~~~~~ 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_flags' at include/linux/spinlock.h:191:2, inlined from '__raw_spin_lock_irqsave' at include/linux/spinlock_api_smp.h:119:2, inlined from 'refill_skbs' at net/core/netpoll.c:230:2: >> arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[2]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ net/core/netpoll.c: In function 'refill_skbs': net/core/netpoll.c:47:28: note: at offset 20 into object 'skb_pool' of size 24 47 | static struct sk_buff_head skb_pool; | ^~~~~~~~ In file included from include/linux/if_ether.h:23, from include/uapi/linux/ethtool.h:19, from include/linux/ethtool.h:19, from include/linux/netdevice.h:42, from net/core/netpoll.c:16: In function '__skb_queue_before', inlined from '__skb_queue_tail' at include/linux/skbuff.h:1866:2, inlined from 'refill_skbs' at net/core/netpoll.c:236:3: include/linux/skbuff.h:1832:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds=] 1832 | __skb_insert(newsk, next->prev, next, list); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/core/netpoll.c: In function 'refill_skbs': net/core/netpoll.c:47:28: note: object 'skb_pool' of size 24 47 | static struct sk_buff_head skb_pool; | ^~~~~~~~ In function '__skb_insert', inlined from '__skb_queue_before' at include/linux/skbuff.h:1832:2, inlined from '__skb_queue_tail' at include/linux/skbuff.h:1866:2, inlined from 'refill_skbs' at net/core/netpoll.c:236:3: include/linux/skbuff.h:1726:21: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds=] 1726 | next->prev = prev->next = newsk; | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ net/core/netpoll.c: In function 'refill_skbs': net/core/netpoll.c:47:28: note: object 'skb_pool' of size 24 47 | static struct sk_buff_head skb_pool; | ^~~~~~~~ -- net/ipv4/route.c: In function 'ip_rt_send_redirect': net/ipv4/route.c:866:13: warning: variable 'log_martians' set but not used [-Wunused-but-set-variable] 866 | int log_martians; | ^~~~~~~~~~~~ In file included from arch/arm64/include/asm/atomic.h:34, 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/linux/list.h:9, from include/linux/module.h:10, from net/ipv4/route.c:67: 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_bh' at include/linux/spinlock_api_smp.h:136:2, inlined from 'spin_lock_bh' at include/linux/spinlock.h:334:2, inlined from 'update_or_create_fnhe' at net/ipv4/route.c:648:2: arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'spinlock_t[1]' {aka 'struct spinlock[1]'} [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ In file included from include/linux/spinlock.h:82, from include/linux/seqlock.h:36, from include/linux/time.h:6, from include/linux/stat.h:19, from include/linux/module.h:11: net/ipv4/route.c: In function 'update_or_create_fnhe': net/ipv4/route.c:578:24: note: object 'fnhe_lock' of size 4 578 | static DEFINE_SPINLOCK(fnhe_lock); | ^~~~~~~~~ include/linux/spinlock_types.h:81:44: note: in definition of macro 'DEFINE_SPINLOCK' 81 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | ^ 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_bh' at include/linux/spinlock_api_smp.h:136:2, inlined from 'spin_lock_bh' at include/linux/spinlock.h:334:2, inlined from 'update_or_create_fnhe' at net/ipv4/route.c:648:2: arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'spinlock_t[1]' {aka 'struct spinlock[1]'} [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ net/ipv4/route.c: In function 'update_or_create_fnhe': net/ipv4/route.c:578:24: note: object 'fnhe_lock' of size 4 578 | static DEFINE_SPINLOCK(fnhe_lock); | ^~~~~~~~~ include/linux/spinlock_types.h:81:44: note: in definition of macro 'DEFINE_SPINLOCK' 81 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | ^ net/ipv4/route.c: In function '__ip_rt_update_pmtu': >> net/ipv4/route.c:1027:37: warning: array subscript 0 is outside array bounds of 'struct fib_nh[0]' [-Warray-bounds=] 1027 | struct fib_nh *nh = &FIB_RES_NH(res); In file included from include/net/route.h:31, from include/net/lwtunnel.h:10, from include/net/ip_tunnels.h:18, from include/net/dst_metadata.h:6, from net/ipv4/route.c:94: include/net/ip_fib.h:127:33: note: while referencing 'fib_nh' 127 | struct fib_nh fib_nh[0]; | ^~~~~~ net/ipv4/route.c: In function '__ip_do_redirect': net/ipv4/route.c:779:53: warning: array subscript 0 is outside array bounds of 'struct fib_nh[0]' [-Warray-bounds=] 779 | struct fib_nh *nh = &FIB_RES_NH(res); include/net/ip_fib.h:127:33: note: while referencing 'fib_nh' 127 | struct fib_nh fib_nh[0]; | ^~~~~~ 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_bh' at include/linux/spinlock_api_smp.h:136:2, inlined from 'spin_lock_bh' at include/linux/spinlock.h:334:2, inlined from 'ip_del_fnhe' at net/ipv4/route.c:1326:2: arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'spinlock_t[1]' {aka 'struct spinlock[1]'} [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ net/ipv4/route.c: In function 'ip_del_fnhe': net/ipv4/route.c:578:24: note: object 'fnhe_lock' of size 4 578 | static DEFINE_SPINLOCK(fnhe_lock); | ^~~~~~~~~ include/linux/spinlock_types.h:81:44: note: in definition of macro 'DEFINE_SPINLOCK' 81 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | ^ 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_bh' at include/linux/spinlock_api_smp.h:136:2, inlined from 'spin_lock_bh' at include/linux/spinlock.h:334:2, inlined from 'ip_del_fnhe' at net/ipv4/route.c:1326:2: arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'spinlock_t[1]' {aka 'struct spinlock[1]'} [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ net/ipv4/route.c: In function 'ip_del_fnhe': net/ipv4/route.c:578:24: note: object 'fnhe_lock' of size 4 578 | static DEFINE_SPINLOCK(fnhe_lock); | ^~~~~~~~~ include/linux/spinlock_types.h:81:44: note: in definition of macro 'DEFINE_SPINLOCK' 81 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | ^ 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_bh' at include/linux/spinlock_api_smp.h:136:2, inlined from 'spin_lock_bh' at include/linux/spinlock.h:334:2, inlined from 'rt_bind_exception' at net/ipv4/route.c:1415:2: arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'spinlock_t[1]' {aka 'struct spinlock[1]'} [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ net/ipv4/route.c: In function 'rt_bind_exception': net/ipv4/route.c:578:24: note: object 'fnhe_lock' of size 4 578 | static DEFINE_SPINLOCK(fnhe_lock); | ^~~~~~~~~ include/linux/spinlock_types.h:81:44: note: in definition of macro 'DEFINE_SPINLOCK' 81 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | ^ 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_bh' at include/linux/spinlock_api_smp.h:136:2, inlined from 'spin_lock_bh' at include/linux/spinlock.h:334:2, inlined from 'rt_bind_exception' at net/ipv4/route.c:1415:2: arch/arm64/include/asm/atomic_lse.h:458:9: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'spinlock_t[1]' {aka 'struct spinlock[1]'} [-Warray-bounds=] 458 | asm volatile(ARM64_LSE_ATOMIC_INSN( \ | ^~~ arch/arm64/include/asm/atomic_lse.h:479:1: note: in expansion of macro '__CMPXCHG_CASE' 479 | __CMPXCHG_CASE(w, , acq_4, a, "memory") | ^~~~~~~~~~~~~~ net/ipv4/route.c: In function 'rt_bind_exception': net/ipv4/route.c:578:24: note: object 'fnhe_lock' of size 4 578 | static DEFINE_SPINLOCK(fnhe_lock); | ^~~~~~~~~ include/linux/spinlock_types.h:81:44: note: in definition of macro 'DEFINE_SPINLOCK' 81 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | ^ net/ipv4/route.c: In function 'ip_rt_get_source': include/net/ip_fib.h:167:50: warning: array subscript 0 is outside array bounds of 'struct fib_nh[0]' [-Warray-bounds=] 167 | #define FIB_RES_NH(res) ((res).fi->fib_nh[0]) | ~~~~~~~~~~~~~~~~~^~~~ include/net/ip_fib.h:179:11: note: in expansion of macro 'FIB_RES_NH' -- fs/ocfs2/alloc.c:1713:25: warning: array subscript 0 is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1713 | memmove(&el->l_recs[0], &el->l_recs[1], size); | ^~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:1713:41: warning: array subscript 1 is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1713 | memmove(&el->l_recs[0], &el->l_recs[1], size); | ^~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:1714:24: warning: array subscript num_recs is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1714 | memset(&el->l_recs[num_recs], 0, | ^~~~~~~~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c: In function 'ocfs2_replay_truncate_records': fs/ocfs2/alloc.c:5972:34: warning: array subscript i is outside array bounds of 'struct ocfs2_truncate_rec[0]' [-Warray-bounds=] 5972 | rec = tl->tl_recs[i]; | ~~~~~~~~~~~^~~ fs/ocfs2/ocfs2_fs.h:538:35: note: while referencing 'tl_recs' 538 | /*08*/ struct ocfs2_truncate_rec tl_recs[0]; /* Truncate records */ | ^~~~~~~ fs/ocfs2/alloc.c:5972:34: warning: array subscript i is outside array bounds of 'struct ocfs2_truncate_rec[0]' [-Warray-bounds=] 5972 | rec = tl->tl_recs[i]; | ~~~~~~~~~~~^~~ fs/ocfs2/ocfs2_fs.h:538:35: note: while referencing 'tl_recs' 538 | /*08*/ struct ocfs2_truncate_rec tl_recs[0]; /* Truncate records */ | ^~~~~~~ fs/ocfs2/alloc.c: In function 'ocfs2_adjust_rightmost_records': fs/ocfs2/alloc.c:3989:34: warning: array subscript <unknown> is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 3989 | rec = &el->l_recs[next_free - 1]; | ~~~~~~~~~~^~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:3989:34: warning: array subscript <unknown> is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 3989 | rec = &el->l_recs[next_free - 1]; | ~~~~~~~~~~^~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:3989:34: warning: array subscript <unknown> is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 3989 | rec = &el->l_recs[next_free - 1]; | ~~~~~~~~~~^~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c: In function 'ocfs2_figure_appending_type.isra': fs/ocfs2/alloc.c:4561:26: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 4561 | rec = &el->l_recs[i]; | ~~~~~~~~~~^~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:4561:26: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 4561 | rec = &el->l_recs[i]; | ~~~~~~~~~~^~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ In function 'ocfs2_adjust_root_records', inlined from 'ocfs2_complete_edge_insert' at fs/ocfs2/alloc.c:2114:2: fs/ocfs2/alloc.c:2025:48: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2025 | if (le64_to_cpu(root_el->l_recs[i].e_blkno) == left_el_blkno) | ~~~~~~~~~~~~~~~^~~ include/uapi/linux/byteorder/little_endian.h:32:51: note: in definition of macro '__le64_to_cpu' 32 | #define __le64_to_cpu(x) ((__force __u64)(__le64)(x)) | ^ fs/ocfs2/alloc.c:2025:21: note: in expansion of macro 'le64_to_cpu' 2025 | if (le64_to_cpu(root_el->l_recs[i].e_blkno) == left_el_blkno) | ^~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h: In function 'ocfs2_complete_edge_insert': fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ In function 'ocfs2_adjust_root_records', inlined from 'ocfs2_complete_edge_insert' at fs/ocfs2/alloc.c:2114:2: fs/ocfs2/alloc.c:2035:9: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2035 | ocfs2_adjust_adjacent_records(&root_el->l_recs[i], | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2036 | &root_el->l_recs[i + 1], right_el); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h: In function 'ocfs2_complete_edge_insert': fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ In function 'ocfs2_adjust_root_records', inlined from 'ocfs2_complete_edge_insert' at fs/ocfs2/alloc.c:2114:2: fs/ocfs2/alloc.c:2035:9: warning: array subscript <unknown> is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2035 | ocfs2_adjust_adjacent_records(&root_el->l_recs[i], | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2036 | &root_el->l_recs[i + 1], right_el); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h: In function 'ocfs2_complete_edge_insert': fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ >> fs/ocfs2/alloc.c:2087:28: warning: array subscript idx is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2087 | left_rec = &el->l_recs[idx]; | ^~~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:2090:29: warning: array subscript 0 is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2090 | right_rec = &el->l_recs[0]; | ^~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c: In function 'ocfs2_figure_contig_type': fs/ocfs2/alloc.c:4504:31: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 4504 | contig_type = ocfs2_et_extent_contig(et, &el->l_recs[i], | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4505 | insert_rec); | ~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:4515:44: warning: array subscript <unknown> is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 4515 | &el->l_recs[insert->ins_contig_index]; | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c: In function '__ocfs2_find_path.constprop': fs/ocfs2/alloc.c:1827:42: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1827 | rec = &el->l_recs[i]; | ~~~~~~~~~~^~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:1827:42: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1827 | rec = &el->l_recs[i]; | ~~~~~~~~~~^~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:1840:47: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1840 | blkno = le64_to_cpu(el->l_recs[i].e_blkno); | ~~~~~~~~~~^~~ include/uapi/linux/byteorder/little_endian.h:32:51: note: in definition of macro '__le64_to_cpu' 32 | #define __le64_to_cpu(x) ((__force __u64)(__le64)(x)) | ^ fs/ocfs2/alloc.c:1840:25: note: in expansion of macro 'le64_to_cpu' 1840 | blkno = le64_to_cpu(el->l_recs[i].e_blkno); | ^~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c: In function 'ocfs2_find_branch_target.constprop': fs/ocfs2/alloc.c:1488:47: warning: array subscript i is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1488 | blkno = le64_to_cpu(el->l_recs[i].e_blkno); | ~~~~~~~~~~^~~ include/uapi/linux/byteorder/little_endian.h:32:51: note: in definition of macro '__le64_to_cpu' 32 | #define __le64_to_cpu(x) ((__force __u64)(__le64)(x)) | ^ fs/ocfs2/alloc.c:1488:25: note: in expansion of macro 'le64_to_cpu' 1488 | blkno = le64_to_cpu(el->l_recs[i].e_blkno); | ^~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c: In function 'ocfs2_update_edge_lengths.isra': fs/ocfs2/alloc.c:2561:26: warning: array subscript idx is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2561 | rec = &el->l_recs[idx]; | ~~~~~~~~~~^~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:2561:26: warning: array subscript idx is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2561 | rec = &el->l_recs[idx]; | ~~~~~~~~~~^~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:2561:26: warning: array subscript idx is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2561 | rec = &el->l_recs[idx]; | ~~~~~~~~~~^~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:2567:34: warning: array subscript idx is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2567 | rec = &el->l_recs[idx]; | ~~~~~~~~~~^~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c:2567:34: warning: array subscript idx is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 2567 | rec = &el->l_recs[idx]; | ~~~~~~~~~~^~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' 512 | /*10*/ struct ocfs2_extent_rec l_recs[0]; /* Extent records */ | ^~~~~~ fs/ocfs2/alloc.c: In function 'ocfs2_adjust_rightmost_branch': fs/ocfs2/alloc.c:1141:15: warning: array subscript <unknown> is outside array bounds of 'struct ocfs2_extent_rec[0]' [-Warray-bounds=] 1141 | rec = &el->l_recs[le16_to_cpu(el->l_next_free_rec) - 1]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ocfs2/ocfs2_fs.h:512:33: note: while referencing 'l_recs' .. vim +458 arch/arm64/include/asm/atomic_lse.h c342f78217e822 Will Deacon 2015-04-23 448 c342f78217e822 Will Deacon 2015-04-23 449 #define __CMPXCHG_CASE(w, sz, name, mb, cl...) \ c342f78217e822 Will Deacon 2015-04-23 450 static inline unsigned long __cmpxchg_case_##name(volatile void *ptr, \ c342f78217e822 Will Deacon 2015-04-23 451 unsigned long old, \ c342f78217e822 Will Deacon 2015-04-23 452 unsigned long new) \ c342f78217e822 Will Deacon 2015-04-23 453 { \ c342f78217e822 Will Deacon 2015-04-23 454 register unsigned long x0 asm ("x0") = (unsigned long)ptr; \ c342f78217e822 Will Deacon 2015-04-23 455 register unsigned long x1 asm ("x1") = old; \ c342f78217e822 Will Deacon 2015-04-23 456 register unsigned long x2 asm ("x2") = new; \ c342f78217e822 Will Deacon 2015-04-23 457 \ c342f78217e822 Will Deacon 2015-04-23 @458 asm volatile(ARM64_LSE_ATOMIC_INSN( \ c342f78217e822 Will Deacon 2015-04-23 459 /* LL/SC */ \ c342f78217e822 Will Deacon 2015-04-23 460 __LL_SC_CMPXCHG(name) \ 05492f2fd87d0a Will Deacon 2016-09-06 461 __nops(2), \ c342f78217e822 Will Deacon 2015-04-23 462 /* LSE atomics */ \ c342f78217e822 Will Deacon 2015-04-23 463 " mov " #w "30, %" #w "[old]\n" \ c342f78217e822 Will Deacon 2015-04-23 464 " cas" #mb #sz "\t" #w "30, %" #w "[new], %[v]\n" \ c342f78217e822 Will Deacon 2015-04-23 465 " mov %" #w "[ret], " #w "30") \ c342f78217e822 Will Deacon 2015-04-23 466 : [ret] "+r" (x0), [v] "+Q" (*(unsigned long *)ptr) \ c342f78217e822 Will Deacon 2015-04-23 467 : [old] "r" (x1), [new] "r" (x2) \ 5be8b70af1ca78 Ard Biesheuvel 2016-02-25 468 : __LL_SC_CLOBBERS, ##cl); \ c342f78217e822 Will Deacon 2015-04-23 469 \ c342f78217e822 Will Deacon 2015-04-23 470 return x0; \ c342f78217e822 Will Deacon 2015-04-23 471 } c342f78217e822 Will Deacon 2015-04-23 472 :::::: The code at line 458 was first introduced by commit :::::: c342f78217e822d2178265b0b1de232eeb717149 arm64: cmpxchg: patch in lse instructions when supported by the CPU :::::: TO: Will Deacon <will.deacon(a)arm.com> :::::: CC: Will Deacon <will.deacon(a)arm.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 1320/1320] drivers/nfc/st-nci/i2c.c:295:34: warning: 'of_st_nci_i2c_match' defined but not used
by kernel test robot 04 Dec '24

04 Dec '24
Hi Paulo, First bad commit (maybe != root cause): tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 98beb6bc5000f977169e4f633e450f4e3e9d84d1 commit: 71e217e85c3dff8a9151707ed3afc7b4b054a2d4 [1320/1320] selinux: use kernel linux/socket.h for genheaders and mdp config: x86_64-buildonly-randconfig-005 (https://download.01.org/0day-ci/archive/20241204/202412041541.cTSYXphC-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/20241204/202412041541.cTSYXphC-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/202412041541.cTSYXphC-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/nfc/st-nci/i2c.c:295:34: warning: 'of_st_nci_i2c_match' defined but not used [-Wunused-const-variable=] 295 | static const struct of_device_id of_st_nci_i2c_match[] = { | ^~~~~~~~~~~~~~~~~~~ drivers/nfc/st-nci/i2c.c:288:36: warning: 'st_nci_i2c_acpi_match' defined but not used [-Wunused-const-variable=] 288 | static const struct acpi_device_id st_nci_i2c_acpi_match[] = { | ^~~~~~~~~~~~~~~~~~~~~ vim +/of_st_nci_i2c_match +295 drivers/nfc/st-nci/i2c.c ed6a2f3fb770ac drivers/nfc/st-nci/i2c.c Christophe Ricard 2015-12-23 294 ed06aeefdac348 drivers/nfc/st-nci/i2c.c Christophe Ricard 2015-06-09 @295 static const struct of_device_id of_st_nci_i2c_match[] = { 1a94cb6025d49b drivers/nfc/st21nfcb/i2c.c Christophe Ricard 2014-12-08 296 { .compatible = "st,st21nfcb-i2c", }, 35630df68d6030 drivers/nfc/st21nfcb/i2c.c Christophe Ricard 2014-05-25 297 { .compatible = "st,st21nfcb_i2c", }, ed06aeefdac348 drivers/nfc/st-nci/i2c.c Christophe Ricard 2015-06-09 298 { .compatible = "st,st21nfcc-i2c", }, 35630df68d6030 drivers/nfc/st21nfcb/i2c.c Christophe Ricard 2014-05-25 299 {} 35630df68d6030 drivers/nfc/st21nfcb/i2c.c Christophe Ricard 2014-05-25 300 }; ed06aeefdac348 drivers/nfc/st-nci/i2c.c Christophe Ricard 2015-06-09 301 MODULE_DEVICE_TABLE(of, of_st_nci_i2c_match); 35630df68d6030 drivers/nfc/st21nfcb/i2c.c Christophe Ricard 2014-05-25 302 :::::: The code at line 295 was first introduced by commit :::::: ed06aeefdac348cfb91a3db5fe1067e3202afd70 nfc: st-nci: Rename st21nfcb to st-nci :::::: TO: Christophe Ricard <christophe.ricard(a)gmail.com> :::::: CC: Samuel Ortiz <sameo(a)linux.intel.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH openEuler-1.0-LTS] media: v4l2-tpg: prevent the risk of a division by zero
by Zhao Yipeng 04 Dec '24

04 Dec '24
From: Mauro Carvalho Chehab <mchehab+huawei(a)kernel.org> stable inclusion from stable-v4.19.324 commit e3c36d0bde309f690ed1f9cd5f7e63b3a513f94a category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB5ATB CVE: CVE-2024-50287 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=… -------------------------------- media: v4l2-tpg: prevent the risk of a division by zero commit e6a3ea83fbe15d4818d01804e904cbb0e64e543b upstream. As reported by Coverity, the logic at tpg_precalculate_line() blindly rescales the buffer even when scaled_witdh is equal to zero. If this ever happens, this will cause a division by zero. Instead, add a WARN_ON_ONCE() to trigger such cases and return without doing any precalculation. Fixes: 63881df94d3e ("[media] vivid: add the Test Pattern Generator") Cc: stable(a)vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei(a)kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org> Signed-off-by: Zhao Yipeng <zhaoyipeng5(a)huawei.com> --- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c index 182a300e2d44..84f8ca9bf028 100644 --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c @@ -1639,6 +1639,9 @@ static void tpg_precalculate_line(struct tpg_data *tpg) unsigned p; unsigned x; + if (WARN_ON_ONCE(!tpg->src_width || !tpg->scaled_width)) + return; + switch (tpg->pattern) { case TPG_PAT_GREEN: contrast = TPG_COLOR_100_RED; -- 2.34.1
2 1
0 0
[PATCH OLK-5.10] drivers/perf: hisi: Add support for HiSilicon DDRC v3 PMU driver
by Junhao He 04 Dec '24

04 Dec '24
driver inclusion category: featrue bugzilla: https://gitee.com/openeuler/kernel/issues/IARCNN -------------------------------- On HiSilicon HIP10C platform, the DDRC PMU is a v3 PMU. And only the offset of it's interrupt registers offset quite a different tune DDRC v2 PMUs. The control registeres and events code are the same as v2 PMU. Their modification was unexpected, which caused the interrupt handler to not handle counter overflows correctly (HiSilicon Erratum 162400501). The before DDRC PMU driver will probe v3 as v2. Therefore DDRC v3 interrupt handler cannot work properly. We fixed that by adding new ID HISI0235 to correct the DDRC v3 PMU interrupt register offset (including mask/status/clear registers). Signed-off-by: Junhao He <hejunhao3(a)huawei.com> --- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 150 ++++++++++-------- 1 file changed, 87 insertions(+), 63 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c index b4d4660c7e6e..aaeb5fb4d86d 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -43,6 +43,11 @@ #define DDRC_V2_EVENT_TYPE 0xe74 #define DDRC_V2_PERF_CTRL 0xeA0 +/* DDRC interrupt registers definition in v3 */ +#define DDRC_V3_INT_MASK 0x534 +#define DDRC_V3_INT_STATUS 0x538 +#define DDRC_V3_INT_CLEAR 0x53C + /* DDRC has 8-counters */ #define DDRC_NR_COUNTERS 0x8 #define DDRC_V1_PERF_CTRL_EN 0x2 @@ -63,6 +68,12 @@ static const u32 ddrc_reg_off[] = { DDRC_PRE_CMD, DDRC_ACT_CMD, DDRC_RNK_CHG, DDRC_RW_CHG }; +struct hisi_ddrc_pmu_regs { + u32 int_mask; + u32 int_clear; + u32 int_status; +}; + /* * Select the counter register offset using the counter index. * In PMU v1, there are no programmable counter, the count @@ -223,77 +234,43 @@ static void hisi_ddrc_pmu_v2_disable_counter(struct hisi_pmu *ddrc_pmu, writel(val, ddrc_pmu->base + DDRC_V2_EVENT_CTRL); } -static void hisi_ddrc_pmu_v1_enable_counter_int(struct hisi_pmu *ddrc_pmu, - struct hw_perf_event *hwc) -{ - u32 val; - - /* Write 0 to enable interrupt */ - val = readl(ddrc_pmu->base + DDRC_INT_MASK); - val &= ~(1 << hwc->idx); - writel(val, ddrc_pmu->base + DDRC_INT_MASK); -} - -static void hisi_ddrc_pmu_v1_disable_counter_int(struct hisi_pmu *ddrc_pmu, - struct hw_perf_event *hwc) -{ - u32 val; - - /* Write 1 to mask interrupt */ - val = readl(ddrc_pmu->base + DDRC_INT_MASK); - val |= 1 << hwc->idx; - writel(val, ddrc_pmu->base + DDRC_INT_MASK); -} - -static void hisi_ddrc_pmu_v2_enable_counter_int(struct hisi_pmu *ddrc_pmu, - struct hw_perf_event *hwc) +static void hisi_ddrc_pmu_enable_counter_int(struct hisi_pmu *ddrc_pmu, + struct hw_perf_event *hwc) { + struct hisi_ddrc_pmu_regs *regs = ddrc_pmu->dev_info->private; u32 val; - val = readl(ddrc_pmu->base + DDRC_V2_INT_MASK); - val &= ~(1 << hwc->idx); - writel(val, ddrc_pmu->base + DDRC_V2_INT_MASK); + val = readl(ddrc_pmu->base + regs->int_mask); + val &= ~BIT_ULL(hwc->idx); + writel(val, ddrc_pmu->base + regs->int_mask); } -static void hisi_ddrc_pmu_v2_disable_counter_int(struct hisi_pmu *ddrc_pmu, - struct hw_perf_event *hwc) +static void hisi_ddrc_pmu_disable_counter_int(struct hisi_pmu *ddrc_pmu, + struct hw_perf_event *hwc) { + struct hisi_ddrc_pmu_regs *regs = ddrc_pmu->dev_info->private; u32 val; - val = readl(ddrc_pmu->base + DDRC_V2_INT_MASK); - val |= 1 << hwc->idx; - writel(val, ddrc_pmu->base + DDRC_V2_INT_MASK); + val = readl(ddrc_pmu->base + regs->int_mask); + val |= BIT_ULL(hwc->idx); + writel(val, ddrc_pmu->base + regs->int_mask); } -static u32 hisi_ddrc_pmu_v1_get_int_status(struct hisi_pmu *ddrc_pmu) +static u32 hisi_ddrc_pmu_get_int_status(struct hisi_pmu *ddrc_pmu) { - return readl(ddrc_pmu->base + DDRC_INT_STATUS); -} + struct hisi_ddrc_pmu_regs *regs = ddrc_pmu->dev_info->private; -static void hisi_ddrc_pmu_v1_clear_int_status(struct hisi_pmu *ddrc_pmu, - int idx) -{ - writel(1 << idx, ddrc_pmu->base + DDRC_INT_CLEAR); + return readl(ddrc_pmu->base + regs->int_status); } -static u32 hisi_ddrc_pmu_v2_get_int_status(struct hisi_pmu *ddrc_pmu) +static void hisi_ddrc_pmu_clear_int_status(struct hisi_pmu *ddrc_pmu, + int idx) { - return readl(ddrc_pmu->base + DDRC_V2_INT_STATUS); -} + struct hisi_ddrc_pmu_regs *regs = ddrc_pmu->dev_info->private; -static void hisi_ddrc_pmu_v2_clear_int_status(struct hisi_pmu *ddrc_pmu, - int idx) -{ - writel(1 << idx, ddrc_pmu->base + DDRC_V2_INT_CLEAR); + writel(1 << idx, ddrc_pmu->base + regs->int_clear); } -static const struct acpi_device_id hisi_ddrc_pmu_acpi_match[] = { - { "HISI0233", }, - { "HISI0234", }, - {} -}; -MODULE_DEVICE_TABLE(acpi, hisi_ddrc_pmu_acpi_match); - static int hisi_ddrc_pmu_init_data(struct platform_device *pdev, struct hisi_pmu *ddrc_pmu) { @@ -315,6 +292,10 @@ static int hisi_ddrc_pmu_init_data(struct platform_device *pdev, /* DDRC PMUs only share the same SCCL */ ddrc_pmu->ccl_id = -1; + ddrc_pmu->dev_info = device_get_match_data(&pdev->dev); + if (!ddrc_pmu->dev_info) + return -ENODEV; + ddrc_pmu->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ddrc_pmu->base)) { dev_err(&pdev->dev, "ioremap failed for ddrc_pmu resource\n"); @@ -428,12 +409,12 @@ static const struct hisi_uncore_ops hisi_uncore_ddrc_v1_ops = { .stop_counters = hisi_ddrc_pmu_v1_stop_counters, .enable_counter = hisi_ddrc_pmu_v1_enable_counter, .disable_counter = hisi_ddrc_pmu_v1_disable_counter, - .enable_counter_int = hisi_ddrc_pmu_v1_enable_counter_int, - .disable_counter_int = hisi_ddrc_pmu_v1_disable_counter_int, + .enable_counter_int = hisi_ddrc_pmu_enable_counter_int, + .disable_counter_int = hisi_ddrc_pmu_disable_counter_int, .write_counter = hisi_ddrc_pmu_v1_write_counter, .read_counter = hisi_ddrc_pmu_v1_read_counter, - .get_int_status = hisi_ddrc_pmu_v1_get_int_status, - .clear_int_status = hisi_ddrc_pmu_v1_clear_int_status, + .get_int_status = hisi_ddrc_pmu_get_int_status, + .clear_int_status = hisi_ddrc_pmu_clear_int_status, }; static const struct hisi_uncore_ops hisi_uncore_ddrc_v2_ops = { @@ -443,12 +424,12 @@ static const struct hisi_uncore_ops hisi_uncore_ddrc_v2_ops = { .stop_counters = hisi_ddrc_pmu_v2_stop_counters, .enable_counter = hisi_ddrc_pmu_v2_enable_counter, .disable_counter = hisi_ddrc_pmu_v2_disable_counter, - .enable_counter_int = hisi_ddrc_pmu_v2_enable_counter_int, - .disable_counter_int = hisi_ddrc_pmu_v2_disable_counter_int, + .enable_counter_int = hisi_ddrc_pmu_enable_counter_int, + .disable_counter_int = hisi_ddrc_pmu_disable_counter_int, .write_counter = hisi_ddrc_pmu_v2_write_counter, .read_counter = hisi_ddrc_pmu_v2_read_counter, - .get_int_status = hisi_ddrc_pmu_v2_get_int_status, - .clear_int_status = hisi_ddrc_pmu_v2_clear_int_status, + .get_int_status = hisi_ddrc_pmu_get_int_status, + .clear_int_status = hisi_ddrc_pmu_clear_int_status, }; static int hisi_ddrc_pmu_dev_probe(struct platform_device *pdev, @@ -467,15 +448,14 @@ static int hisi_ddrc_pmu_dev_probe(struct platform_device *pdev, if (ddrc_pmu->identifier >= HISI_PMU_V2) { ddrc_pmu->counter_bits = 48; ddrc_pmu->check_event = DDRC_V2_NR_EVENTS; - ddrc_pmu->pmu_events.attr_groups = hisi_ddrc_pmu_v2_attr_groups; ddrc_pmu->ops = &hisi_uncore_ddrc_v2_ops; } else { ddrc_pmu->counter_bits = 32; ddrc_pmu->check_event = DDRC_V1_NR_EVENTS; - ddrc_pmu->pmu_events.attr_groups = hisi_ddrc_pmu_v1_attr_groups; ddrc_pmu->ops = &hisi_uncore_ddrc_v1_ops; } + ddrc_pmu->pmu_events.attr_groups = ddrc_pmu->dev_info->attr_groups; ddrc_pmu->num_counters = DDRC_NR_COUNTERS; ddrc_pmu->dev = &pdev->dev; ddrc_pmu->on_cpu = -1; @@ -541,6 +521,50 @@ static int hisi_ddrc_pmu_remove(struct platform_device *pdev) return 0; } +static struct hisi_ddrc_pmu_regs hisi_ddrc_v1_pmu_regs = { + .int_mask = DDRC_INT_MASK, + .int_clear = DDRC_INT_CLEAR, + .int_status = DDRC_INT_STATUS, +}; + +static const struct hisi_pmu_dev_info hisi_ddrc_v1 = { + .name = "ddrc", + .attr_groups = hisi_ddrc_pmu_v1_attr_groups, + .private = &hisi_ddrc_v1_pmu_regs, +}; + +static struct hisi_ddrc_pmu_regs hisi_ddrc_v2_pmu_regs = { + .int_mask = DDRC_V2_INT_MASK, + .int_clear = DDRC_V2_INT_CLEAR, + .int_status = DDRC_V2_INT_STATUS, +}; + +static const struct hisi_pmu_dev_info hisi_ddrc_v2 = { + .name = "ddrc", + .attr_groups = hisi_ddrc_pmu_v2_attr_groups, + .private = &hisi_ddrc_v2_pmu_regs, +}; + +static struct hisi_ddrc_pmu_regs hisi_ddrc_v3_pmu_regs = { + .int_mask = DDRC_V3_INT_MASK, + .int_clear = DDRC_V3_INT_CLEAR, + .int_status = DDRC_V3_INT_STATUS, +}; + +static const struct hisi_pmu_dev_info hisi_ddrc_v3 = { + .name = "ddrc", + .attr_groups = hisi_ddrc_pmu_v2_attr_groups, + .private = &hisi_ddrc_v3_pmu_regs, +}; + +static const struct acpi_device_id hisi_ddrc_pmu_acpi_match[] = { + { "HISI0233", (kernel_ulong_t)&hisi_ddrc_v1}, + { "HISI0234", (kernel_ulong_t)&hisi_ddrc_v2}, + { "HISI0235", (kernel_ulong_t)&hisi_ddrc_v3}, + {} +}; +MODULE_DEVICE_TABLE(acpi, hisi_ddrc_pmu_acpi_match); + static struct platform_driver hisi_ddrc_pmu_driver = { .driver = { .name = "hisi_ddrc_pmu", -- 2.33.0
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 292
  • 293
  • 294
  • 295
  • 296
  • 297
  • 298
  • ...
  • 1822
  • Older →

HyperKitty Powered by HyperKitty