On Wed, 25 Jun 2025 15:53:19 +0200, Manuel Andreas wrote:
In KVM guests with Hyper-V hypercalls enabled, the hypercalls
HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST and HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX
allow a guest to request invalidation of portions of a virtual TLB.
For this, the hypercall parameter includes a list of GVAs that are supposed
to be invalidated.
However, when non-canonical GVAs are passed, there is currently no
filtering in place and they are eventually passed to checked invocations of
INVVPID on Intel / INVLPGA on AMD.
While the AMD variant (INVLPGA) will silently ignore the non-canonical
address and perform a no-op, the Intel variant (INVVPID) will fail and end
up in invvpid_error, where a WARN_ONCE is triggered:
[...]
Applied to kvm-x86 fixes, with a massaged changelog, e.g. to call out that
"real" Hyper-V behaves this way. Thanks!
[1/1] x86/hyper-v: Filter non-canonical addresses passed via HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST(_EX)
https://github.com/kvm-x86/linux/commit/fa787ac07b3c