The VP-set conversion helper returns zero when it cannot represent the maximum VP index. Treat zero as an error, just like negative results, rather than issuing an extended flush with an empty target set.
This lets the caller fall back to native flushing, as the extended IPI path already does. Filtering a mask that initially includes all present CPUs can make it use this conversion instead of the all-processors shortcut. Signed-off-by: Naman Jain <[email protected]> --- arch/x86/hyperv/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c index cfcb60468b01c..1ea57d642faa4 100644 --- a/arch/x86/hyperv/mmu.c +++ b/arch/x86/hyperv/mmu.c @@ -199,7 +199,7 @@ static u64 hyperv_flush_tlb_others_ex(const struct cpumask *cpus, flush->hv_vp_set.format = HV_GENERIC_SET_SPARSE_4K; nr_bank = cpumask_to_vpset_skip(&flush->hv_vp_set, cpus, info->freed_tables ? NULL : cpu_is_lazy); - if (nr_bank < 0) + if (nr_bank <= 0) return HV_STATUS_INVALID_PARAMETER; /* -- 2.43.0
