[PATCH v3 1/5] x86/hyperv: Reject unrepresentable TLB flush VP sets
From: Naman Jain
Date: Mon Nov 30 2026 - 23:37:01 EST
cpumask_to_vpset_skip() returns zero if hv_max_vp_index is at least
4096, beyond the range of its sparse VP set. Treat zero as an error
instead of issuing an extended flush with an empty target set.
This makes hyperv_flush_tlb_multi() fall back to native flushing,
matching the extended IPI path.
This is a defensive check and the issue is not seen in practice.
Signed-off-by: Naman Jain <namjain@xxxxxxxxxxxxxxxxxxx>
---
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;
/*
base-commit: e5aad2bdbbee783611d32599f89cea3f12f9593d
--
2.43.0