<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/x86/include/asm/vmware.h, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-02-06T22:51:03+00:00</updated>
<entry>
<title>x86/vmware: Fix hypercall clobbers</title>
<updated>2026-02-06T22:51:03+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2026-02-06T22:24:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2687c848e57820651b9f69d30c4710f4219f7dbf'/>
<id>urn:sha1:2687c848e57820651b9f69d30c4710f4219f7dbf</id>
<content type='text'>
Fedora QA reported the following panic:

  BUG: unable to handle page fault for address: 0000000040003e54
  #PF: supervisor write access in kernel mode
  #PF: error_code(0x0002) - not-present page
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20251119-3.fc43 11/19/2025
  RIP: 0010:vmware_hypercall4.constprop.0+0x52/0x90
  ..
  Call Trace:
   vmmouse_report_events+0x13e/0x1b0
   psmouse_handle_byte+0x15/0x60
   ps2_interrupt+0x8a/0xd0
   ...

because the QEMU VMware mouse emulation is buggy, and clears the top 32
bits of %rdi that the kernel kept a pointer in.

The QEMU vmmouse driver saves and restores the register state in a
"uint32_t data[6];" and as a result restores the state with the high
bits all cleared.

RDI originally contained the value of a valid kernel stack address
(0xff5eeb3240003e54).  After the vmware hypercall it now contains
0x40003e54, and we get a page fault as a result when it is dereferenced.

The proper fix would be in QEMU, but this works around the issue in the
kernel to keep old setups working, when old kernels had not happened to
keep any state in %rdi over the hypercall.

In theory this same issue exists for all the hypercalls in the vmmouse
driver; in practice it has only been seen with vmware_hypercall3() and
vmware_hypercall4().  For now, just mark RDI/RSI as clobbered for those
two calls.  This should have a minimal effect on code generation overall
as it should be rare for the compiler to want to make RDI/RSI live
across hypercalls.

Reported-by: Justin Forbes &lt;jforbes@fedoraproject.org&gt;
Link: https://lore.kernel.org/all/99a9c69a-fc1a-43b7-8d1e-c42d6493b41f@broadcom.com/
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86/vmware: Add TDX hypercall support</title>
<updated>2024-06-25T15:15:48+00:00</updated>
<author>
<name>Alexey Makhalov</name>
<email>alexey.makhalov@broadcom.com</email>
</author>
<published>2024-06-13T19:16:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=57b7b6acb41b51087ceb40c562efe392ec8c9677'/>
<id>urn:sha1:57b7b6acb41b51087ceb40c562efe392ec8c9677</id>
<content type='text'>
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions.  Add a call to
__tdx_hypercall() in order to support TDX guests.

No change in high bandwidth hypercalls, as only low bandwidth ones are supported
for TDX guests.

  [ bp: Massage, clear on-stack struct tdx_module_args variable. ]

Co-developed-by: Tim Merrifield &lt;tim.merrifield@broadcom.com&gt;
Signed-off-by: Tim Merrifield &lt;tim.merrifield@broadcom.com&gt;
Signed-off-by: Alexey Makhalov &lt;alexey.makhalov@broadcom.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20240613191650.9913-9-alexey.makhalov@broadcom.com
</content>
</entry>
<entry>
<title>x86/vmware: Remove legacy VMWARE_HYPERCALL* macros</title>
<updated>2024-06-25T15:15:48+00:00</updated>
<author>
<name>Alexey Makhalov</name>
<email>alexey.makhalov@broadcom.com</email>
</author>
<published>2024-06-13T19:16:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9dfb18031f0df2378b3d33a13fc485ef89caa285'/>
<id>urn:sha1:9dfb18031f0df2378b3d33a13fc485ef89caa285</id>
<content type='text'>
No more direct use of these macros should be allowed. The vmware_hypercallX API
still uses the new implementation of VMWARE_HYPERCALL macro internally, but it
is not exposed outside of the vmware.h.

