All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Makhalov <amakhalov@vmware.com>
To: linux-kernel@vger.kernel.org, virtualization@lists.linux.dev,
	hpa@zytor.com, dave.hansen@linux.intel.co, bp@alien8.d,
	mingo@redhat.com, tglx@linutronix.de
Cc: 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, namit@vmware.com, timothym@vmware.com,
	akaher@vmware.com, jsipek@vmware.com,
	dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
	airlied@gmail.com, tzimmermann@suse.de, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com, horms@kernel.org
Subject: [PATCH v2 3/6] ptp/vmware: Use vmware_hypercall API
Date: Fri,  1 Dec 2023 15:24:49 -0800	[thread overview]
Message-ID: <20231201232452.220355-4-amakhalov@vmware.com> (raw)
In-Reply-To: <20231201232452.220355-1-amakhalov@vmware.com>

Switch from VMWARE_HYPERCALL macro to vmware_hypercall API.
Eliminate arch specific code. No functional changes intended.

Signed-off-by: Alexey Makhalov <amakhalov@vmware.com>
Reviewed-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Jeff Sipek <jsipek@vmware.com>
---
 drivers/ptp/ptp_vmw.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c
index 27c5547aa8a9..e5bb521b9b82 100644
--- a/drivers/ptp/ptp_vmw.c
+++ b/drivers/ptp/ptp_vmw.c
@@ -14,7 +14,6 @@
 #include <asm/hypervisor.h>
 #include <asm/vmware.h>
 
-#define VMWARE_MAGIC 0x564D5868
 #define VMWARE_CMD_PCLK(nr) ((nr << 16) | 97)
 #define VMWARE_CMD_PCLK_GETTIME VMWARE_CMD_PCLK(0)
 
