[PATCH v1 1/2] arm64: Add VMware virtual I/O port definitions

Jerrin Shaji George jerrin.shaji-george at broadcom.com
Wed Dec 2 13:38:20 PST 2026


VMware's hypervisor lets arm64 guests use x86 I/O port interfaces by
executing HVC #0x86. The guest places the x86 registers AX through BP
in x0-x6 and describes the instruction to emulate in w7.

Add arch/arm64/include/asm/vmware.h with the definitions needed to
build the w7 value. This will be used by the VMware balloon driver.
Based on the VMware Photon OS arm64 patches by Cyprien Laplace and
Keerthana K.

Link: https://github.com/vmware/photon/blob/5.0/SPECS/92/linux/aarch64/0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch
Co-developed-by: Keerthana K <keerthana.kalyanasundaram at broadcom.com>
Signed-off-by: Keerthana K <keerthana.kalyanasundaram at broadcom.com>
Signed-off-by: Jerrin Shaji George <jerrin.shaji-george at broadcom.com>
---
 MAINTAINERS                     |  1 +
 arch/arm64/include/asm/vmware.h | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 arch/arm64/include/asm/vmware.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 44540a1eb2b8..055ac1a3229d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -29966,6 +29966,7 @@ L:	virtualization at lists.linux.dev
 L:	x86 at kernel.org
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vmware
+F:	arch/arm64/include/asm/vmware.h
 F:	arch/x86/include/asm/vmware.h
 F:	arch/x86/kernel/cpu/vmware.c
 
diff --git a/arch/arm64/include/asm/vmware.h b/arch/arm64/include/asm/vmware.h
new file mode 100644
index 000000000000..2b92a8f87011
--- /dev/null
+++ b/arch/arm64/include/asm/vmware.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0 OR MIT */
+/*
+ * Copyright (C) 2021, VMware, Inc.
+ */
+#ifndef _ASM_ARM64_VMWARE_H
+#define _ASM_ARM64_VMWARE_H
+
+#include <linux/bits.h>
+
+/*
+ * VMware virtualizes x86 I/O port instructions on arm64 using HVC #0x86.
+ * Registers x0 through x6 correspond to x86 AX, BX, CX, DX, SI, DI and BP.
+ * Register w7 describes the I/O instruction to emulate.
+ */
+#define X86_IO_MAGIC		0x86
+
+/* Transfer size in w7[1:0]: 0 = byte, 1 = word, 2 = doubleword. */
+#define X86_IO_W7_SIZE_SHIFT	0
+
+/* Read from the port (IN), rather than write to it (OUT). */
+#define X86_IO_W7_DIR		BIT(2)
+
+/* Use the port number in DX (w3), rather than an immediate port number. */
+#define X86_IO_W7_WITH		BIT(3)
+
+#endif /* _ASM_ARM64_VMWARE_H */
-- 
2.52.0




More information about the linux-arm-kernel mailing list