linux-stable/arch/mips
Huacai Chen 98aaa51195 MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
commit e1a534f5d0 upstream.

When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected,
cpu_max_bits_warn() generates a runtime warning similar as below while
we show /proc/cpuinfo. Fix this by using nr_cpu_ids (the runtime limit)
instead of NR_CPUS to iterate CPUs.

[    3.052463] ------------[ cut here ]------------
[    3.059679] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:108 show_cpuinfo+0x5e8/0x5f0
[    3.070072] Modules linked in: efivarfs autofs4
[    3.076257] CPU: 0 PID: 1 Comm: systemd Not tainted 5.19-rc5+ #1052
[    3.084034] Hardware name: Loongson Loongson-3A4000-7A1000-1w-V0.1-CRB/Loongson-LS3A4000-7A1000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V2.0.04082-beta7 04/27
[    3.099465] Stack : 9000000100157b08 9000000000f18530 9000000000cf846c 9000000100154000
[    3.109127]         9000000100157a50 0000000000000000 9000000100157a58 9000000000ef7430
[    3.118774]         90000001001578e8 0000000000000040 0000000000000020 ffffffffffffffff
[    3.128412]         0000000000aaaaaa 1ab25f00eec96a37 900000010021de80 900000000101c890
[    3.138056]         0000000000000000 0000000000000000 0000000000000000 0000000000aaaaaa
[    3.147711]         ffff8000339dc220 0000000000000001 0000000006ab4000 0000000000000000
[    3.157364]         900000000101c998 0000000000000004 9000000000ef7430 0000000000000000
[    3.167012]         0000000000000009 000000000000006c 0000000000000000 0000000000000000
[    3.176641]         9000000000d3de08 9000000001639390 90000000002086d8 00007ffff0080286
[    3.186260]         00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c
[    3.195868]         ...
[    3.199917] Call Trace:
[    3.203941] [<98000000002086d8>] show_stack+0x38/0x14c
[    3.210666] [<9800000000cf846c>] dump_stack_lvl+0x60/0x88
[    3.217625] [<980000000023d268>] __warn+0xd0/0x100
[    3.223958] [<9800000000cf3c90>] warn_slowpath_fmt+0x7c/0xcc
[    3.231150] [<9800000000210220>] show_cpuinfo+0x5e8/0x5f0
[    3.238080] [<98000000004f578c>] seq_read_iter+0x354/0x4b4
[    3.245098] [<98000000004c2e90>] new_sync_read+0x17c/0x1c4
[    3.252114] [<98000000004c5174>] vfs_read+0x138/0x1d0
[    3.258694] [<98000000004c55f8>] ksys_read+0x70/0x100
[    3.265265] [<9800000000cfde9c>] do_syscall+0x7c/0x94
[    3.271820] [<9800000000202fe4>] handle_syscall+0xc4/0x160
[    3.281824] ---[ end trace 8b484262b4b8c24c ]---

Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-25 11:11:13 +02:00
..
alchemy MIPS: alchemy: xxs1500: add gpio-au1000.h header file 2021-06-03 08:36:25 +02:00
ar7 MIPS: AR7: ensure the port type's FCR value is used 2018-01-23 19:58:21 +01:00
ath25 MIPS: ath25: Check for kzalloc allocation failure 2018-03-15 10:54:31 +01:00
ath79 Revert "MIPS: perf: ath79: Fix perfcount IRQ assignment" 2019-06-11 12:21:49 +02:00
bcm47xx MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA 2020-12-29 13:46:53 +01:00
bcm63xx mips: bcm63xx: add support for clk_set_parent() 2022-01-27 09:00:53 +01:00
bmips MIPS: Use address-of operator on section symbols 2022-05-15 19:40:26 +02:00
boot mips: disable branch profiling in boot/decompress.o 2021-07-20 16:17:55 +02:00
cavium-octeon MIPS: OCTEON: add put_device() after of_find_device_by_node() 2022-01-27 09:00:58 +01:00
cobalt
configs MIPS: Loongson: Build ATI Radeon GPU driver as module 2020-06-20 10:25:07 +02:00
dec DEC: Limit PMAX memory probing to R3k systems 2022-04-20 09:08:12 +02:00
emma
fw MIPS: fw: sni: Fix out of bounds init of o32 stack 2019-11-06 12:43:17 +01:00
generic MIPS: generic/yamon-dt: fix uninitialized variable error 2021-11-26 11:40:39 +01:00
include mips: use fallback for random_get_entropy() instead of just c0 random 2022-06-25 11:46:38 +02:00
jazz MIPS: jazz: fix 64bit build 2019-02-27 10:08:04 +01:00
jz4740 MIPS: lb60: Fix pin mappings 2019-07-31 07:28:47 +02:00
kernel MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-08-25 11:11:13 +02:00
kvm KVM: MIPS: Change the definition of kvm type 2020-09-23 10:46:34 +02:00
lantiq MIPS: lantiq: check the return value of kzalloc() 2022-05-25 08:41:18 +02:00
lasat License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lib MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER 2021-06-16 11:53:01 +02:00
loongson32 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
loongson64 MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init() 2020-02-28 16:35:57 +01:00
math-emu MIPS: math-emu: Write-protect delay slot emulation pages 2019-01-09 17:14:51 +01:00
mm mips,s390,sh,sparc: gup: Work around the "COW can break either way" issue 2022-01-27 09:01:01 +01:00
mti-malta MIPS: Malta: fix alignment of the devicetree buffer 2021-09-22 11:45:26 +02:00
net bpf, mips: Validate conditional branch offsets 2021-10-17 10:08:32 +02:00
netlogic License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
paravirt License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci MIPS: pci-legacy: stop using of_pci_range_to_resource 2021-05-22 10:57:33 +02:00
pic32 MIPS: Use address-of operator on section symbols 2022-05-15 19:40:26 +02:00
pistachio MIPS: pistachio: Build uImage.gz by default 2019-06-11 12:21:49 +02:00
pmcs-msp71xx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pnx833x mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
power License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ralink MIPS: Use address-of operator on section symbols 2022-05-15 19:40:26 +02:00
rb532 MIPS: RB532: fix return value of __setup handler 2022-04-20 09:08:18 +02:00
sgi-ip22 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sgi-ip27 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sgi-ip32
sibyte Revert "MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur" 2019-09-19 09:08:03 +02:00
sni MIPS: sni: Fix the build 2021-11-26 11:40:38 +01:00
tools Update MIPS email addresses 2017-11-03 09:02:30 -07:00
txx9 mips: txx9: fix iounmap related issue 2019-11-20 17:59:48 +01:00
vdso MIPS: vdso: Invalid GIC access through VDSO 2021-07-20 16:17:55 +02:00
vr41xx MIPS: Remove repetitive increase irq_err_count 2022-07-02 16:18:08 +02:00
xilfpga License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kbuild
Kbuild.platforms
Kconfig MIPS: use 3-level pgtable for 64KB page size on MIPS_VA_BITS_48 2021-12-08 08:46:49 +01:00
Kconfig.debug License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile mips: Fix non-POSIX regexp 2021-08-15 13:03:29 +02:00
Makefile.postlink MIPS: fix indentation of the 'RELOCS' message 2020-02-14 16:32:09 -05:00