Signed-off-by: Alexey Makhalov &lt;alexey.makhalov@broadcom.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20240613191650.9913-8-alexey.makhalov@broadcom.com
</content>
</entry>
<entry>
<title>x86/vmware: Introduce VMware hypercall API</title>
<updated>2024-06-25T15:01:33+00:00</updated>
<author>
<name>Alexey Makhalov</name>
<email>alexey.makhalov@broadcom.com</email>
</author>
<published>2024-06-13T19:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34bf25e820ae1ab38f9cd88834843ba76678a2fd'/>
<id>urn:sha1:34bf25e820ae1ab38f9cd88834843ba76678a2fd</id>
<content type='text'>
Introduce a vmware_hypercall family of functions. It is a common implementation
to be used by the VMware guest code and virtual device drivers in architecture
independent manner.

The API consists of vmware_hypercallX and vmware_hypercall_hb_{out,in}
set of functions analogous to KVM's hypercall API. Architecture-specific
implementation is hidden inside.

It will simplify future enhancements in VMware hypercalls such as SEV-ES and
TDX related changes without needs to modify a caller in device drivers code.

Current implementation extends an idea from

  bac7b4e84323 ("x86/vmware: Update platform detection code for VMCALL/VMMCALL hypercalls")

to have a slow, but safe path vmware_hypercall_slow() earlier during the boot
when alternatives are not yet applied.  The code inherits VMWARE_CMD logic from
the commit mentioned above.

