Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/hyperv: Fix usage of cpu_online_mask to get valid cpu

Accessing cpu_online_mask here is problematic because the cpus read lock
is not held in this context.

However, cpu_online_mask isn't needed here since the effective affinity
mask is guaranteed to be valid in this callback. So, just use
cpumask_first() to get the cpu instead of ANDing it with cpus_online_mask
unnecessarily.

Fixes: e39397d1fd68 ("x86/hyperv: implement an MSI domain for root partition")
Reported-by: Michael Kelley <mhklinux@outlook.com>
Closes: https://lore.kernel.org/linux-hyperv/SN6PR02MB4157639630F8AD2D8FD8F52FD475A@SN6PR02MB4157.namprd02.prod.outlook.com/
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/1751582677-30930-4-git-send-email-nunodasneves@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1751582677-30930-4-git-send-email-nunodasneves@linux.microsoft.com>

authored by

Nuno Das Neves and committed by
Wei Liu
bb169f80 f84b21da

+1 -3
+1 -3
arch/x86/hyperv/irqdomain.c
··· 193 193 struct pci_dev *dev; 194 194 struct hv_interrupt_entry out_entry, *stored_entry; 195 195 struct irq_cfg *cfg = irqd_cfg(data); 196 - const cpumask_t *affinity; 197 196 int cpu; 198 197 u64 status; 199 198 ··· 204 205 return; 205 206 } 206 207 207 - affinity = irq_data_get_effective_affinity_mask(data); 208 - cpu = cpumask_first_and(affinity, cpu_online_mask); 208 + cpu = cpumask_first(irq_data_get_effective_affinity_mask(data)); 209 209 210 210 if (data->chip_data) { 211 211 /*