b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address]
Subsystems (3)
Hi Linus,
Can you please advise me?
The commit b9a7ecc71fe582e ("cpumask: fix checking valid cpu range") fixes broken cpumask_check(), which for now doesn't warn user when it should. After the fix, I observed many false-positive warnings which were addressed in the following patches.
The problem is that robots that test the series per-patch spotted that the cpmask_check() started generating new warnings after b9a7ecc71fe582e.
I don't think it's that important, but if I'm wrong, I can move the b9a7ecc71fe582e at the very end of the series (as I could do at the very beginning). In that case, the bitmap-for-next history will be rewritten, and you don't like it.
So, should I keep things as is, reorder patches or do something else?
Thanks,
Yury
----- Forwarded message from kernel test robot <[email protected]> -----
Date: Fri, 30 Sep 2022 09:52:04 +0800
From: kernel test robot <[email protected]>
User-Agent: Mutt/1.10.1 (2018-07-13)
To: Yury Norov <[email protected]>
CC: lkp(a)lists.01.org, lkp(a)intel.com, Linux Memory Management List <[email protected]>, linux-kernel(a)vger.kernel.org
Subject: [cpumask] b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address
(please be noted we reported
[cpumask] a9e4ab8629: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address
at
https://lists.01.org/hyperkitty/list/lkp(a)lists.01.org/thread/F3LJPKA3GI5HP4ONEITCL6MJGSZ5IYOS/
when this commit is still on
https://github.com/norov/linux cpumask
now we noticed the commit has been merged in linux-next and observed the similar issue still existing.
report again FYI)
Greeting,
FYI, we noticed the following commit (built with clang-14):
commit: b9a7ecc71fe582eaf67dcbf1f45fb30cd05510a4 ("cpumask: fix checking valid cpu range")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
in testcase: boot
on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G
caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+ | | 944c417dae | b9a7ecc71f | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+ | WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address | 0 | 45 | | RIP:__is_kernel_percpu_address | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#pcpu_build_alloc_info | 0 | 45 | | RIP:pcpu_build_alloc_info | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#pcpu_setup_first_chunk | 0 | 45 | | RIP:pcpu_setup_first_chunk | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#setup_per_cpu_areas | 0 | 45 | | RIP:setup_per_cpu_areas | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#build_all_zonelists_init | 0 | 45 | | RIP:build_all_zonelists_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#setup_cpu_entry_areas | 0 | 45 | | RIP:setup_cpu_entry_areas | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#pcpu_alloc | 0 | 45 | | RIP:pcpu_alloc | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#__kmem_cache_create | 0 | 45 | | RIP:__kmem_cache_create | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#vmalloc_init | 0 | 45 | | RIP:vmalloc_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#__cpuhp_state_add_instance_cpuslocked | 0 | 45 | | RIP:__cpuhp_state_add_instance_cpuslocked | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#set_buffer_entries | 0 | 45 | | RIP:set_buffer_entries | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#sched_init | 0 | 45 | | RIP:sched_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpudl_init | 0 | 45 | | RIP:cpudl_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpupri_init | 0 | 45 | | RIP:cpupri_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#group_init | 0 | 45 | | RIP:group_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#workqueue_init_early | 0 | 45 | | RIP:workqueue_init_early | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#alloc_workqueue | 0 | 45 | | RIP:alloc_workqueue | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#kfree_rcu_batch_init | 0 | 45 | | RIP:kfree_rcu_batch_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#rcu_init_one | 0 | 45 | | RIP:rcu_init_one | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#context_tracking_init | 0 | 45 | | RIP:context_tracking_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#alloc_desc | 0 | 45 | | RIP:alloc_desc | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#_vm_unmap_aliases | 0 | 45 | | RIP:_vm_unmap_aliases | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#purge_fragmented_blocks_allcpus | 0 | 45 | | RIP:purge_fragmented_blocks_allcpus | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#init_timer_cpus | 0 | 45 | | RIP:init_timer_cpus | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#softirq_init | 0 | 45 | | RIP:softirq_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#perf_event_init_all_cpus | 0 | 45 | | RIP:perf_event_init_all_cpus | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#init_srcu_struct_fields | 0 | 45 | | RIP:init_srcu_struct_fields | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#perf_pmu_register | 0 | 45 | | RIP:perf_pmu_register | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#init_hw_breakpoint | 0 | 45 | | RIP:init_hw_breakpoint | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#call_function_init | 0 | 45 | | RIP:call_function_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#setup_zone_pageset | 0 | 45 | | RIP:setup_zone_pageset | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#__zone_set_pageset_high_and_batch | 0 | 45 | | RIP:__zone_set_pageset_high_and_batch | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cyc2ns_init_secondary_cpus | 0 | 45 | | RIP:cyc2ns_init_secondary_cpus | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#__cpuhp_setup_state_cpuslocked | 0 | 45 | | RIP:__cpuhp_setup_state_cpuslocked | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cgroup_rstat_boot | 0 | 45 | | RIP:cgroup_rstat_boot | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cgroup_rstat_init | 0 | 45 | | RIP:cgroup_rstat_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#nr_context_switches | 0 | 45 | | RIP:nr_context_switches | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#smp_cpu_index_default | 0 | 45 | | RIP:smp_cpu_index_default | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#topology_phys_to_logical_pkg | 0 | 45 | | RIP:topology_phys_to_logical_pkg | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#topology_phys_to_logical_die | 0 | 45 | | RIP:topology_phys_to_logical_die | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#smp_prepare_cpus_common | 0 | 45 | | RIP:smp_prepare_cpus_common | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#workqueue_init | 0 | 45 | | RIP:workqueue_init | 0 | 45 | | calltrace:copy_process | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#wq_watchdog_reset_touched | 0 | 45 | | RIP:wq_watchdog_reset_touched | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#start_shepherd_timer | 0 | 45 | | RIP:start_shepherd_timer | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cblist_init_generic | 0 | 45 | | RIP:cblist_init_generic | 0 | 45 | | calltrace:irq_exit_rcu | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#try_check_zero | 0 | 45 | | RIP:try_check_zero | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#rcu_tasks_trace_pregp_step | 0 | 45 | | RIP:rcu_tasks_trace_pregp_step | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#rcu_spawn_core_kthreads | 0 | 45 | | RIP:rcu_spawn_core_kthreads | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpu_stop_init | 0 | 45 | | RIP:cpu_stop_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#__lockup_detector_reconfigure | 0 | 45 | | RIP:__lockup_detector_reconfigure | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#idle_threads_init | 0 | 45 | | RIP:idle_threads_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpuhp_init_state | 0 | 45 | | RIP:cpuhp_init_state | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#percpu_down_write | 0 | 45 | | RIP:percpu_down_write | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#select_fallback_rq | 0 | 45 | | RIP:select_fallback_rq | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#set_cpu_sibling_map | 0 | 45 | | RIP:set_cpu_sibling_map | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#sched_core_lock | 0 | 45 | | RIP:sched_core_lock | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#sched_core_unlock | 0 | 45 | | RIP:sched_core_unlock | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#speculative_store_bypass_ht_init | 0 | 45 | | RIP:speculative_store_bypass_ht_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpumask_any_and_distribute | 0 | 45 | | RIP:cpumask_any_and_distribute | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#refresh_zone_stat_thresholds | 0 | 45 | | RIP:refresh_zone_stat_thresholds | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#bringup_nonboot_cpus | 0 | 45 | | RIP:bringup_nonboot_cpus | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#native_smp_cpus_done | 0 | 45 | | RIP:native_smp_cpus_done | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#asym_cpu_capacity_scan | 0 | 45 | | RIP:asym_cpu_capacity_scan | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#build_sched_domains | 0 | 45 | | RIP:build_sched_domains | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpumask_next_wrap | 0 | 45 | | RIP:cpumask_next_wrap | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#load_balance | 0 | 45 | | RIP:load_balance | 0 | 45 | | RIP:console_emit_next_record | 0 | 42 | | WARNING:at_include/linux/cpumask.h:#init_sched_rt_class | 0 | 45 | | RIP:init_sched_rt_class | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#init_sched_dl_class | 0 | 45 | | RIP:init_sched_dl_class | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#find_idlest_cpu | 0 | 45 | | RIP:find_idlest_cpu | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#kfree_rcu_scheduler_running | 0 | 45 | | RIP:kfree_rcu_scheduler_running | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#filelock_init | 0 | 45 | | RIP:filelock_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#pcpu_populate_chunk | 0 | 45 | | RIP:pcpu_populate_chunk | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#mnt_get_count | 0 | 45 | | RIP:mnt_get_count | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#bpf_prog_alloc | 0 | 45 | | RIP:bpf_prog_alloc | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#smp_call_function_many_cond | 0 | 45 | | RIP:smp_call_function_many_cond | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#topology_init | 0 | 45 | | RIP:topology_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#clocksource_watchdog | 0 | 45 | | RIP:clocksource_watchdog | 0 | 45 | | RIP:default_idle | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#vmstat_shepherd | 0 | 45 | | RIP:vmstat_shepherd | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cryptd_init | 0 | 45 | | RIP:cryptd_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blk_mq_init | 0 | 45 | | RIP:blk_mq_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#irq_matrix_alloc | 0 | 45 | | RIP:irq_matrix_alloc | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#flush_all_cpus_locked | 0 | 45 | | RIP:flush_all_cpus_locked | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#collect_percpu_times | 0 | 45 | | RIP:collect_percpu_times | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#net_dev_init | 0 | 45 | | RIP:net_dev_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#loopback_dev_init | 0 | 45 | | RIP:loopback_dev_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#dev_lstats_read | 0 | 45 | | RIP:dev_lstats_read | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#sched_rt_period_timer | 0 | 45 | | RIP:sched_rt_period_timer | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#queue_stop_cpus_work | 0 | 45 | | RIP:queue_stop_cpus_work | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#tracer_init_tracefs | 0 | 45 | | RIP:tracer_init_tracefs | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#get_nr_inodes | 0 | 45 | | RIP:get_nr_inodes | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#get_nr_dirty_inodes | 0 | 45 | | RIP:get_nr_dirty_inodes | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#mnt_get_writers | 0 | 45 | | RIP:mnt_get_writers | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#ip_rt_init | 0 | 45 | | RIP:ip_rt_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#ipv4_mib_init_net | 0 | 45 | | RIP:ipv4_mib_init_net | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#tcp_v4_init | 0 | 45 | | RIP:tcp_v4_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#tcp_tasklet_init | 0 | 45 | | RIP:tcp_tasklet_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#tcp_orphan_count_sum | 0 | 45 | | RIP:tcp_orphan_count_sum | 0 | 45 | | RIP:udp_table_init | 0 | 3 | | WARNING:at_include/linux/cpumask.h:#icmp_init | 0 | 45 | | RIP:icmp_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#__queue_work | 0 | 45 | | RIP:__queue_work | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#init_tracer_tracefs | 0 | 45 | | RIP:init_tracer_tracefs | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpuhp_sysfs_init | 0 | 45 | | RIP:cpuhp_sysfs_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#tick_init_sysfs | 0 | 45 | | RIP:tick_init_sysfs | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#kcov_init | 0 | 45 | | RIP:kcov_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#set_pgdat_percpu_threshold | 0 | 45 | | RIP:set_pgdat_percpu_threshold | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#acpi_processor_throttling_init | 0 | 45 | | RIP:acpi_processor_throttling_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#populate_cache_leaves | 0 | 45 | | RIP:populate_cache_leaves | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blk_mq_map_queues | 0 | 45 | | RIP:blk_mq_map_queues | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#sbitmap_init_node | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blkg_alloc | 0 | 45 | | RIP:blkg_alloc | 0 | 45 | | RIP:sbitmap_init_node | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#iolatency_pd_init | 0 | 45 | | RIP:iolatency_pd_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#__percpu_ref_switch_mode | 0 | 45 | | RIP:__percpu_ref_switch_mode | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blk_mq_init_allocated_queue | 0 | 45 | | RIP:blk_mq_init_allocated_queue | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blk_mq_sysfs_init | 0 | 45 | | RIP:blk_mq_sysfs_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blk_mq_map_swqueue | 0 | 45 | | RIP:blk_mq_map_swqueue | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blk_stat_add_callback | 0 | 45 | | RIP:blk_stat_add_callback | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#blk_mq_update_queue_map | 0 | 45 | | RIP:blk_mq_update_queue_map | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#flush_tlb_mm_range | 0 | 45 | | RIP:flush_tlb_mm_range | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#spi_alloc_pcpu_stats | 0 | 45 | | RIP:spi_alloc_pcpu_stats | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#ipv6_init_mibs | 0 | 45 | | RIP:ipv6_init_mibs | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#icmpv6_init | 0 | 45 | | RIP:icmpv6_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#cpumask_next | 0 | 45 | | RIP:cpumask_next | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#ipv6_add_dev | 0 | 45 | | RIP:ipv6_add_dev | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#ipip6_tunnel_init | 0 | 45 | | RIP:ipip6_tunnel_init | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#dev_fetch_sw_netstats | 0 | 45 | | RIP:dev_fetch_sw_netstats | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#snmp6_fill_stats | 0 | 45 | | RIP:snmp6_fill_stats | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#update_sched_domain_debugfs | 0 | 45 | | RIP:update_sched_domain_debugfs | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#rt_fibinfo_free_cpus | 0 | 45 | | RIP:rt_fibinfo_free_cpus | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#qdisc_alloc | 0 | 45 | | RIP:qdisc_alloc | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#rcu_barrier | 0 | 45 | | RIP:rcu_barrier | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#nr_processes | 0 | 28 | | RIP:nr_processes | 0 | 28 | | WARNING:at_include/linux/cpumask.h:#alloc_fair_sched_group | 0 | 45 | | RIP:alloc_fair_sched_group | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#alloc_rt_sched_group | 0 | 45 | | RIP:alloc_rt_sched_group | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#free_rt_sched_group | 0 | 45 | | RIP:free_rt_sched_group | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#online_fair_sched_group | 0 | 45 | | RIP:online_fair_sched_group | 0 | 45 | | WARNING:at_include/linux/cpumask.h:#c_start | 0 | 27 | | RIP:c_start | 0 | 27 | | WARNING:at_include/linux/cpumask.h:#cgroup_rstat_flush_locked | 0 | 27 | | RIP:cgroup_rstat_flush_locked | 0 | 27 | | WARNING:at_include/linux/cpumask.h:#__percpu_counter_sum | 0 | 35 | | RIP:__percpu_counter_sum | 0 | 35 | | WARNING:at_include/linux/cpumask.h:#percpu_ref_switch_to_atomic_rcu | 0 | 19 | | RIP:percpu_ref_switch_to_atomic_rcu | 0 | 19 | | WARNING:at_include/linux/cpumask.h:#unregister_fair_sched_group | 0 | 29 | | RIP:unregister_fair_sched_group | 0 | 29 |
....
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+
If you fix the issue, kindly add following tag
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/r/202209292151.f0b8f7f1-oliver.sang(a)intel.com
[ 1.587838][ T0] ------------[ cut here ]------------ [ 1.588505][ T0] WARNING: CPU: 0 PID: 0 at include/linux/cpumask.h:110 __is_kernel_percpu_address (include/linux/cpumask.h:110 include/linux/cpumask.h:117 include/linux/cpumask.h:178 mm/percpu.c:2320) [ 1.589783][ T0] Modules linked in: [ 1.590250][ T0] CPU: 0 PID: 0 Comm: swapper Not tainted 6.0.0-rc4-00018-gb9a7ecc71fe5 #1 [ 1.591281][ T0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014 [ 1.592535][ T0] RIP: 0010:__is_kernel_percpu_address (include/linux/cpumask.h:110 include/linux/cpumask.h:117 include/linux/cpumask.h:178 mm/percpu.c:2320) [ 1.593336][ T0] Code: 29 cb 72 16 48 8b 4d c8 48 01 c8 48 05 00 00 00 00 48 39 d0 0f 87 af 00 00 00 e8 61 99 ec ff e9 36 ff ff ff e8 57 99 ec ff 90 <0f> 0b 90 e9 49 ff ff ff 48 c7 c1 88 73 a7 89 80 e1 07 80 c1 03 38 All code ======== 0: 29 cb sub %ecx,%ebx 2: 72 16 jb 0x1a 4: 48 8b 4d c8 mov -0x38(%rbp),%rcx 8: 48 01 c8 add %rcx,%rax b: 48 05 00 00 00 00 add $0x0,%rax 11: 48 39 d0 cmp %rdx,%rax 14: 0f 87 af 00 00 00 ja 0xc9 1a: e8 61 99 ec ff callq 0xffffffffffec9980 1f: e9 36 ff ff ff jmpq 0xffffffffffffff5a 24: e8 57 99 ec ff callq 0xffffffffffec9980 29: 90 nop 2a:* 0f 0b ud2 <-- trapping instruction 2c: 90 nop 2d: e9 49 ff ff ff jmpq 0xffffffffffffff7b 32: 48 c7 c1 88 73 a7 89 mov $0xffffffff89a77388,%rcx 39: 80 e1 07 and $0x7,%cl 3c: 80 c1 03 add $0x3,%cl
3f: 38 .byte 0x38
Code starting with the faulting instruction
===========================================
0: 0f 0b ud2 2: 90 nop 3: e9 49 ff ff ff jmpq 0xffffffffffffff51 8: 48 c7 c1 88 73 a7 89 mov $0xffffffff89a77388,%rcx f: 80 e1 07 and $0x7,%cl 12: 80 c1 03 add $0x3,%cl 15: 38 .byte 0x38 [ 1.595672][ T0] RSP: 0000:ffffffff88207b20 EFLAGS: 00010093 ORIG_RAX: 0000000000000000 [ 1.596689][ T0] RAX: ffffffff814ed015 RBX: ffffffffff30c690 RCX: ffffffff882b0440 [ 1.597660][ T0] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffffffff89a77170 [ 1.598625][ T0] RBP: ffffffff88207b60 R08: 0000000000000001 R09: 0000000000000001 [ 1.599589][ T0] R10: 0000000000000000 R11: dffff7fff134ee2e R12: dffffc0000000000 [ 1.600507][ T0] R13: 0000000000000002 R14: 1ffffffff134ee71 R15: dffffc0000000000 [ 1.601435][ T0] FS: 0000000000000000(0000) GS:ffffffff89abe000(0000) knlGS:0000000000000000 [ 1.602503][ T0] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.603292][ T0] CR2: ffff88843ffff000 CR3: 000000000827f000 CR4: 00000000000406b0 [ 1.604301][ T0] Call Trace: [ 1.604704][ T0] <TASK> [ 1.605070][ T0] assign_lock_key (kernel/locking/lockdep.c:966) [ 1.605641][ T0] register_lock_class (kernel/locking/lockdep.c:?) [ 1.606283][ T0] ? __lock_acquire (kernel/locking/lockdep.c:?) [ 1.606885][ T0] __lock_acquire (kernel/locking/lockdep.c:?) [ 1.607457][ T0] ? __cpuhp_setup_state_cpuslocked (kernel/cpu.c:2099) [ 1.608221][ T0] lock_acquire (kernel/locking/lockdep.c:5666) [ 1.608764][ T0] ? register_syscore_ops (include/linux/list.h:102 drivers/base/syscore.c:24) [ 1.609431][ T0] ? __kasan_check_read (mm/kasan/shadow.c:31) [ 1.610050][ T0] __mutex_lock_common (kernel/locking/mutex.c:603) [ 1.610682][ T0] ? register_syscore_ops (include/linux/list.h:102 drivers/base/syscore.c:24) [ 1.611316][ T0] ? rcu_read_lock_held_common (kernel/rcu/update.c:104) [ 1.611988][ T0] ? lock_release (arch/x86/include/asm/bitops.h:228 arch/x86/include/asm/bitops.h:240 include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:227 kernel/locking/lockdep.c:351 kernel/locking/lockdep.c:5348 kernel/locking/lockdep.c:5686) [ 1.612555][ T0] ? register_syscore_ops (include/linux/list.h:102 drivers/base/syscore.c:24) [ 1.613178][ T0] ? rcu_read_lock_any_held (kernel/rcu/update.c:344) [ 1.613844][ T0] mutex_lock_nested (kernel/locking/mutex.c:747 kernel/locking/mutex.c:799) [ 1.614394][ T0] register_syscore_ops (include/linux/list.h:102 drivers/base/syscore.c:24) [ 1.615010][ T0] kvm_guest_init (arch/x86/kernel/kvm.c:873) [ 1.615603][ T0] setup_arch (arch/x86/kernel/setup.c:1299) [ 1.616127][ T0] start_kernel (init/main.c:953) [ 1.616683][ T0] x86_64_start_reservations (arch/x86/kernel/head64.c:557) [ 1.617354][ T0] x86_64_start_kernel (arch/x86/kernel/head64.c:538) [ 1.617991][ T0] secondary_startup_64_no_verify (??:?) [ 1.618723][ T0] </TASK> [ 1.619100][ T0] irq event stamp: 0 [ 1.619596][ T0] hardirqs last enabled at (0): 0x0 [ 1.620473][ T0] hardirqs last disabled at (0): 0x0 [ 1.621376][ T0] softirqs last enabled at (0): 0x0 [ 1.622287][ T0] softirqs last disabled at (0): 0x0 [ 1.623156][ T0] ---[ end trace 0000000000000000 ]--- [ 1.623917][ T0] [mem 0xc0000000-0xfeffbfff] available for PCI devices [ 1.624731][ T0] Booting paravirtualized kernel on KVM [ 1.625408][ T0] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns [ 1.626742][ T0] setup_percpu: NR_CPUS:64 nr_cpumask_bits:2 nr_cpu_ids:2 nr_node_ids:1
To reproduce:
# build kernel cd linux cp config-6.0.0-rc4-00018-gb9a7ecc71fe5 .config make HOSTCC=clang-14 CC=clang-14 ARCH=x86_64 olddefconfig prepare modules_prepare bzImage modules make HOSTCC=clang-14 CC=clang-14 ARCH=x86_64 INSTALL_MOD_PATH=<mod-install-dir> modules_install cd <mod-install-dir> find lib/ | cpio -o -H newc --quiet | gzip > modules.cgz
git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp qemu -k <bzImage> -m modules.cgz job-script # job-script is attached in this email
# if come across any failure that blocks the test, # please remove ~/.lkp and /lkp dir to run from a clean state.
7,538 lines not shown · raw message
Part of this message is not shown here. View the raw message.
Quoted 5 lines · Yury Norov
The commit
b9a7ecc71fe582e("cpumask: fix checking valid cpu range") fixes brokencpumask_check(), which for now doesn't warn user when it should. After the fix, I observed many false-positive warnings which were addressed in the following patches.
Are all the false positives fixed?
I suspect that to avoid any automation noise, you should just rebase so that the fixes come first. Otherwise we'll end up wasting a lot of time on the noise.
This is not that different from introducing new buil;d-time warnings:
the things they point out need to be fixed before the warning can be integrated, or it causes bisection problems.
Linus
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Yury Norov
The commit
b9a7ecc71fe582e("cpumask: fix checking valid cpu range") fixes brokencpumask_check(), which for now doesn't warn user when it should. After the fix, I observed many false-positive warnings which were addressed in the following patches.Are all the false positives fixed?
I build-tested on x86_64 and arm64. All fixed except for those generated by cpumask_next_wrap(). And I'm not even sure they are false positives.
This is what I'm working on right now. Hope moving it in next merge window.
Quoted 7 lines
I suspect that to avoid any automation noise, you should just rebase so that the fixes come first. Otherwise we'll end up wasting a lot of time on the noise.
This is not that different from introducing new buil;d-time warnings:
the things they point out need to be fixed before the warning can be integrated, or it causes bisection problems.
OK, I'll reorder the patches. Thanks for your help.
Quoted 8 lines · Yury Norov
Quoted 7 lines · Linus Torvalds
Quoted 5 lines · Yury Norov
The commit
b9a7ecc71fe582e("cpumask: fix checking valid cpu range") fixes brokencpumask_check(), which for now doesn't warn user when it should. After the fix, I observed many false-positive warnings which were addressed in the following patches.
Quoted 8 lines
Quoted 1 line
Are all the false positives fixed?
I build-tested on
x86_64and arm64. All fixed except for those generated bycpumask_next_wrap(). And I'm not even sure they are false positives.This is what I'm working on right now. Hope moving it in next merge window.
Hi Yury,
I just wanted to report that the warning fires when doing 'cat /proc/cpuinfo' on at least x86 and riscv. I don't think those are false positives. I'm guessing a patch should be something like the following diff. If you haven't already addressed this and I'm not off in left field, then I guess we should integrate it into your series.
Thanks,
drew
arch/riscv/kernel/cpu.c +6 -3
@@ -166,9 +166,12 @@ static void print_mmu(struct seq_file *f)static void *c_start (struct seq_file *m,loff_t *pos) { - *pos =cpumask_next (*pos -1 , cpu_online_mask); -if ((*pos) < nr_cpu_ids) -return (void *)(uintptr_t )(1 + *pos); +if (*pos < nr_cpu_ids) { + *pos =cpumask_next (*pos -1 , cpu_online_mask); +if ((*pos) < nr_cpu_ids) +return (void *)(uintptr_t )(1 + *pos); + } +return NULL ; }
arch/x86/kernel/cpu/proc.c +6 -3
@@ -153,9 +153,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)static void *c_start (struct seq_file *m,loff_t *pos) { - *pos =cpumask_next (*pos -1 , cpu_online_mask); -if ((*pos) < nr_cpu_ids) -return &cpu_data (*pos); +if (*pos < nr_cpu_ids) { + *pos =cpumask_next (*pos -1 , cpu_online_mask); +if ((*pos) < nr_cpu_ids) +return &cpu_data (*pos); + } +return NULL ; }
Quoted 11 lines
Quoted 8 lines
I suspect that to avoid any automation noise, you should just rebase so that the fixes come first. Otherwise we'll end up wasting a lot of time on the noise.
This is not that different from introducing new buil;d-time warnings:
the things they point out need to be fixed before the warning can be integrated, or it causes bisection problems.OK, I'll reorder the patches. Thanks for your help.
Quoted 11 lines
Hi Yury,
I just wanted to report that the warning fires when doing 'cat
/proc/cpuinfo' on at least x86 and riscv. I don't think those are false positives. I'm guessing a patch should be something like the following diff. If you haven't already addressed this and I'm not off in left field, then I guess we should integrate it into your series.Thanks,
drew
Hi Andrew,
Can you please send it as a patch with a description?
Quoted 6 lines
arch/riscv/kernel/cpu.c +0
-0
arch/riscv/kernel/cpu.c static void print_mmu(struct seq_file *f) · line 171
Quoted 9 lines
arch/riscv/kernel/cpu.c +3
-3@@ -166,9 +166,12 @@ static void print_mmu(struct seq_file *f)static void *c_start (struct seq_file *m,loff_t *pos) { - *pos =cpumask_next (*pos -1 , cpu_online_mask); -if ((*pos) < nr_cpu_ids) -return (void *)(uintptr_t )(1 + *pos); +if (*pos < nr_cpu_ids) { + *pos =cpumask_next (*pos -1 , cpu_online_mask); +if ((*pos) < nr_cpu_ids)
Braces around *pos are not needed.
Quoted 11 lines
arch/riscv/kernel/cpu.c +3
-0+return (void *)(uintptr_t )(1 + *pos); + } +return NULL ; }arch/x86/kernel/cpu/proc.c +0
-0
arch/x86/kernel/cpu/proc.c static int show_cpuinfo(struct seq_file *m, void *v) · line 158
Quoted 9 lines
arch/x86/kernel/cpu/proc.c +3
-3@@ -153,9 +153,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)static void *c_start (struct seq_file *m,loff_t *pos) { - *pos =cpumask_next (*pos -1 , cpu_online_mask); -if ((*pos) < nr_cpu_ids) -return &cpu_data (*pos); +if (*pos < nr_cpu_ids) { + *pos =cpumask_next (*pos -1 , cpu_online_mask); +if ((*pos) < nr_cpu_ids)
Here too.
Thanks,
Yury
Quoted 17 lines
arch/x86/kernel/cpu/proc.c +3
-0+return &cpu_data (*pos); + } +return NULL ; }Quoted 11 lines
Quoted 8 lines
I suspect that to avoid any automation noise, you should just rebase so that the fixes come first. Otherwise we'll end up wasting a lot of time on the noise.
This is not that different from introducing new buil;d-time warnings:
the things they point out need to be fixed before the warning can be integrated, or it causes bisection problems.OK, I'll reorder the patches. Thanks for your help.
Quoted 9 lines · Yury Norov
Quoted 9 lines
Hi Yury,
I just wanted to report that the warning fires when doing 'cat
/proc/cpuinfo' on at least x86 and riscv. I don't think those are false positives. I'm guessing a patch should be something like the following diff. If you haven't already addressed this and I'm not off in left field, then I guess we should integrate it into your series.
Quoted 6 lines
Quoted 2 lines
Thanks,
drewHi Andrew,
Can you please send it as a patch with a description?
Will do. I'll send two patches, one for each arch.
Quoted 8 lines
Quoted 8 lines
arch/riscv/kernel/cpu.c +0
-0@@ -166,9 +166,12 @@ static void print_mmu(struct seq_file *f)
Quoted 10 lines
arch/riscv/kernel/cpu.c static void print_mmu(struct seq_file *f) · line 171
Quoted 8 lines
arch/riscv/kernel/cpu.c +3
-3static void *c_start (struct seq_file *m,loff_t *pos) { - *pos =cpumask_next (*pos -1 , cpu_online_mask); -if ((*pos) < nr_cpu_ids) -return (void *)(uintptr_t )(1 + *pos); +if (*pos < nr_cpu_ids) { + *pos =cpumask_next (*pos -1 , cpu_online_mask); +if ((*pos) < nr_cpu_ids)Braces around *pos are not needed.
The braces were preexisting, but I'll drop them while indenting.
Thanks,
drew
Quoted 44 lines
Quoted 12 lines
arch/riscv/kernel/cpu.c +3
-0+return (void *)(uintptr_t )(1 + *pos); + } +return NULL ; }arch/x86/kernel/cpu/proc.c +0
-0arch/x86/kernel/cpu/proc.c static int show_cpuinfo(struct seq_file *m, void *v) · line 158
Quoted 9 lines
arch/x86/kernel/cpu/proc.c +3
-3@@ -153,9 +153,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)static void *c_start (struct seq_file *m,loff_t *pos) { - *pos =cpumask_next (*pos -1 , cpu_online_mask); -if ((*pos) < nr_cpu_ids) -return &cpu_data (*pos); +if (*pos < nr_cpu_ids) { + *pos =cpumask_next (*pos -1 , cpu_online_mask); +if ((*pos) < nr_cpu_ids)Here too.
Thanks,
YuryQuoted 17 lines
arch/x86/kernel/cpu/proc.c +3
-0+return &cpu_data (*pos); + } +return NULL ; }Quoted 11 lines
Quoted 8 lines
I suspect that to avoid any automation noise, you should just rebase so that the fixes come first. Otherwise we'll end up wasting a lot of time on the noise.
This is not that different from introducing new buil;d-time warnings:
the things they point out need to be fixed before the warning can be integrated, or it causes bisection problems.OK, I'll reorder the patches. Thanks for your help.
Quoted 9 lines · Yury Norov
Quoted 9 lines
Hi Yury,
I just wanted to report that the warning fires when doing 'cat
/proc/cpuinfo' on at least x86 and riscv. I don't think those are false positives. I'm guessing a patch should be something like the following diff. If you haven't already addressed this and I'm not off in left field, then I guess we should integrate it into your series.
Quoted 6 lines
Quoted 2 lines
Thanks,
drewHi Andrew,
Can you please send it as a patch with a description?
Also, can you describe why we'd silence the warning this way? If the cpu number greater than nr_cpu_ids comes from upper layer, we quite probably should investigate what happens there...
Thanks,
Yury
Quoted 13 lines · Yury Norov
Quoted 12 lines · Yury Norov
Quoted 11 lines
Hi Yury,
I just wanted to report that the warning fires when doing 'cat
/proc/cpuinfo' on at least x86 and riscv. I don't think those are false positives. I'm guessing a patch should be something like the following diff. If you haven't already addressed this and I'm not off in left field, then I guess we should integrate it into your series.Thanks,
drew
Quoted 7 lines
Quoted 3 lines
Hi Andrew,
Can you please send it as a patch with a description?
Also, can you describe why we'd silence the warning this way? If the cpu number greater than
nr_cpu_idscomes from upper layer, we quite probably should investigate what happens there...
Darn, I fired off the patches before reading this. I didn't try to completely digest seq_read_iter(), but on a quick look I think the reason is that it implements something like
p = start();
while (1) {
p = next();
if (!p)
break;
show();
}
stop();where cpuinfo's operators are
start()
{
*pos = cpumask_next(*pos - 1, cpu_online_mask);
if (*pos < nr_cpu_ids)
return ...;
return NULL;}
next()
{
(*pos)++;
return start(..., pos);
}
So the justification for the patches the way I've written them is that I think we just need to return NULL from start / next when we've gone too far, before we first warn and then return NULL.
Thanks,
drew