From: Naman Jain <namjain@linux.microsoft.com>
To: haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, luto@kernel.org,
peterz@infradead.org
Cc: dave.hansen@intel.com, hpa@zytor.com, riel@surriel.com,
mhklinux@outlook.com, schandna@linux.microsoft.com,
namjain@linux.microsoft.com, qq570070308@gmail.com,
houwenlong.hwl@antgroup.com, zhouchuyi@bytedance.com,
jgross@suse.com, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 1/5] x86/hyperv: Reject unrepresentable TLB flush VP sets
Date: Tue, 1 Dec 2026 04:36:38 +0000 [thread overview]
Message-ID: <20261201043642.1054258-2-namjain@linux.microsoft.com> (raw)
In-Reply-To: <20261201043642.1054258-1-namjain@linux.microsoft.com>
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@linux.microsoft.com>
---
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
next prev parent reply other threads:[~2026-12-01 4:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 4:36 [PATCH v3 0/5] x86/hyperv: Account for lazy mm_cpumask maintenance Naman Jain
2026-12-01 4:36 ` Naman Jain [this message]
2026-12-01 4:36 ` [PATCH v3 2/5] x86/tlb: Make should_flush_tlb() available to Hyper-V Naman Jain
2026-12-01 4:36 ` [PATCH v3 3/5] x86/hyperv: Use native flushes for mask trimming and ASID transitions Naman Jain
2026-12-01 4:36 ` [PATCH v3 4/5] x86/hyperv: Filter TLB targets before building hypercalls Naman Jain
2026-12-01 4:36 ` [PATCH v3 5/5] x86/hyperv: Request mask cleanup when no remote target remains Naman Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201043642.1054258-2-namjain@linux.microsoft.com \
--to=namjain@linux.microsoft.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=houwenlong.hwl@antgroup.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mhklinux@outlook.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=qq570070308@gmail.com \
--cc=riel@surriel.com \
--cc=schandna@linux.microsoft.com \
--cc=tglx@kernel.org \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.org \
--cc=zhouchuyi@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®