Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Workstation 17.6.0 #281

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
755b521
import Workstation 12.5.5 module sources
mkubecek May 31, 2017
2a21430
import Workstation 12.5.6 module sources
mkubecek May 31, 2017
2bd541e
import Workstation 12.5.7 module sources
mkubecek Jun 23, 2017
e4df7e3
import Workstation 14.0.0 module sources
mkubecek Sep 30, 2017
f78dd52
import Workstation 14.1.0 module sources
mkubecek Dec 25, 2017
876363b
import Workstation 14.1.1 module sources
mkubecek Jan 12, 2018
cb66161
Merge branch 'master' into workstation
mkubecek Feb 4, 2018
7fa9cbe
Merge branch 'master' into workstation
mkubecek Apr 2, 2018
2749950
import Workstation 14.1.2 module sources
mkubecek May 23, 2018
454cbd7
Merge branch 'master' into workstation
mkubecek May 27, 2018
3f188d0
import Workstation 14.1.3 module sources
mkubecek Aug 20, 2018
d7fe4fe
import Workstation 15.0.0 module sources
mkubecek Oct 2, 2018
b71c1b9
import Workstation 15.0.1 module sources
mkubecek Nov 12, 2018
a93f44e
import Workstation 15.1.0 module sources
mkubecek May 15, 2019
4d36d6a
Merge branch 'master' into workstation
mkubecek Sep 20, 2019
51949a3
import Workstation 15.5.0 module sources
mkubecek Sep 20, 2019
bf5aeac
import Workstation 15.5.1 module sources
mkubecek Nov 14, 2019
02fd1f0
import Workstation 15.5.2 module sources
mkubecek Mar 14, 2020
dec5bab
import Workstation 15.5.5 module sources
mkubecek May 30, 2020
d67ec2e
import Workstation 16.0.0 module sources
mkubecek Sep 15, 2020
a4d51ad
import Workstation 16.1.0 module sources
mkubecek Nov 20, 2020
3a3dd80
import Workstation 16.2.0 module sources
mkubecek Oct 17, 2021
2d39b2e
import Workstation 16.2.3 module sources
mkubecek Mar 11, 2022
a83bc0f
Merge branch 'master' into workstation
mkubecek Mar 11, 2022
23b8308
import Workstation 16.2.4 module sources
mkubecek Jul 26, 2022
185775d
Merge branch 'master' into workstation
mkubecek Oct 20, 2022
2acf8c0
Merge branch 'master' into workstation
mkubecek Nov 18, 2022
33f1d0e
import Workstation 17.0.0 module sources
mkubecek Nov 18, 2022
fee62c9
import Workstation 17.0.1 module sources
mkubecek Feb 4, 2023
60bfdb5
import Workstation 17.5.0 module sources
mkubecek Oct 20, 2023
363bab0
import Workstation 17.6.0 module sources
philipl Sep 7, 2024
fe7e237
Seems x86cpuid.h also need to be patched to prevent array-index-out-o…
nan0desu May 18, 2024
d2788a6
modules: make COMPAT_LINUX_VERSION_CHECK_LT less tricky
mkubecek Aug 12, 2023
a7a0dcc
vmmon: rename GDT_SIZE macro to avoid collision
mkubecek Sep 15, 2020
a3fc2c2
modules: use standard constant definitions if available
mkubecek Nov 18, 2022
9392920
vmmon: quick workaround for objtool warnings
mkubecek Sep 30, 2017
a7d68e1
modules: remove .cache.mk on make clean
theobch May 27, 2018
3519dc9
vmmon: include <asm/irq_vectors.h> explicitly
mkubecek Aug 20, 2020
c7e75a4
vmnet: convert VNetBridge debugging code to ktime_get_ns()
mkubecek Mar 14, 2020
bf9bc89
vmnet: hack around SLE15-SP5 backport of netdevice::dev_addr changes
mkubecek Nov 26, 2022
edceb87
vmnet: use explicit module_init() and module_exit() (#187)
mkubecek Jan 17, 2023
7f94d6c
vmmon: use standard ASM_ENDBR macro
mkubecek Jan 17, 2023
119c95f
vmnet: fix csum_and_copy_to_user workaround for kernel >= 5.19
mkubecek Nov 18, 2022
32731a7
vmnet: fix wireless device detection
mkubecek Jun 7, 2022
97ce99e
vmnet: use void as argument list in function definitions (#188)
mkubecek Feb 17, 2023
0ace2b5
vmmon: use get_user_pages to get page PFN
mkubecek Oct 22, 2023
cc104a8
Compiles and works for Workstation 17.5.2 and Mainline kernel 6.9.1. …
nan0desu May 18, 2024
bc295fc
Add dkms support
philipl Sep 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULES = vmmon vmnet
SUBDIRS = $(MODULES:%=%-only)
TARBALLS = $(MODULES:%=%.tar)
MODFILES = $(foreach mod,$(MODULES),$(mod)-only/$(mod).ko)
VM_UNAME = $(shell uname -r)
VM_UNAME ?= $(shell uname -r)
MODDIR = /lib/modules/$(VM_UNAME)/misc

MODINFO = /sbin/modinfo
Expand Down
11 changes: 11 additions & 0 deletions dkms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PACKAGE_NAME="vmware-host-modules"
PACKAGE_VERSION="17.6.0"
MAKE="VM_UNAME=$kernelver make"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="vmmon"
BUILT_MODULE_NAME[1]="vmnet"
BUILT_MODULE_LOCATION[0]="vmmon-only"
BUILT_MODULE_LOCATION[1]="vmnet-only"
DEST_MODULE_LOCATION[0]="/extra"
DEST_MODULE_LOCATION[1]="/extra"
AUTOINSTALL="yes"
339 changes: 339 additions & 0 deletions vmmon-only/COPYING

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions vmmon-only/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#!/usr/bin/make -f
##########################################################
# Copyright (C) 1998-2020 VMware, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation version 2 and no later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
##########################################################

####
#### VMware kernel module Makefile to be distributed externally
####

####
#### SRCROOT _must_ be a relative path.
####
SRCROOT = .

#
# open-vm-tools doesn't replicate shared source files for different modules;
# instead, files are kept in shared locations. So define a few useful macros
# to be able to handle both cases cleanly.
#
INCLUDE :=
ifdef OVT_SOURCE_DIR
AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
VMLIB_PATH = $(OVT_SOURCE_DIR)/lib/$(1)
INCLUDE += -I$(OVT_SOURCE_DIR)/modules/linux/shared
INCLUDE += -I$(OVT_SOURCE_DIR)/lib/include
else
AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
INCLUDE += -I$(SRCROOT)/shared
endif


VM_UNAME ?= $(shell uname -r)

# Header directory for the running kernel
ifdef LINUXINCLUDE
HEADER_DIR = $(LINUXINCLUDE)
else
HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
endif

BUILD_DIR = $(HEADER_DIR)/..

DRIVER := vmmon
PRODUCT := @@PRODUCT@@

# Grep program
GREP = /bin/grep

vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)

ifndef VM_KBUILD
VM_KBUILD := no
ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
VM_KBUILD := yes
endif
export VM_KBUILD
endif

ifndef VM_KBUILD_SHOWN
ifeq ($(VM_KBUILD), no)
VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
else
VM_DUMMY := $(shell echo >&2 "Using kernel build system.")
endif
VM_KBUILD_SHOWN := yes
export VM_KBUILD_SHOWN
endif

ifneq ($(VM_KBUILD), no)

# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
ifeq ($(VERSION),)

DRIVER_KO := $(DRIVER).ko

.PHONY: $(DRIVER_KO)

auto-build: $(DRIVER_KO)
cp -f $< $(SRCROOT)/../$(DRIVER).o

# $(DRIVER_KO) is a phony target, so compare file times explicitly
$(DRIVER): $(DRIVER_KO)
if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi

# Use SUBDIRS on 2.x, 3.x, 4.x. Use M on newer kernels.
ifeq ($(filter-out 2 3 4,$(firstword $(subst ., ,$(VM_UNAME)))),)
DIRVAR := SUBDIRS
else
DIRVAR := M
endif

#
# Define a setup target that gets built before the actual driver.
# This target may not be used at all, but if it is then it will be defined
# in Makefile.kernel
#
prebuild:: ;
postbuild:: ;

$(DRIVER_KO): prebuild
$(MAKE) -C $(BUILD_DIR) $(DIRVAR)=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
MODULEBUILDDIR=$(MODULEBUILDDIR) modules
$(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
endif

vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
-DKBUILD_BASENAME=\"$(DRIVER)\" \
-Werror -S -o /dev/null -xc $(1) \
> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)

CC_WARNINGS := -Wall -Wstrict-prototypes
CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
ifdef VMX86_DEVEL
CC_OPTS += -DVMX86_DEVEL
endif
ifdef VMX86_DEBUG
CC_OPTS += -DVMX86_DEBUG
endif

# Add Spectre options when available

include $(SRCROOT)/Makefile.kernel

else

include $(SRCROOT)/Makefile.normal

endif

#.SILENT:
36 changes: 36 additions & 0 deletions vmmon-only/Makefile.kernel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/make -f
##########################################################
# Copyright (c) 1998-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation version 2 and no later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
##########################################################

CC_OPTS += -DVMMON -DVMCORE

INCLUDE := -I$(SRCROOT)/include -I$(SRCROOT)/include/x86 -I$(SRCROOT)/common -I$(SRCROOT)/linux
EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)

obj-m += $(DRIVER).o

$(DRIVER)-y := $(subst $(SRCROOT)/, , $(patsubst %.c, %.o, \
$(wildcard $(SRCROOT)/linux/*.c $(SRCROOT)/common/*.c \
$(SRCROOT)/bootstrap/*.c)))

clean:
rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions .cache.mk \
Module.symvers Modules.symvers Module.markers modules.order \
$(foreach dir,linux/ common/ bootstrap/ \
./,$(addprefix $(dir),.*.cmd .*.o.flags *.o)))
141 changes: 141 additions & 0 deletions vmmon-only/Makefile.normal
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#!/usr/bin/make -f
##########################################################
# Copyright (c) 1998-2024 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation version 2 and no later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
##########################################################

vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \
> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)

####
#### DESTDIR is where the module, object files, and dependencies are built
####
DESTDIR := driver-$(VM_UNAME)

####
#### DRIVERNAME should be untouched unless you have a good reason to change
#### it. The form below is how the scripts expect it.
####
DRIVERNAME := $(DRIVER)-xxx-$(VM_UNAME)

ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine)))
MACHINE := x86_64
else
MACHINE := x386
endif

ifdef QUIET
ECHO := @true
else
ECHO := @echo
endif

####
#### You must compile with at least -O level of optimization
#### or the module won't load.
#### If desparate, I think that bringing in <linux/bitops.h> might
#### suffice.
####
CC_WARNINGS := -Wall -Wstrict-prototypes
# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \
-fno-common -DKBUILD_MODNAME=$(DRIVER)
CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \
-malign-loops=2 -malign-jumps=2 -malign-functions=2)
CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,)
ifeq ($(MACHINE),x86_64)
CC_KFLAGS += -mno-red-zone -mcmodel=kernel
else
# Gcc 3.0 deprecates -m486 --hpreg
CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486)
endif

CC_OPTS := -O2 -DMODULE -DVMMON -DVMCORE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS)

INCLUDE := -I$(SRCROOT)/include -I$(SRCROOT)/common -I$(SRCROOT)/linux \
-I$(HEADER_DIR)

INCLUDE += $(shell $(CC) $(INCLUDE) -E $(SRCROOT)/autoconf/geninclude.c \
| sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')

C_TARGETS_LINUX := driver.o hostif.o driverLog.o
C_TARGETS_COMMON := vmx86.o memtrack.o phystrack.o cpuid.o task.o crosspage.o moduleloop.o
C_TARGETS_BOOTSTRAP := bootstrap.o
C_TARGETS_LINUX_D := ${C_TARGETS_LINUX:.o=.d}
C_TARGETS_COMMON_D := ${C_TARGETS_COMMON:.o=.d}
C_TARGETS_BOOTSTRAP_D := ${C_TARGETS_BOOTSTRAP:.o=.d}
C_TARGETS := $(C_TARGETS_LINUX) $(C_TARGETS_COMMON) $(C_TARGETS_BOOTSTRAP)

####
#### Make Targets are beneath here.
####

driver: setup deps
$(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) $(DRIVER).o \
INCLUDE_DEPS=1

setup:
@if [ -d $(DESTDIR) ] ; then true ; else mkdir $(DESTDIR); chmod 755 $(DESTDIR) ; fi

$(DRIVER) $(DRIVER).o: $(DRIVERNAME)
cp -f $< $@

$(DRIVERNAME): $(C_TARGETS)
$(ECHO) "Building $(DRIVERNAME)"
ld -r -o $(DRIVERNAME) $(C_TARGETS)

auto-build:
$(MAKE) driver QUIET=1
cp -f $(DESTDIR)/$(DRIVERNAME) $(SRCROOT)/../$(DRIVER).o

$(C_TARGETS_LINUX): %.o: $(SRCROOT)/linux/%.c
$(ECHO) "Compiling linux/$(<F)"
$(CC) $(CC_OPTS) $(INCLUDE) -c $<

$(C_TARGETS_COMMON): %.o: $(SRCROOT)/common/%.c
$(ECHO) "Compiling common/$(<F)"
$(CC) $(CC_OPTS) $(INCLUDE) -c $<

$(C_TARGETS_BOOTSTRAP): %.o: $(SRCROOT)/bootstrap/%.c
$(ECHO) "Compiling bootstrap/$(<F)"
$(CC) $(CC_OPTS) $(INCLUDE) -c $<

clean:
rm -rf $(DESTDIR)/

$(C_TARGETS_COMMON_D): %.d: $(SRCROOT)/common/%.c
$(ECHO) "Dependencies for $(<F)"
$(CC) -MM $(CC_OPTS) $(INCLUDE) $< > $@

$(C_TARGETS_LINUX_D): %.d: $(SRCROOT)/linux/%.c
$(ECHO) "Dependencies for $(<F)"
$(CC) -MM $(CC_OPTS) $(INCLUDE) $< > $@

$(C_TARGETS_BOOTSTRAP_D): %.d: $(SRCROOT)/bootstrap/%.c
$(ECHO) "Dependencies for $(<F)"
$(CC) -MM $(CC_OPTS) $(INCLUDE) $< > $@

deps: setup
$(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) driver_deps

driver_deps: ${C_TARGETS:.o=.d}

ifdef INCLUDE_DEPS
include ${C_TARGETS:.o=.d}
endif

.SILENT:
14 changes: 14 additions & 0 deletions vmmon-only/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
This files in this directory and its subdirectories are the kernel module
portion of the VMware Virtual Machine Monitor. In order to build, make
certain the Makefile is correct, especially in whether or not your system
is multi-processor and then just type

make

from this directory. A copy of the module will be left in

driver-<kernel version>/vmmon.o

(e.g. driver-up-2.0.32/vmmon.o).

If you have any problems or questions, send mail to [email protected]
Loading