[PATCH v2 1/5] x86/hyperv: Reject unrepresentable TLB flush VP sets

From
Naman Jain <hidden>
Date
2026-11-17 09:15:25
Also in
lkml
Reply to
Naman Jain, 2026-11-17
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 <redacted>
---
 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
Thread (7 messages) 7 messages, 2 authors, last reply 11h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help