LKML Archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Alexey Makhalov <alexey.makhalov@broadcom.com>
Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux.dev,
	bp@alien8.de, hpa@zytor.com, dave.hansen@linux.intel.com,
	mingo@redhat.com, tglx@linutronix.de, x86@kernel.org,
	netdev@vger.kernel.org, richardcochran@gmail.com,
	linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
	zackr@vmware.com, linux-graphics-maintainer@vmware.com,
	pv-drivers@vmware.com, timothym@vmware.com, akaher@vmware.com,
	dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
	airlied@gmail.com, tzimmermann@suse.de, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com,
	kirill.shutemov@linux.intel.com,
	Nadav Amit <nadav.amit@gmail.com>, Jeff Sipek <jsipek@vmware.com>
Subject: Re: [PATCH v9 3/8] x86/vmware: Introduce VMware hypercall API
Date: Sat, 11 May 2024 16:02:25 +0100	[thread overview]
Message-ID: <20240511150225.GK2347895@kernel.org> (raw)
In-Reply-To: <20240506215305.30756-4-alexey.makhalov@broadcom.com>

On Mon, May 06, 2024 at 02:53:00PM -0700, Alexey Makhalov wrote:
> 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 by analogy with KVM 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 commit bac7b4e84323
> ("x86/vmware: Update platform detection code for VMCALL/VMMCALL
> hypercalls") to have a slow, but safe path in VMWARE_HYPERCALL
> earlier during the boot when alternatives are not yet applied.
> This logic was inherited from VMWARE_CMD from the commit mentioned
> above. Default alternative code was optimized 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 <alexey.makhalov@broadcom.com>
> Reviewed-by: Nadav Amit <nadav.amit@gmail.com>
> Reviewed-by: Jeff Sipek <jsipek@vmware.com>

...

> 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, uint32_t *out2)

nit: u32 is preferred over uint32_t.
     Likewise elsewhere in this patch-set.
...

>  /*
> - * The high bandwidth in call. The low word of edx is presumed to have the
> - * HB bit set.
> + * High bandwidth calls are not supported on encrypted memory guests.
> + * The caller should check cc_platform_has(CC_ATTR_MEM_ENCRYPT) and use
> + * low bandwidth hypercall it memory encryption is set.
> + * This assumption simplifies HB hypercall impementation to just I/O port

nit: implementation

     checkpatch.pl --codespell is your friend

> + * based approach without alternative patching.
>   */

...

  parent reply	other threads:[~2024-05-11 15:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 22:56 [PATCH v8 0/7] VMware hypercalls enhancements Alexey Makhalov
2024-04-22 22:56 ` [PATCH v8 1/7] x86/vmware: Move common macros to vmware.h Alexey Makhalov
2024-04-24 16:06   ` Borislav Petkov
2024-04-24 23:12     ` Alexey Makhalov
2024-04-24 23:14       ` [PATCH v9 1/8] x86/vmware: Correct macro names Alexey Makhalov
2024-04-24 23:14         ` [PATCH v9 2/8] x86/vmware: Move common macros to vmware.h Alexey Makhalov
2024-05-05 18:28           ` Borislav Petkov
2024-05-06 21:52             ` [PATCH v9 0/8] VMware hypercalls enhancements Alexey Makhalov
2024-05-06 21:52               ` [PATCH v9 1/8] x86/vmware: Move common macros to vmware.h Alexey Makhalov
2024-05-07  9:14                 ` Borislav Petkov
2024-05-09 22:57                   ` Alexey Makhalov
2024-05-06 21:52               ` [PATCH v9 2/8] x86/vmware: Correct macro names Alexey Makhalov
2024-05-06 21:53               ` [PATCH v9 3/8] x86/vmware: Introduce VMware hypercall API Alexey Makhalov
2024-05-07  9:58                 ` Borislav Petkov
2024-05-09 23:42                   ` Alexey Makhalov
2024-05-10  5:24                 ` kernel test robot
2024-05-11 15:02                 ` Simon Horman [this message]
2024-05-22 23:39                   ` Alexey Makhalov
2024-05-23 12:52                     ` Simon Horman
2024-05-06 21:53               ` [PATCH v9 4/8] ptp/vmware: Use " Alexey Makhalov
2024-05-06 21:53               ` [PATCH v9 5/8] input/vmmouse: " Alexey Makhalov
2024-05-06 21:53               ` [PATCH v9 6/8] drm/vmwgfx: " Alexey Makhalov
2024-05-10  7:31                 ` kernel test robot
2024-05-06 21:53               ` [PATCH v9 7/8] x86/vmware: Undefine VMWARE_HYPERCALL Alexey Makhalov
2024-05-06 21:53               ` [PATCH v9 8/8] x86/vmware: Add TDX hypercall support Alexey Makhalov
2024-04-25 15:21         ` [PATCH v9 1/8] x86/vmware: Correct macro names Borislav Petkov
2024-04-25 17:27           ` Alexey Makhalov
2024-04-22 22:56 ` [PATCH v8 2/7] x86/vmware: Introduce VMware hypercall API Alexey Makhalov
2024-04-22 22:56 ` [PATCH v8 3/7] ptp/vmware: Use " Alexey Makhalov
2024-04-22 22:56 ` [PATCH v8 4/7] input/vmmouse: " Alexey Makhalov
2024-04-22 22:56 ` [PATCH v8 5/7] drm/vmwgfx: " Alexey Makhalov
2024-04-22 22:56 ` [PATCH v8 6/7] x86/vmware: Undefine VMWARE_HYPERCALL Alexey Makhalov
2024-04-22 22:56 ` [PATCH v8 7/7] x86/vmware: Add TDX hypercall support Alexey Makhalov

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=20240511150225.GK2347895@kernel.org \
    --to=horms@kernel.org \
    --cc=airlied@gmail.com \
    --cc=akaher@vmware.com \
    --cc=alexey.makhalov@broadcom.com \
    --cc=bp@alien8.de \
    --cc=daniel@ffwll.ch \
    --cc=dave.hansen@linux.intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hpa@zytor.com \
    --cc=jsipek@vmware.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mingo@redhat.com \
    --cc=mripard@kernel.org \
    --cc=nadav.amit@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pv-drivers@vmware.com \
    --cc=richardcochran@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=timothym@vmware.com \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux.dev \
    --cc=x86@kernel.org \
    --cc=zackr@vmware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).