Re: [PATCH v6 7/7] x86/vmware: Add TDX hypercall support

2024-01-22 Thread Alexey Makhalov
On 1/22/24 10:28 AM, H. Peter Anvin wrote: On January 22, 2024 8:32:22 AM PST, Dave Hansen wrote: On 1/9/24 00:40, Alexey Makhalov wrote: +#ifdef CONFIG_INTEL_TDX_GUEST +unsigned long vmware_tdx_hypercall(unsigned long cmd, + struct tdx_module_args *args

Re: [PATCH v3 6/6] x86/vmware: Add TDX hypercall support

2023-12-19 Thread Alexey Makhalov
On 12/19/23 3:23 PM, kirill.shute...@linux.intel.com wrote: On Tue, Dec 19, 2023 at 01:57:51PM -0800, Alexey Makhalov wrote: diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 3aa1adaed18f..ef07ab7a07e1 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86

Re: [PATCH v3 2/6] x86/vmware: Introduce vmware_hypercall API

2023-12-19 Thread Alexey Makhalov
On 12/19/23 4:51 PM, kirill.shute...@linux.intel.com wrote: On Tue, Dec 19, 2023 at 04:17:40PM -0800, Alexey Makhalov wrote: On 12/19/23 3:20 PM, kirill.shute...@linux.intel.com wrote: On Tue, Dec 19, 2023 at 01:57:47PM -0800, Alexey Makhalov wrote: +static inline +unsigned long

Re: [PATCH v3 6/6] x86/vmware: Add TDX hypercall support

2023-12-19 Thread Alexey Makhalov
On 12/19/23 5:00 PM, kirill.shute...@linux.intel.com wrote: On Tue, Dec 19, 2023 at 04:27:51PM -0800, Alexey Makhalov wrote: On 12/19/23 3:23 PM, kirill.shute...@linux.intel.com wrote: On Tue, Dec 19, 2023 at 01:57:51PM -0800, Alexey Makhalov wrote: diff --git a/arch/x86/kernel/cpu

Re: [PATCH v3 2/6] x86/vmware: Introduce vmware_hypercall API

