<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/arch/x86/kernel/cpu/vmware.c, branch linux-rolling-stable</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>x86/vmware: Parse MP tables for SEV-SNP enabled guests under VMware hypervisors</title>
<updated>2025-03-22T19:56:58+00:00</updated>
<author>
<name>Ajay Kaher</name>
<email>ajay.kaher@broadcom.com</email>
</author>
<published>2025-03-13T17:31:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=09f196098a4786e6164ae82bb0bbe35da9992700'/>
<id>09f196098a4786e6164ae82bb0bbe35da9992700</id>
<content type='text'>
[ Upstream commit a2ab25529bbcea51b5e01dded79f45aeb94f644a ]

Under VMware hypervisors, SEV-SNP enabled VMs are fundamentally able to boot
without UEFI, but this regressed a year ago due to:

  0f4a1e80989a ("x86/sev: Skip ROM range scans and validation for SEV-SNP guests")

In this case, mpparse_find_mptable() has to be called to parse MP
tables which contains the necessary boot information.

[ mingo: Updated the changelog. ]

Fixes: 0f4a1e80989a ("x86/sev: Skip ROM range scans and validation for SEV-SNP guests")
Co-developed-by: Ye Li &lt;ye.li@broadcom.com&gt;
Signed-off-by: Ye Li &lt;ye.li@broadcom.com&gt;
Signed-off-by: Ajay Kaher &lt;ajay.kaher@broadcom.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Tested-by: Ye Li &lt;ye.li@broadcom.com&gt;
Reviewed-by: Kevin Loughlin &lt;kevinloughlin@google.com&gt;
Acked-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20250313173111.10918-1-ajay.kaher@broadcom.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit a2ab25529bbcea51b5e01dded79f45aeb94f644a ]

Under VMware hypervisors, SEV-SNP enabled VMs are fundamentally able to boot
without UEFI, but this regressed a year ago due to:

  0f4a1e80989a ("x86/sev: Skip ROM range scans and validation for SEV-SNP guests")

In this case, mpparse_find_mptable() has to be called to parse MP
tables which contains the necessary boot information.

[ mingo: Updated the changelog. ]

Fixes: 0f4a1e80989a ("x86/sev: Skip ROM range scans and validation for SEV-SNP guests")
Co-developed-by: Ye Li &lt;ye.li@broadcom.com&gt;
Signed-off-by: Ye Li &lt;ye.li@broadcom.com&gt;
Signed-off-by: Ajay Kaher &lt;ajay.kaher@broadcom.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Tested-by: Ye Li &lt;ye.li@broadcom.com&gt;
Reviewed-by: Kevin Loughlin &lt;kevinloughlin@google.com&gt;
Acked-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20250313173111.10918-1-ajay.kaher@broadcom.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</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.tavy.me/linux-stable.git/commit/?id=57b7b6acb41b51087ceb40c562efe392ec8c9677'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/vmware: Correct macro names</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:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=86cb65448d07fe516e18d9512ae5786cd90db9bf'/>
<id>86cb65448d07fe516e18d9512ae5786cd90db9bf</id>
<content type='text'>
VCPU_RESERVED and LEGACY_X2APIC are not VMware hypercall commands.  These are
bits in the return value of the VMWARE_CMD_GETVCPU_INFO command.  Change
VMWARE_CMD_ prefix to GETVCPU_INFO_ one. And move the bit-shift
operation into the macro body.

Fixes: 4cca6ea04d31c ("x86/apic: Allow x2apic without IR on VMware platform")
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-7-alexey.makhalov@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
VCPU_RESERVED and LEGACY_X2APIC are not VMware hypercall commands.  These are
bits in the return value of the VMWARE_CMD_GETVCPU_INFO command.  Change
VMWARE_CMD_ prefix to GETVCPU_INFO_ one. And move the bit-shift
operation into the macro body.

Fixes: 4cca6ea04d31c ("x86/apic: Allow x2apic without IR on VMware platform")
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-7-alexey.makhalov@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/vmware: Use VMware hypercall API</title>
<updated>2024-06-25T15:15:47+00:00</updated>
<author>
<name>Alexey Makhalov</name>
<email>alexey.makhalov@broadcom.com</email>
</author>
<published>2024-06-13T19:16:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b2c13c23ea9c1f748315b8c2c028bb3ae18f1e12'/>
<id>b2c13c23ea9c1f748315b8c2c028bb3ae18f1e12</id>
<content type='text'>
Remove VMWARE_CMD macro and move to vmware_hypercall API.
No functional changes intended.

Use u32/u64 instead of uint32_t/uint64_t across the file.

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-6-alexey.makhalov@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove VMWARE_CMD macro and move to vmware_hypercall API.
No functional changes intended.

Use u32/u64 instead of uint32_t/uint64_t across the file.

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-6-alexey.makhalov@broadcom.com
</pre>
</div>
</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.tavy.me/linux-stable.git/commit/?id=34bf25e820ae1ab38f9cd88834843ba76678a2fd'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>sched/clock/x86: Mark sched_clock() noinstr</title>
<updated>2023-01-31T14:01:47+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2023-01-26T15:08:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8739c6811572b087decd561f96382087402cc343'/>
<id>8739c6811572b087decd561f96382087402cc343</id>
<content type='text'>
In order to use sched_clock() from noinstr code, mark it and all it's
implenentations noinstr.

