Blob Blame History Raw
From 95558e554f4e00c50c1b9719ddd45a93e17dc7a0 Mon Sep 17 00:00:00 2001
From: Martin Krastev <krastevm@vmware.com>
Date: Tue, 15 Jun 2021 14:23:36 -0400
Subject: drm/vmwgfx: Fix build issues in mksGuestStats discovered by the
 kernel test robot
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 9f808288ba88ac2a9582118343d4ca7e3d95dd43
Patch-mainline: v5.15-rc1
References: jsc#PED-1166 jsc#PED-1168 jsc#PED-1170 jsc#PED-1218 jsc#PED-1220 jsc#PED-1222 jsc#PED-1223 jsc#PED-1225

Fixes for ARCH
i386
	* printk format specifier warnings
	* inconsistent operand constraints in an ‘asm’ errors
arm64
	* not targeted by the commit being fixed

Reviewed-by: Zack Rusin <zackr@vmware.com>
Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210615182336.995192-5-zackr@vmware.com
Signed-off-by: Zack Rusin <zackr@vmware.com>
Acked-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 drivers/gpu/drm/vmwgfx/Kconfig      | 1 +
 drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
index a9052fae0bbc..c9ce47c448e0 100644
--- a/drivers/gpu/drm/vmwgfx/Kconfig
+++ b/drivers/gpu/drm/vmwgfx/Kconfig
@@ -25,6 +25,7 @@ config DRM_VMWGFX_FBCON
 config DRM_VMWGFX_MKSSTATS
 	bool "Enable mksGuestStats instrumentation of vmwgfx by default"
 	depends on DRM_VMWGFX
+	depends on X86
 	default n
 	help
 	   Choose this option to instrument the kernel driver for mksGuestStats.
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index 74a3f09ad664..ed9c7b3a1e08 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -665,7 +665,7 @@ static inline void hypervisor_ppn_add(PPN64 pfn)
 	unsigned long eax, ebx, ecx, edx, si = 0, di = 0;
 
 	VMW_PORT(VMW_PORT_CMD_MKSGS_ADD_PPN,
-		pfn, si, di,
+		(unsigned long)pfn, si, di,
 		0,
 		VMW_HYPERVISOR_MAGIC,
 		eax, ebx, ecx, edx, si, di);
@@ -682,7 +682,7 @@ static inline void hypervisor_ppn_remove(PPN64 pfn)
 	unsigned long eax, ebx, ecx, edx, si = 0, di = 0;
 
 	VMW_PORT(VMW_PORT_CMD_MKSGS_REMOVE_PPN,
-		pfn, si, di,
+		(unsigned long)pfn, si, di,
 		0,
 		VMW_HYPERVISOR_MAGIC,
 		eax, ebx, ecx, edx, si, di);
@@ -1115,7 +1115,7 @@ int vmw_mksstat_add_ioctl(struct drm_device *dev, void *data,
 
 	arg->id = slot;
 
-	DRM_DEV_INFO(dev->dev, "pid=%d arg.description='%.*s' id=%lu\n", current->pid, (int)desc_len, pdesc->description, slot);
+	DRM_DEV_INFO(dev->dev, "pid=%d arg.description='%.*s' id=%zu\n", current->pid, (int)desc_len, pdesc->description, slot);
 
 	return 0;
 
@@ -1163,7 +1163,7 @@ int vmw_mksstat_remove_ioctl(struct drm_device *dev, void *data,
 	if (slot >= ARRAY_SIZE(dev_priv->mksstat_user_pids))
 		return -EINVAL;
 
-	DRM_DEV_INFO(dev->dev, "pid=%d arg.id=%lu\n", current->pid, slot);
+	DRM_DEV_INFO(dev->dev, "pid=%d arg.id=%zu\n", current->pid, slot);
 
 	pgid = task_pgrp_vnr(current);
 	pid = atomic_cmpxchg(&dev_priv->mksstat_user_pids[slot], pgid, MKSSTAT_PID_RESERVED);
-- 
2.38.1