Move common macros from vmware.c to vmware.h.

  [ bp: Fold in a fix:
    https://lore.kernel.org/r/20240625083348.2299-1-alexey.makhalov@broadcom.com ]

Signed-off-by: Alexey Makhalov &lt;alexey.makhalov@broadcom.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20240613191650.9913-2-alexey.makhalov@broadcom.com
</content>
</entry>
<entry>
<title>x86/cpu/vmware: Fix platform detection VMWARE_PORT macro</title>
<updated>2019-10-21T22:51:44+00:00</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2019-10-21T17:24:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6fee2a0be0ecae939d4b6cd8297d88b5cbb61654'/>
<id>urn:sha1:6fee2a0be0ecae939d4b6cd8297d88b5cbb61654</id>
<content type='text'>
The platform detection VMWARE_PORT macro uses the VMWARE_HYPERVISOR_PORT
definition, but expects it to be an integer. However, when it was moved
to the new vmware.h include file, it was changed to be a string to better
fit into the VMWARE_HYPERCALL set of macros. This obviously breaks the
platform detection VMWARE_PORT functionality.

Change the VMWARE_HYPERVISOR_PORT and VMWARE_HYPERVISOR_PORT_HB
definitions to be integers, and use __stringify() for their stringified
form when needed.

Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sean Christopherson &lt;sean.j.christopherson@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Fixes: b4dd4f6e3648 ("Add a header file for hypercall definitions")
Link: https://lkml.kernel.org/r/20191021172403.3085-3-thomas_os@shipmail.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/cpu/vmware: Use the full form of INL in VMWARE_HYPERCALL, for clang/llvm</title>
<updated>2019-10-21T22:51:44+00:00</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2019-10-21T17:24:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=db633a4e0e6eda69b6065e3e106f9ea13a0676c3'/>
<id>urn:sha1:db633a4e0e6eda69b6065e3e106f9ea13a0676c3</id>
<content type='text'>
LLVM's assembler doesn't accept the short form INL instruction:

  inl (%%dx)

but instead insists on the output register to be explicitly specified.

This was previously fixed for the VMWARE_PORT macro. Fix it also for
the VMWARE_HYPERCALL macro.

Suggested-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sean Christopherson &lt;sean.j.christopherson@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: clang-built-linux@googlegroups.com
Fixes: b4dd4f6e3648 ("Add a header file for hypercall definitions")
Link: https://lkml.kernel.org/r/20191021172403.3085-2-thomas_os@shipmail.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/vmware: Add a header file for hypercall definitions</title>
<updated>2019-08-28T11:32:06+00:00</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2019-08-28T08:03:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b4dd4f6e3648dfd66576515f2222d885a9a765c0'/>
<id>urn:sha1:b4dd4f6e3648dfd66576515f2222d885a9a765c0</id>
<content type='text'>
The new header is intended to be used by drivers using the backdoor.
Follow the KVM example using alternatives self-patching to choose
between vmcall, vmmcall and io instructions.

Also define two new CPU feature flags to indicate hypervisor support
for vmcall- and vmmcall instructions. The new XF86_FEATURE_VMW_VMMCALL
flag is needed because using XF86_FEATURE_VMMCALL might break QEMU/KVM
setups using the vmmouse driver. They rely on XF86_FEATURE_VMMCALL
on AMD to get the kvm_hypercall() right. But they do not yet implement
vmmcall for the VMware hypercall used by the vmmouse driver.

 [ bp: reflow hypercall %edx usage explanation comment. ]

Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Doug Covelli &lt;dcovelli@vmware.com&gt;
Cc: Aaron Lewis &lt;aaronlewis@google.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: linux-graphics-maintainer@vmware.com
Cc: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Cc: Robert Hoo &lt;robert.hu@linux.intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: virtualization@lists.linux-foundation.org
Cc: &lt;pv-drivers@vmware.com&gt;
Cc: x86-ml &lt;x86@kernel.org&gt;
Link: https://lkml.kernel.org/r/20190828080353.12658-3-thomas_os@shipmail.org
</content>
</entry>
<entry>
<title>x86: Clean up the hypervisor layer</title>
<updated>2010-05-08T00:13:04+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2010-05-07T23:57:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e08cae4181af9483b04ecfac48f01c8e5a5f27bf'/>
<id>urn:sha1:e08cae4181af9483b04ecfac48f01c8e5a5f27bf</id>
<content type='text'>
Clean up the hypervisor layer and the hypervisor drivers, using an ops
structure instead of an enumeration with if statements.

The identity of the hypervisor, if needed, can be tested by testing
the pointer value in x86_hyper.

The MS-HyperV private state is moved into a normal global variable
(it's per-system state, not per-CPU state).  Being a normal bss
variable, it will be left at all zero on non-HyperV platforms, and so
can generally be tested for HyperV-specific features without
additional qualification.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Acked-by: Greg KH &lt;greg@kroah.com&gt;
Cc: Hank Janssen &lt;hjanssen@microsoft.com&gt;
Cc: Alok Kataria &lt;akataria@vmware.com&gt;
Cc: Ky Srinivasan &lt;ksrinivasan@novell.com&gt;
LKML-Reference: &lt;4BE49778.6060800@zytor.com&gt;
</content>
</entry>
<entry>
<title>x86: Move tsc_calibration to x86_init_ops</title>
<updated>2009-08-31T07:35:47+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-08-20T15:06:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2d826404f0bdcac2a4dd7e3c446b70d6a3b63b78'/>
<id>urn:sha1:2d826404f0bdcac2a4dd7e3c446b70d6a3b63b78</id>
<content type='text'>
TSC calibration is modified by the vmware hypervisor and paravirt by
separate means. Moorestown wants to add its own calibration routine as
well. So make calibrate_tsc a proper x86_init_ops function and
override it by paravirt or by the early setup of the vmware
hypervisor.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>x86: Add a synthetic TSC_RELIABLE feature bit.</title>
<updated>2008-11-02T01:58:01+00:00</updated>
<author>
<name>Alok Kataria</name>
<email>akataria@vmware.com</email>
</author>
<published>2008-10-31T19:01:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eca0cd028bdf0f6aaceb0d023e9c7501079a7dda'/>
<id>urn:sha1:eca0cd028bdf0f6aaceb0d023e9c7501079a7dda</id>
<content type='text'>
Impact: Changes timebase calibration on Vmware.

Use the synthetic TSC_RELIABLE bit to workaround virtualization anomalies.

Virtual TSCs can be kept nearly in sync, but because the virtual TSC
offset is set by software, it's not perfect.  So, the TSC
synchronization test can fail. Even then the TSC can be used as a
clocksource since the VMware platform exports a reliable TSC to the
guest for timekeeping purposes. Use this bit to check if we need to
skip the TSC sync checks.

Along with this also set the CONSTANT_TSC bit when on VMware, since we
still want to use TSC as clocksource on VM running over hardware which
has unsynchronized TSC's (opteron's), since the hypervisor will take
care of providing consistent TSC to the guest.

Signed-off-by: Alok N Kataria &lt;akataria@vmware.com&gt;
Signed-off-by: Dan Hecht &lt;dhecht@vmware.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
</feed>