2023-12-19 Thread Alexey Makhalov
On 12/19/23 3:20 PM, kirill.shute...@linux.intel.com wrote: On Tue, Dec 19, 2023 at 01:57:47PM -0800, Alexey Makhalov wrote: +static inline +unsigned long vmware_hypercall1(unsigned long cmd, unsigned long in1) ... +static inline +unsigned long vmware_hypercall3(unsigned long cmd, unsigned

[PATCH v4 0/6] VMware hypercalls enhancements

2023-12-28 Thread Alexey Makhalov
patches 2 and 5. - Added Reviewed-by for all patches. - Added Ack from Dmitry Torokhov in patch 4. No fixes regarding reported by Simon Horman gcc error in this patch. Alexey Makhalov (6): x86/vmware: Move common macros to vmware.h x86/vmware: Introduce VMware hypercall API ptp/vmware: U

[PATCH v4 3/6] ptp/vmware: Use VMware hypercall API

2023-12-28 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 12 +++- 1 file changed, 3

[PATCH v4 2/6] x86/vmware: Introduce VMware hypercall API

2023-12-28 Thread Alexey Makhalov
From: Alexey Makhalov Introduce 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

[PATCH v4 1/6] x86/vmware: Move common macros to vmware.h

2023-12-28 Thread Alexey Makhalov
From: Alexey Makhalov Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h

[PATCH v4 5/6] drm/vmwgfx: Use VMware hypercall API

2023-12-28 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall. And keep it here until introduction of ARM64 VMWare hypervisor interface. Signed-off

[PATCH v4 6/6] x86/vmware: Add TDX hypercall support

2023-12-28 Thread Alexey Makhalov
From: Alexey Makhalov VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield

[PATCH v4 4/6] input/vmmouse: Use VMware hypercall API

2023-12-28 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 76

[PATCH v3 5/6] drm/vmwgfx: Use vmware_hypercall API

2023-12-19 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall. And keep it here until introduction of ARM64 VMWare hypervisor interface. Signed-off

[PATCH v3 3/6] ptp/vmware: Use vmware_hypercall API

2023-12-19 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 12 +++- 1 file changed, 3

[PATCH v3 2/6] x86/vmware: Introduce vmware_hypercall API

2023-12-19 Thread Alexey Makhalov
From: Alexey Makhalov Introduce 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

[PATCH v3 6/6] x86/vmware: Add TDX hypercall support

2023-12-19 Thread Alexey Makhalov
From: Alexey Makhalov VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield

[PATCH v3 4/6] input/vmmouse: Use vmware_hypercall API

2023-12-19 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 76

[PATCH v3 0/6] VMware hypercalls enhancements

2023-12-19 Thread Alexey Makhalov
are guest specific. v1->v2 changes (no functional changes): - Improved commit message in patches 2 and 5. - Added Reviewed-by for all patches. - Added Ack from Dmitry Torokhov in patch 4. No fixes regarding reported by Simon Horman gcc error in this patch. Alexey Makhalov (6): x86/vmware

[PATCH v3 1/6] x86/vmware: Move common macros to vmware.h

2023-12-19 Thread Alexey Makhalov
From: Alexey Makhalov Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h

[PATCH v5 3/7] ptp/vmware: Use VMware hypercall API

2024-01-08 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions

[PATCH v5 4/7] input/vmmouse: Use VMware hypercall API

2024-01-08 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 78

[PATCH v5 5/7] drm/vmwgfx: Use VMware hypercall API

2024-01-08 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall. And keep it here until introduction of ARM64 VMWare hypervisor interface. Signed-off-by: Alexey Makhalov Reviewed

[PATCH v5 6/7] x86/vmware: Undefine VMWARE_HYPERCALL

2024-01-08 Thread Alexey Makhalov
No more direct use of VMWARE_HYPERCALL macro should be allowed. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index 2ac87068184a..84a31f579a30 100644 --- a/arch

[PATCH v5 1/7] x86/vmware: Move common macros to vmware.h

2024-01-08 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h | 72

[PATCH v5 2/7] x86/vmware: Introduce VMware hypercall API

2024-01-08 Thread Alexey Makhalov
to reduce excessive nop alignment once alternatives are applied. Total default code size is 26 bytes, in worse case (3 bytes alternative) remaining 23 bytes will be aligned by only 3 long NOP instructions. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- arch/x

[PATCH v5 7/7] x86/vmware: Add TDX hypercall support

2024-01-08 Thread Alexey Makhalov
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield Signed-off-by: Alexey

[PATCH v5 0/7] VMware hypercalls enhancements

2024-01-08 Thread Alexey Makhalov
hypercall VMWare guest specific. v1->v2 changes (no functional changes): - Improved commit message in patches 2 and 5. - Added Reviewed-by for all patches. - Added Ack from Dmitry Torokhov in patch 4. No fixes regarding reported by Simon Horman gcc error in this patch. Alexey Makhalov (7):

[PATCH v6 0/7] VMware hypercalls enhancements

2024-01-09 Thread Alexey Makhalov
rted by Simon Horman gcc error in this patch. Alexey Makhalov (7): x86/vmware: Move common macros to vmware.h x86/vmware: Introduce VMware hypercall API ptp/vmware: Use VMware hypercall API input/vmmouse: Use VMware hypercall API drm/vmwgfx: Use VMware hypercall API x86/vmware: Undefine V

[PATCH v6 1/7] x86/vmware: Move common macros to vmware.h

2024-01-09 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h | 72

[PATCH v6 2/7] x86/vmware: Introduce VMware hypercall API

2024-01-09 Thread Alexey Makhalov
to reduce excessive nop alignment once alternatives are applied. Total default code size is 26 bytes, in worse case (3 bytes alternative) remaining 23 bytes will be aligned by only 3 long NOP instructions. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- arch/x

[PATCH v6 3/7] ptp/vmware: Use VMware hypercall API

2024-01-09 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions

[PATCH v6 4/7] input/vmmouse: Use VMware hypercall API

2024-01-09 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 78

[PATCH v6 5/7] drm/vmwgfx: Use VMware hypercall API

2024-01-09 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall. And keep it here until introduction of ARM64 VMWare hypervisor interface. Signed-off-by: Alexey Makhalov Reviewed

[PATCH v6 6/7] x86/vmware: Undefine VMWARE_HYPERCALL

2024-01-09 Thread Alexey Makhalov
No more direct use of VMWARE_HYPERCALL macro should be allowed. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index 2ac87068184a..84a31f579a30 100644 --- a/arch

[PATCH v6 7/7] x86/vmware: Add TDX hypercall support

2024-01-09 Thread Alexey Makhalov
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield Signed-off-by: Alexey

Re: [PATCH 4/6] input/vmmouse: Use vmware_hypercall API

2023-11-24 Thread Alexey Makhalov
On Nov 24, 2023, at 11:46 AM, Simon Horman wrote: > > On Wed, Nov 22, 2023 at 03:30:49PM -0800, Alexey Makhalov wrote: >> Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. >> Eliminate arch specific code. No functional changes intended. >> >> Signed-of

Re: [PATCH v2 6/6] x86/vmware: Add TDX hypercall support

2023-12-05 Thread Alexey Makhalov
On 12/5/23 1:24 PM, Dave Hansen wrote: On 12/4/23 02:31, Borislav Petkov wrote: On Fri, Dec 01, 2023 at 03:24:52PM -0800, Alexey Makhalov wrote: +#ifdef CONFIG_INTEL_TDX_GUEST +/* __tdx_hypercall() is not exported. So, export the wrapper */ +void vmware_tdx_hypercall_args(struct

Re: [PATCH v2 6/6] x86/vmware: Add TDX hypercall support

2023-12-05 Thread Alexey Makhalov
On 12/5/23 3:03 PM, Dave Hansen wrote: On 12/5/23 13:41, Alexey Makhalov wrote: I don't really like it much.  This does a generic thing (make a TDX hypercall) with a specific name ("vmware_").  If you want to make an argument that a certain chunk of the __tdx_hypercall() spa

Re: [PATCH v2 5/6] drm/vmwgfx: Use vmware_hypercall API

2023-12-05 Thread Alexey Makhalov
On 12/5/23 12:27 PM, Borislav Petkov wrote: On Fri, Dec 01, 2023 at 03:24:51PM -0800, Alexey Makhalov wrote: Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall here

[PATCH] x86/vmware: Add TDX hypercall support

2023-12-05 Thread Alexey Makhalov
From: Alexey Makhalov VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield

[PATCH v2 4/6] input/vmmouse: Use vmware_hypercall API

2023-12-01 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 76

[PATCH v2 2/6] x86/vmware: Introduce vmware_hypercall API

2023-12-01 Thread Alexey Makhalov
ed by size to reduce excessive nop alignment once alternatives are applied. Total default code size is 26 bytes, in worse case (3 bytes alternative) remaining 23 bytes will be aligned by only 3 long NOP instructions. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek

[PATCH v2 3/6] ptp/vmware: Use vmware_hypercall API

2023-12-01 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions

[PATCH v2 0/6] VMware hypercalls enhancements

2023-12-01 Thread Alexey Makhalov
From: Alexey Makhalov VMware hypercalls invocations were all spread out across the kernel implementing same ABI as in-place asm-inline. With encrypted memory and confidential computing it became harder to maintain every changes in these hypercall implementations. Intention of this patchset

[PATCH v2 1/6] x86/vmware: Move common macros to vmware.h

2023-12-01 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h as a preparation step for the next commit. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h | 69 ++- arch/x86

[PATCH v2 6/6] x86/vmware: Add TDX hypercall support

2023-12-01 Thread Alexey Makhalov
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield Signed-off-by: Alexey

[PATCH v2 5/6] drm/vmwgfx: Use vmware_hypercall API

2023-12-01 Thread Alexey Makhalov
/vmwgfx/vmwgfx_msg_{x86,arm64}.h header files will be performed in the follow up patchset. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 173 +++ drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h | 197

[PATCH 1/6] x86/vmware: Move common macros to vmware.h

2023-11-22 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h as a preparation step for the next commit. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 69 ++- arch/x86/kernel/cpu/vmware.c | 57

[PATCH 3/6] ptp/vmware: Use vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov --- drivers/ptp/ptp_vmw.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp

[PATCH 5/6] drm/vmwgfx: Use vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall here. To be moved to arch/arm64/include/asm/vmware.h later. Signed-off-by: Alexey Makhalov --- drivers/gpu/drm/vmwgfx

[PATCH 1/6] x86/vmware: Move common macros to vmware.h

2023-11-22 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h as a preparation step for the next commit. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 69 ++- arch/x86/kernel/cpu/vmware.c | 57

[PATCH 2/6] x86/vmware: Introduce vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
essive nop alignment once alternatives are applied. Total default code size is 26 bytes, in worse case (3 bytes alternative) remaining 23 bytes will be aligned by only 3 long NOP instructions. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 262 ++

[PATCH 6/6] x86/vmware: Add TDX hypercall support

2023-11-22 Thread Alexey Makhalov
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield Signed-off-by: Alexey

[PATCH 0/6] VMware hypercalls enhancements

2023-11-22 Thread Alexey Makhalov
/ptp_vmw.c Alexey Makhalov (6): x86/vmware: Move common macros to vmware.h x86/vmware: Introduce vmware_hypercall API ptp/vmware: Use vmware_hypercall API input/vmmouse: Use vmware_hypercall API drm/vmwgfx: Use vmware_hypercall API x86/vmware: Add TDX hypercall support arch/x86/include/asm

[PATCH 2/6] x86/vmware: Introduce vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
essive nop alignment once alternatives are applied. Total default code size is 26 bytes, in worse case (3 bytes alternative) remaining 23 bytes will be aligned by only 3 long NOP instructions. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 262 ++

[PATCH 4/6] input/vmmouse: Use vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov --- drivers/input/mouse/vmmouse.c | 76 ++- 1 file changed, 22 insertions(+), 54 deletions(-) diff --git

[PATCH 4/6] input/vmmouse: Use vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov --- drivers/input/mouse/vmmouse.c | 76 ++- 1 file changed, 22 insertions(+), 54 deletions(-) diff --git

[PATCH 5/6] drm/vmwgfx: Use vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall here. To be moved to arch/arm64/include/asm/vmware.h later. Signed-off-by: Alexey Makhalov --- drivers/gpu/drm/vmwgfx

[PATCH 6/6] x86/vmware: Add TDX hypercall support

2023-11-22 Thread Alexey Makhalov
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield Signed-off-by: Alexey

[PATCH 3/6] ptp/vmware: Use vmware_hypercall API

2023-11-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov --- drivers/ptp/ptp_vmw.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp

[PATCH 0/6] VMware hypercalls enhancements

2023-11-22 Thread Alexey Makhalov
/ptp_vmw.c Alexey Makhalov (6): x86/vmware: Move common macros to vmware.h x86/vmware: Introduce vmware_hypercall API ptp/vmware: Use vmware_hypercall API input/vmmouse: Use vmware_hypercall API drm/vmwgfx: Use vmware_hypercall API x86/vmware: Add TDX hypercall support arch/x86/include/asm

Re: [PATCH] x86/vmware: Add TDX hypercall support

2023-12-07 Thread Alexey Makhalov
On 12/7/23 9:12 AM, Dave Hansen wrote: On 12/5/23 23:15, Alexey Makhalov wrote: +#ifdef CONFIG_INTEL_TDX_GUEST +/* Export tdx hypercall and allow it only for VMware guests. */ +void vmware_tdx_hypercall_args(struct tdx_module_args *args) +{ + if (hypervisor_is_type(X86_HYPER_VMWARE

[PATCH] x86/vmware: Add TDX hypercall support

2023-12-07 Thread Alexey Makhalov
From: Alexey Makhalov VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield

Re: [PATCH v6 7/7] x86/vmware: Add TDX hypercall support

2024-01-25 Thread Alexey Makhalov
On 1/22/24 4:17 PM, H. Peter Anvin wrote: On January 22, 2024 4:04:33 PM PST, Alexey Makhalov wrote: On 1/22/24 10:28 AM, H. Peter Anvin wrote: On January 22, 2024 8:32:22 AM PST, Dave Hansen wrote: On 1/9/24 00:40, Alexey Makhalov wrote: +#ifdef CONFIG_INTEL_TDX_GUEST +unsigned long

[PATCH v8 0/7] VMware hypercalls enhancements

2024-04-22 Thread Alexey Makhalov
c. v1->v2 changes (no functional changes): - Improved commit message in patches 2 and 5. - Added Reviewed-by for all patches. - Added Ack from Dmitry Torokhov in patch 4. No fixes regarding reported by Simon Horman gcc error in this patch. Alexey Makhalov (7): x86/vmware: Move common mac

[PATCH v8 1/7] x86/vmware: Move common macros to vmware.h

2024-04-22 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h | 72

[PATCH v8 3/7] ptp/vmware: Use VMware hypercall API

2024-04-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions

[PATCH v8 4/7] input/vmmouse: Use VMware hypercall API

2024-04-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 78

[PATCH v8 2/7] x86/vmware: Introduce VMware hypercall API

2024-04-22 Thread Alexey Makhalov
to reduce excessive nop alignment once alternatives are applied. Total default code size is 26 bytes, in worse case (3 bytes alternative) remaining 23 bytes will be aligned by only 3 long NOP instructions. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- arch/x

[PATCH v8 6/7] x86/vmware: Undefine VMWARE_HYPERCALL

2024-04-22 Thread Alexey Makhalov
No more direct use of VMWARE_HYPERCALL macro should be allowed. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index 2ac87068184a..84a31f579a30 100644 --- a/arch

[PATCH v8 7/7] x86/vmware: Add TDX hypercall support

2024-04-22 Thread Alexey Makhalov
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield Signed-off-by: Alexey

[PATCH v8 5/7] drm/vmwgfx: Use VMware hypercall API

2024-04-22 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall. And keep it here until introduction of ARM64 VMWare hypervisor interface. Signed-off-by: Alexey Makhalov Reviewed

[PATCH v9 1/8] x86/vmware: Correct macro names

2024-04-24 Thread Alexey Makhalov
VCPU_RESERVED and LEGACY_X2APIC are not VMware hypercall commands. These are bits in return value of VMWARE_CMD_GETVCPU_INFO command. Change VMWARE_CMD_ prefix to GETVCPU_INFO_ one. And move bit-shift operation to the macro body. Signed-off-by: Alexey Makhalov --- arch/x86/kernel/cpu/vmware.c

[PATCH v9 2/8] x86/vmware: Move common macros to vmware.h

2024-04-24 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h | 72

Re: [PATCH v8 1/7] x86/vmware: Move common macros to vmware.h

2024-04-24 Thread Alexey Makhalov
On 4/24/24 9:06 AM, Borislav Petkov wrote: On Mon, Apr 22, 2024 at 03:56:50PM -0700, Alexey Makhalov wrote: Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol

Re: [PATCH v9 1/8] x86/vmware: Correct macro names

2024-04-25 Thread Alexey Makhalov
On 4/25/24 8:21 AM, Borislav Petkov wrote: On Wed, Apr 24, 2024 at 04:14:06PM -0700, Alexey Makhalov wrote: VCPU_RESERVED and LEGACY_X2APIC are not VMware hypercall commands. These are bits in return value of VMWARE_CMD_GETVCPU_INFO command. Change VMWARE_CMD_ prefix to GETVCPU_INFO_ one

Re: [PATCH v9 3/8] x86/vmware: Introduce VMware hypercall API

2024-05-09 Thread Alexey Makhalov
On 5/7/24 2:58 AM, Borislav Petkov wrote: On Mon, May 06, 2024 at 02:53:00PM -0700, Alexey Makhalov wrote: +#define VMWARE_HYPERCALL \ + ALTERNATIVE_3("

Re: [PATCH v9 1/8] x86/vmware: Move common macros to vmware.h

2024-05-09 Thread Alexey Makhalov
On 5/7/24 2:14 AM, Borislav Petkov wrote: On Mon, May 06, 2024 at 02:52:58PM -0700, Alexey Makhalov wrote: +#define VMWARE_HYPERVISOR_PORT 0x5658 +#define VMWARE_HYPERVISOR_PORT_HB (VMWARE_HYPERVISOR_PORT | \ +VMWARE_HYPERVISOR_HB) You

[PATCH v9 5/8] input/vmmouse: Use VMware hypercall API

2024-05-06 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 78

[PATCH v9 6/8] drm/vmwgfx: Use VMware hypercall API

2024-05-06 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall. And keep it here until introduction of ARM64 VMWare hypervisor interface. Signed-off-by: Alexey Makhalov Reviewed

[PATCH v9 3/8] x86/vmware: Introduce VMware hypercall API

2024-05-06 Thread Alexey Makhalov
to reduce excessive nop alignment once alternatives are applied. Total default code size is 26 bytes, in worse case (3 bytes alternative) remaining 23 bytes will be aligned by only 3 long NOP instructions. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- arch/x

[PATCH v9 1/8] x86/vmware: Move common macros to vmware.h

2024-05-06 Thread Alexey Makhalov
Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h | 72

[PATCH v9 4/8] ptp/vmware: Use VMware hypercall API

2024-05-06 Thread Alexey Makhalov
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions

[PATCH v9 8/8] x86/vmware: Add TDX hypercall support

2024-05-06 Thread Alexey Makhalov
VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield Signed-off-by: Alexey

[PATCH v9 0/8] VMware hypercalls enhancements

2024-05-06 Thread Alexey Makhalov
o fixes regarding reported by Simon Horman gcc error in this patch. Alexey Makhalov (8): x86/vmware: Move common macros to vmware.h x86/vmware: Correct macro names x86/vmware: Introduce VMware hypercall API ptp/vmware: Use VMware hypercall API input/vmmouse: Use VMware hypercall API drm/v

[PATCH v9 2/8] x86/vmware: Correct macro names

2024-05-06 Thread Alexey Makhalov
VCPU_RESERVED and LEGACY_X2APIC are not VMware hypercall commands. These are bits in return value of VMWARE_CMD_GETVCPU_INFO command. Change VMWARE_CMD_ prefix to GETVCPU_INFO_ one. And move bit-shift operation to the macro body. Signed-off-by: Alexey Makhalov --- arch/x86/kernel/cpu/vmware.c

[PATCH v9 7/8] x86/vmware: Undefine VMWARE_HYPERCALL

2024-05-06 Thread Alexey Makhalov
No more direct use of VMWARE_HYPERCALL macro should be allowed. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index 2ac87068184a..84a31f579a30 100644 --- a/arch

[PATCH v7 5/7] drm/vmwgfx: Use VMware hypercall API

2024-03-07 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h: implement arm64 variant of vmware_hypercall. And keep it here until introduction of ARM64 VMWare hypervisor interface. Signed-off

[PATCH v7 0/7] VMware hypercalls enhancements

2024-03-07 Thread Alexey Makhalov
n Horman gcc error in this patch. Alexey Makhalov (7): x86/vmware: Move common macros to vmware.h x86/vmware: Introduce VMware hypercall API ptp/vmware: Use VMware hypercall API input/vmmouse: Use VMware hypercall API drm/vmwgfx: Use VMware hypercall API x86/vmware: Undefine VMWARE_HYPERCALL x

[PATCH v7 1/7] x86/vmware: Move common macros to vmware.h

2024-03-07 Thread Alexey Makhalov
From: Alexey Makhalov Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h

[PATCH v7 2/7] x86/vmware: Introduce VMware hypercall API

2024-03-07 Thread Alexey Makhalov
From: Alexey Makhalov Introduce 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

[PATCH v7 3/7] ptp/vmware: Use VMware hypercall API

2024-03-07 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 14 +++--- 1 file changed, 3

[PATCH v7 6/7] x86/vmware: Undefine VMWARE_HYPERCALL

2024-03-07 Thread Alexey Makhalov
From: Alexey Makhalov No more direct use of VMWARE_HYPERCALL macro should be allowed. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index 2ac87068184a

[PATCH v7 7/7] x86/vmware: Add TDX hypercall support

2024-03-07 Thread Alexey Makhalov
From: Alexey Makhalov VMware hypercalls use I/O port, VMCALL or VMMCALL instructions. Add __tdx_hypercall path to support TDX guests. No change in high bandwidth hypercalls, as only low bandwidth ones are supported for TDX guests. Co-developed-by: Tim Merrifield Signed-off-by: Tim Merrifield

[PATCH v7 4/7] input/vmmouse: Use VMware hypercall API

2024-03-07 Thread Alexey Makhalov
From: Alexey Makhalov Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Zack Rusin Acked-by: Dmitry Torokhov --- drivers/input/mouse/vmmouse.c | 78

Re: [PATCH v7 0/7] VMware hypercalls enhancements

2024-04-04 Thread Alexey Makhalov
Peter, can you please review version 7 of "x86/vmware: Add TDX hypercall support" patch. It addresses the concern you had in previous version. Thanks.

Re: [PATCH v9 3/8] x86/vmware: Introduce VMware hypercall API

2024-05-22 Thread Alexey Makhalov
Hi Simon, apologize for long delay On 5/11/24 8:02 AM, Simon Horman wrote: diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h ... +static inline +unsigned long vmware_hypercall3(unsigned long cmd, unsigned long in1, + uint32_t *out1,

[PATCH v10 7/8] x86/vmware: Remove legacy VMWARE_HYPERCALL* macros

2024-05-23 Thread Alexey Makhalov
No more direct use of these macros should be allowed. vmware_hypercallX api still use new implementation of VMWARE_HYPERCALL macro internally, but it is not exposed outside of the vmware.h. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 26 -- 1 file

[PATCH v10 1/8] x86/vmware: Introduce VMware hypercall API

2024-05-23 Thread Alexey Makhalov
e.h. Make vmware_hypercall_mode a global variable. Signed-off-by: Alexey Makhalov --- arch/x86/include/asm/vmware.h | 274 -- arch/x86/kernel/cpu/vmware.c | 11 +- 2 files changed, 262 insertions(+), 23 deletions(-) diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/i

[PATCH v10 5/8] x86/vmware: Use VMware hypercall API

2024-05-23 Thread Alexey Makhalov
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 --- arch/x86/kernel/cpu/vmware.c | 95 ++-- 1 file changed, 25 insertions(+), 70

  1   2   >