The whole pvclock thing (used by KVM/Xen) is a bit of a pain,
since it calls out to watchdogs, create a
pvclock_clocksource_read_nowd() variant doesn't do that and can be
noinstr.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: https://lore.kernel.org/r/20230126151323.702003578@infradead.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to use sched_clock() from noinstr code, mark it and all it's
implenentations noinstr.

The whole pvclock thing (used by KVM/Xen) is a bit of a pain,
since it calls out to watchdogs, create a
pvclock_clocksource_read_nowd() variant doesn't do that and can be
noinstr.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: https://lore.kernel.org/r/20230126151323.702003578@infradead.org
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/vmware: Use BIT() macro for shifting</title>
<updated>2022-06-22T09:23:14+00:00</updated>
<author>
<name>Shreenidhi Shedi</name>
<email>sshedi@vmware.com</email>
</author>
<published>2022-06-01T10:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4745ca43104b422354f06dc814d3f13661f217af'/>
<id>4745ca43104b422354f06dc814d3f13661f217af</id>
<content type='text'>
VMWARE_CMD_VCPU_RESERVED is bit 31 and that would mean undefined
behavior when shifting an int but the kernel is built with
-fno-strict-overflow which will wrap around using two's complement.

Use the BIT() macro to improve readability and avoid any potential
overflow confusion because it uses an unsigned long.

  [ bp: Clarify commit message. ]

Signed-off-by: Shreenidhi Shedi &lt;sshedi@vmware.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Srivatsa S. Bhat (VMware) &lt;srivatsa@csail.mit.edu&gt;
Link: https://lore.kernel.org/r/20220601101820.535031-1-sshedi@vmware.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
VMWARE_CMD_VCPU_RESERVED is bit 31 and that would mean undefined
behavior when shifting an int but the kernel is built with
-fno-strict-overflow which will wrap around using two's complement.

Use the BIT() macro to improve readability and avoid any potential
overflow confusion because it uses an unsigned long.

  [ bp: Clarify commit message. ]

Signed-off-by: Shreenidhi Shedi &lt;sshedi@vmware.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Srivatsa S. Bhat (VMware) &lt;srivatsa@csail.mit.edu&gt;
Link: https://lore.kernel.org/r/20220601101820.535031-1-sshedi@vmware.com
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'x86_vmware_for_v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2021-04-26T16:13:43+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-04-26T16:13:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=47e12f14108170c36af9a0ee2271abb3dfb73e0e'/>
<id>47e12f14108170c36af9a0ee2271abb3dfb73e0e</id>
<content type='text'>
Pull x86 vmware guest update from Borislav Petkov:
 "Have vmware guests skip the refined TSC calibration when the TSC
  frequency has been retrieved from the hypervisor"

* tag 'x86_vmware_for_v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/vmware: Avoid TSC recalibration when frequency is known
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull x86 vmware guest update from Borislav Petkov:
 "Have vmware guests skip the refined TSC calibration when the TSC
  frequency has been retrieved from the hypervisor"

* tag 'x86_vmware_for_v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/vmware: Avoid TSC recalibration when frequency is known
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/vmware: Avoid TSC recalibration when frequency is known</title>
<updated>2021-03-28T19:11:43+00:00</updated>
<author>
<name>Alexey Makhalov</name>
<email>amakhalov@vmware.com</email>
</author>
<published>2021-01-05T00:47:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0b4a285e2c65c2c9449c6eccb87298e385213e7b'/>
<id>0b4a285e2c65c2c9449c6eccb87298e385213e7b</id>
<content type='text'>
When the TSC frequency is known because it is retrieved from the
hypervisor, skip TSC refined calibration by setting X86_FEATURE_TSC_KNOWN_FREQ.

Signed-off-by: Alexey Makhalov &lt;amakhalov@vmware.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210105004752.131069-1-amakhalov@vmware.com

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the TSC frequency is known because it is retrieved from the
hypervisor, skip TSC refined calibration by setting X86_FEATURE_TSC_KNOWN_FREQ.

Signed-off-by: Alexey Makhalov &lt;amakhalov@vmware.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210105004752.131069-1-amakhalov@vmware.com

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/paravirt: Switch time pvops functions to use static_call()</title>
<updated>2021-03-11T15:17:52+00:00</updated>
<author>
<name>Juergen Gross</name>
<email>jgross@suse.com</email>
</author>
<published>2021-03-11T14:23:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a0e2bf7cb7006b5a58ee81f4da4fe575875f2781'/>
<id>a0e2bf7cb7006b5a58ee81f4da4fe575875f2781</id>
<content type='text'>
The time pvops functions are the only ones left which might be
used in 32-bit mode and which return a 64-bit value.

Switch them to use the static_call() mechanism instead of pvops, as
this allows quite some simplification of the pvops implementation.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20210311142319.4723-5-jgross@suse.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The time pvops functions are the only ones left which might be
used in 32-bit mode and which return a 64-bit value.

Switch them to use the static_call() mechanism instead of pvops, as
this allows quite some simplification of the pvops implementation.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20210311142319.4723-5-jgross@suse.com
</pre>
</div>
</content>
</entry>
</feed>
