]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/hyperv: Fix usage of cpu_online_mask to get valid cpu
authorNuno Das Neves <nunodasneves@linux.microsoft.com>
Thu, 3 Jul 2025 22:44:34 +0000 (15:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2025 08:51:24 +0000 (09:51 +0100)
commit9a5ad614da20a19ba0747d009b9a09d0cc8450f8
treed5cf9094011a235e454e1b997131e65666332b42
parentcc2a4e0d496d57a0fc37e9eb990b28e0d0986669
x86/hyperv: Fix usage of cpu_online_mask to get valid cpu

[ Upstream commit bb169f80ed5a156ec3405e0e49c6b8e9ae264718 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/hyperv/irqdomain.c