@@ -24,15 +23,10 @@ static struct ptp_clock *ptp_vmw_clock;
 
 static int ptp_vmw_pclk_read(u64 *ns)
 {
-	u32 ret, nsec_hi, nsec_lo, unused1, unused2, unused3;
-
-	asm volatile (VMWARE_HYPERCALL :
-		"=a"(ret), "=b"(nsec_hi), "=c"(nsec_lo), "=d"(unused1),
-		"=S"(unused2), "=D"(unused3) :
-		"a"(VMWARE_MAGIC), "b"(0),
-		"c"(VMWARE_CMD_PCLK_GETTIME), "d"(0) :
-		"memory");
+	u32 ret, nsec_hi, nsec_lo;
 
+	ret = vmware_hypercall3(VMWARE_CMD_PCLK_GETTIME, 0,
+				&nsec_hi, &nsec_lo);
 	if (ret == 0)
 		*ns = ((u64)nsec_hi << 32) | nsec_lo;
 	return ret;
-- 
2.39.0


WARNING: multiple messages have this Message-ID (diff)
From: Alexey Makhalov <amakhalov@vmware.com>
To: linux-kernel@vger.kernel.org, virtualization@lists.linux.dev,
	hpa@zytor.com, dave.hansen@linux.intel.co, bp@alien8.d,
	mingo@redhat.com, tglx@linutronix.de
Cc: dmitry.torokhov@gmail.com, tzimmermann@suse.de,
	pv-drivers@vmware.com, netdev@vger.kernel.org,
	richardcochran@gmail.com, x86@kernel.org,
	dri-devel@lists.freedesktop.org, horms@kernel.org,
	akaher@vmware.com, timothym@vmware.com,
	linux-graphics-maintainer@vmware.com, mripard@kernel.org,
	jsipek@vmware.com, linux-input@vger.kernel.org, namit@vmware.com,
	zackr@vmware.com
Subject: [PATCH v2 3/6] ptp/vmware: Use vmware_hypercall API
Date: Fri,  1 Dec 2023 15:24:49 -0800	[thread overview]
Message-ID: <20231201232452.220355-4-amakhalov@vmware.com> (raw)
In-Reply-To: <20231201232452.220355-1-amakhalov@vmware.com>

Switch from VMWARE_HYPERCALL macro to vmware_hypercall API.
Eliminate arch specific code. No functional changes intended.

Signed-off-by: Alexey Makhalov <amakhalov@vmware.com>
Reviewed-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Jeff Sipek <jsipek@vmware.com>
---
 drivers/ptp/ptp_vmw.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c
index 27c5547aa8a9..e5bb521b9b82 100644
--- a/drivers/ptp/ptp_vmw.c
+++ b/drivers/ptp/ptp_vmw.c
@@ -14,7 +14,6 @@
 #include <asm/hypervisor.h>
 #include <asm/vmware.h>
 
-#define VMWARE_MAGIC 0x564D5868
 #define VMWARE_CMD_PCLK(nr) ((nr << 16) | 97)
 #define VMWARE_CMD_PCLK_GETTIME VMWARE_CMD_PCLK(0)
 
@@ -24,15 +23,10 @@ static struct ptp_clock *ptp_vmw_clock;
 
 static int ptp_vmw_pclk_read(u64 *ns)
 {
-	u32 ret, nsec_hi, nsec_lo, unused1, unused2, unused3;
-
-	asm volatile (VMWARE_HYPERCALL :
-		"=a"(ret), "=b"(nsec_hi), "=c"(nsec_lo), "=d"(unused1),
-		"=S"(unused2), "=D"(unused3) :
-		"a"(VMWARE_MAGIC), "b"(0),
-		"c"(VMWARE_CMD_PCLK_GETTIME), "d"(0) :
-		"memory");
+	u32 ret, nsec_hi, nsec_lo;
 
+	ret = vmware_hypercall3(VMWARE_CMD_PCLK_GETTIME, 0,
+				&nsec_hi, &nsec_lo);
 	if (ret == 0)
 		*ns = ((u64)nsec_hi << 32) | nsec_lo;
 	return ret;
-- 
2.39.0


  parent reply	other threads:[~2023-12-01 23:25 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 23:30 [PATCH 0/6] VMware hypercalls enhancements Alexey Makhalov
2023-11-22 23:30 ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 1/6] x86/vmware: Move common macros to vmware.h Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 2/6] x86/vmware: Introduce vmware_hypercall API Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 3/6] ptp/vmware: Use " Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 4/6] input/vmmouse: " Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-24 19:46   ` Simon Horman
2023-11-24 19:46     ` Simon Horman
2023-11-25  1:22     ` Alexey Makhalov
2023-11-25  1:22       ` Alexey Makhalov
2023-11-25  4:58       ` dmitry.torokhov
2023-11-25  4:58         ` dmitry.torokhov
2023-11-25  5:01   ` Dmitry Torokhov
2023-11-25  5:01     ` Dmitry Torokhov
2023-11-22 23:30 ` [PATCH 5/6] drm/vmwgfx: " Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 6/6] x86/vmware: Add TDX hypercall support Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 0/6] VMware hypercalls enhancements Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-12-01 23:24   ` [PATCH v2 " Alexey Makhalov
2023-12-01 23:24     ` Alexey Makhalov
2023-12-01 23:24     ` [PATCH v2 1/6] x86/vmware: Move common macros to vmware.h Alexey Makhalov
2023-12-01 23:24       ` Alexey Makhalov
2023-12-04 10:32       ` Borislav Petkov
2023-12-04 10:32         ` Borislav Petkov
2023-12-01 23:24     ` [PATCH v2 2/6] x86/vmware: Introduce vmware_hypercall API Alexey Makhalov
2023-12-01 23:24       ` Alexey Makhalov
2023-12-04 10:35       ` Borislav Petkov
2023-12-04 10:35         ` Borislav Petkov
2023-12-01 23:24     ` Alexey Makhalov [this message]
2023-12-01 23:24       ` [PATCH v2 3/6] ptp/vmware: Use " Alexey Makhalov
2023-12-01 23:24     ` [PATCH v2 4/6] input/vmmouse: " Alexey Makhalov
2023-12-01 23:24       ` Alexey Makhalov
2023-12-01 23:24     ` [PATCH v2 5/6] drm/vmwgfx: " Alexey Makhalov
2023-12-01 23:24       ` Alexey Makhalov
2023-12-05 20:27       ` Borislav Petkov
2023-12-05 20:27         ` Borislav Petkov
2023-12-05 21:18         ` Alexey Makhalov
2023-12-05 21:18           ` Alexey Makhalov
2023-12-01 23:24     ` [PATCH v2 6/6] x86/vmware: Add TDX hypercall support Alexey Makhalov
2023-12-01 23:24       ` Alexey Makhalov
2023-12-04 10:31       ` Borislav Petkov
2023-12-04 10:31         ` Borislav Petkov
2023-12-05 21:24         ` Dave Hansen
2023-12-05 21:24           ` Dave Hansen
2023-12-05 21:41           ` Alexey Makhalov
2023-12-05 21:41             ` Alexey Makhalov
2023-12-05 22:43             ` Tim Merrifield
2023-12-05 22:43               ` Tim Merrifield
2023-12-05 23:03             ` Dave Hansen
2023-12-05 23:03               ` Dave Hansen
2023-12-06  0:11               ` Alexey Makhalov
2023-12-06  0:11                 ` Alexey Makhalov
2023-12-06  7:15                 ` [PATCH] " Alexey Makhalov
2023-12-06  7:15                   ` Alexey Makhalov
2023-12-07 17:12                   ` Dave Hansen
2023-12-07 17:12                     ` Dave Hansen
2023-12-08  2:27                     ` Alexey Makhalov
2023-12-08  2:27                       ` Alexey Makhalov
2023-12-08  2:32                       ` Alexey Makhalov
2023-12-08  2:32                         ` Alexey Makhalov
2023-12-05 19:57       ` [PATCH v2 6/6] " kernel test robot
2023-12-05 19:57         ` kernel test robot
2023-12-05 21:04       ` kernel test robot
2023-12-05 21:04         ` kernel test robot
2023-11-22 23:30 ` [PATCH 1/6] x86/vmware: Move common macros to vmware.h Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 2/6] x86/vmware: Introduce vmware_hypercall API Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 3/6] ptp/vmware: Use " Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 4/6] input/vmmouse: " Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 5/6] drm/vmwgfx: " Alexey Makhalov
2023-11-22 23:30   ` Alexey Makhalov
2023-11-22 23:30 ` [PATCH 6/6] x86/vmware: Add TDX hypercall support Alexey Makhalov
2023-11-22 23:30   ` 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=20231201232452.220355-4-amakhalov@vmware.com \
    --to=amakhalov@vmware.com \
    --cc=airlied@gmail.com \
    --cc=akaher@vmware.com \
    --cc=bp@alien8.d \
    --cc=daniel@ffwll.ch \
    --cc=dave.hansen@linux.intel.co \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=horms@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jsipek@vmware.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=namit@vmware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.