Skip to content

Commit 0f0caa5

Browse files
vittyvkKAGA-KOKO
authored andcommitted
x86/hyper-v: Check cpumask_to_vpset() return value in hyperv_flush_tlb_others_ex()
Commit 1268ed0 ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") made cpumask_to_vpset() return '-1' when there is a CPU with unknown VP index in the supplied set. This needs to be checked before we pass 'nr_bank' to hypercall. Fixes: 1268ed0 ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") Signed-off-by: Vitaly Kuznetsov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Cc: "K. Y. Srinivasan" <[email protected]> Cc: Haiyang Zhang <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: "Michael Kelley (EOSG)" <[email protected]> Cc: [email protected] Cc: "H. Peter Anvin" <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8f63e92 commit 0f0caa5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/hyperv/mmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ static u64 hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
186186

187187
flush->hv_vp_set.format = HV_GENERIC_SET_SPARSE_4K;
188188
nr_bank = cpumask_to_vpset(&(flush->hv_vp_set), cpus);
189+
if (nr_bank < 0)
190+
return U64_MAX;
189191

190192
/*
191193
* We can flush not more than max_gvas with one hypercall. Flush the

0 commit comments

Comments
 (0)