[PATCH net-next 5/5] hv_netvsc: Don't assume cpu_possible_mask is dense

2024-10-02 Thread mhkelley58
From: Michael Kelley Current code allocates the pcpu_sum array with size num_possible_cpus(). This code assumes the cpu_possible_mask is dense, which is not true in the general case per [1]. If cpu_possible_mask is sparse, the array might be indexed by a value beyond the size of the array. Howev

[PATCH 4/5] scsi: storvsc: Don't assume cpu_possible_mask is dense

2024-10-02 Thread mhkelley58
From: Michael Kelley Current code allocates the stor_chns array with size num_possible_cpus(). This code assumes cpu_possible_mask is dense, which is not true in the general case per [1]. If cpu_possible_mask is sparse, the array might be indexed by a value beyond the size of the array. However,

[PATCH 3/5] iommu/hyper-v: Don't assume cpu_possible_mask is dense

2024-10-02 Thread mhkelley58
From: Michael Kelley Current code gets the APIC IDs for CPUs numbered 255 and lower. This code assumes cpu_possible_mask is dense, which is not true in the general case per [1]. If cpu_possible_mask contains holes, num_possible_cpus() is less than nr_cpu_ids, so some CPUs might get skipped. Furth

[PATCH 2/5] Drivers: hv: Don't assume cpu_possible_mask is dense

2024-10-02 Thread mhkelley58
From: Michael Kelley Current code allocates the hv_vp_index array with size num_possible_cpus(). This code assumes cpu_possible_mask is dense, which is not true in the general case per [1]. If cpu_possible_mask is sparse, the array might be indexed by a value beyond the size of the array. Howeve

[PATCH 1/5] x86/hyperv: Don't assume cpu_possible_mask is dense

2024-10-02 Thread mhkelley58
From: Michael Kelley Current code allocates the hv_vp_assist_page array with size num_possible_cpus(). This code assumes cpu_possible_mask is dense, which is not true in the general case per [1]. If cpu_possible_mask is sparse, the array might be indexed by a value beyond the size of the array.

[PATCH 0/5] hyper-v: Don't assume cpu_possible_mask is dense

2024-10-02 Thread mhkelley58
From: Michael Kelley Code specific to Hyper-V guests currently assumes the cpu_possible_mask is "dense" -- i.e., all bit positions 0 thru (nr_cpu_ids - 1) are set, with no "holes". Therefore, num_possible_cpus() is assumed to be equal to nr_cpu_ids. Per a separate discussion[1], this assumption