Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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"
4 changes: 2 additions & 2 deletions vmmon-only/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ INCLUDE += -I$(SRCROOT)/shared
endif


VM_UNAME = $(shell uname -r)
VM_UNAME ?= $(shell uname -r)

# Header directory for the running kernel
ifdef LINUXINCLUDE
Expand Down Expand Up @@ -122,7 +122,7 @@ endif

vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
$(ccflags-y) -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)
Expand Down
5 changes: 3 additions & 2 deletions vmmon-only/Makefile.kernel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/make -f
##########################################################
# Copyright (C) 1998,2015,2020 VMware, Inc. All rights reserved.
# 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
Expand All @@ -20,7 +21,7 @@
CC_OPTS += -DVMMON -DVMCORE

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

obj-m += $(DRIVER).o

Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/Makefile.normal
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/make -f
##########################################################
# Copyright (C) 1998,2015,2017,2020 VMware, Inc. All rights reserved.
# 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
Expand Down
8 changes: 5 additions & 3 deletions vmmon-only/bootstrap/bootstrap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************
* Copyright (C) 2015 VMware, Inc. All rights reserved.
* Copyright (C) 2015,2023 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
Expand All @@ -19,10 +19,11 @@
/*
* bootstrap.c --
*
* Implements the early VMM bootstraping code that is executed
* by the host (vmmon/VMKernel) to create the VMM context.
* Implements the early VMM bootstraping code that is executed
* by the host (vmmon/VMKernel) to create the VMM context.
*/

#if !defined VMKERNEL || defined VMK_HAS_VMM
#include "vm_basic_types.h"
#include "vm_basic_defs.h"
#include "bootstrap_vmm.h"
Expand Down Expand Up @@ -51,3 +52,4 @@ BSVMM_Validate(void *buf, uint32 nbytes)
}
return bsParams;
}
#endif
4 changes: 3 additions & 1 deletion vmmon-only/bootstrap/monLoader.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************
* Copyright (c) 2015-2022 VMware, Inc. All rights reserved.
* Copyright (c) 2015-2023 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
Expand Down Expand Up @@ -53,6 +53,7 @@
#error MonLoader cannot be built as part of this environment
#endif

#if !defined VMKERNEL || defined VMK_HAS_VMM
#include "vm_basic_types.h"
#include "monLoader.h"
#include "vcpuid.h"
Expand Down Expand Up @@ -914,3 +915,4 @@ MonLoader_Process(MonLoaderHeader *header, // IN/OUT
MonLoaderCallout_CleanUp(ctx.envCtx);
return ret;
}
#endif
3 changes: 2 additions & 1 deletion vmmon-only/bootstrap/monLoaderVmmon.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (c) 2016-2020 VMware, Inc. All rights reserved.
* Copyright (c) 2016-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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/bootstrap/vmmblob.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 2017-2020, 2022 VMware, Inc. All rights reserved.
* Copyright (c) 2017-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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/apic.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (c) 2011, 2016, 2018,2020 VMware, Inc. All rights reserved.
* Copyright (c) 2011-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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/apic.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 2011 VMware, Inc. All rights reserved.
* Copyright (c) 2011-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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/comport.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 2006,2016,2021 VMware, Inc. All rights reserved.
* Copyright (c) 2006-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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/cpuid.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (c) 1998, 2016-2022 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/cpuid.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (c) 1998, 2016-2019 VMware, Inc. All rights reserved.
* 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
Expand Down
91 changes: 47 additions & 44 deletions vmmon-only/common/crosspage.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 2016-2022 VMware, Inc. All rights reserved.
* Copyright (c) 2016-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
Expand Down Expand Up @@ -59,7 +60,7 @@
#include "segs.h"
#include "x86_basic_defs.h"
#include "vm_basic_defs.h"
#include "vm_idt_x86.h"
#include "vm_idt.h"
#include "crosspage.h"

/*
Expand Down Expand Up @@ -93,10 +94,6 @@

#define NOT_REACHED_MINIMAL __builtin_unreachable

#ifndef ASM_RET
#define ASM_RET "ret\n"
#endif

void VmmToHost(void);
void SwitchDBHandler(void);
void SwitchUDHandler(void);
Expand Down Expand Up @@ -240,6 +237,38 @@ CrossPageInitSwitchIDTs(struct VMCrossPageData *cpData)
CrossPageVmmCodeVA(SwitchMCEHandler));
}

/*
*---------------------------------------------------------------------------
*
* SwitchExcGetCrossPageData --
*
* Common code for the exception handlers to locate the data
* crosspage so they can record their respective events. In order to
* reach this code an exception had to vector through the IDT. The IDT
* is known to be in the data page. Therefore, the data page can be
* found by accessing IDTR and rounding down to page alignment.
*
* Input:
* None
*
* Output:
* %rax = Page aligned address of the current crosspage data area.
*
* Note:
* %rax (return value) and %rflags are destroyed, all other registers
* are preserved. Since this is only called by exception handlers, the
* CPU has already saved %rflags so no additional handling is required.
*
*---------------------------------------------------------------------------
*/

#define SwitchExcGetCrossPageData \
"subq $0x10, %%rsp\n" \
"sidt 0(%%rsp)\n" \
"movq 2(%%rsp), %%rax\n" /* DTR.offset */ \
"addq $0x10, %%rsp\n" \
"andq %[PageAlignMask], %%rax\n"


/*
*-----------------------------------------------------------------------------
Expand Down Expand Up @@ -303,7 +332,9 @@ CrossPage_CodePage(void)
EXPORTED_ASM_SYMBOL(SwitchDBHandler)
ASM_ENDBR
"pushq %%rax\n"
"call SwitchExcGetCrossPageData\n"

SwitchExcGetCrossPageData

"addq %[wsExceptionDB], %%rax\n"
"movb $1, (%%rax)\n" /* log EXC_DB */
"popq %%rax\n"
Expand Down Expand Up @@ -344,7 +375,9 @@ CrossPage_CodePage(void)
"pushq %%rax\n"
"pushq %%rbx\n"
"pushq %%rcx\n"
"call SwitchExcGetCrossPageData\n"

SwitchExcGetCrossPageData

"movl %[wsExceptionUD], %%ecx\n" /* log EXC_UD */
"movb $1, (%%rax, %%rcx)\n"
/* Check if the exception came from a monitor RIP. */
Expand Down Expand Up @@ -411,7 +444,9 @@ CrossPage_CodePage(void)
EXPORTED_ASM_SYMBOL(SwitchNMIHandler)
ASM_ENDBR
"pushq %%rax\n"
"call SwitchExcGetCrossPageData\n"

SwitchExcGetCrossPageData

"addq %[wsExceptionNMI], %%rax\n"
"movb $1, (%%rax)\n" /* log EXC_NMI */
"popq %%rax\n"
Expand Down Expand Up @@ -447,7 +482,9 @@ CrossPage_CodePage(void)
EXPORTED_ASM_SYMBOL(SwitchMCEHandler)
ASM_ENDBR
"pushq %%rax\n"
"call SwitchExcGetCrossPageData\n"

SwitchExcGetCrossPageData

"addq %[wsExceptionMC], %%rax\n"
"movb $1, (%%rax)\n" /* log EXC_MC */
"popq %%rax\n"
Expand Down Expand Up @@ -617,40 +654,6 @@ CrossPage_CodePage(void)
"cld\n"
"lretq\n"

/*
*---------------------------------------------------------------------------
*
* SwitchExcGetCrossPageData --
*
* Common function for the exception handlers to locate the data
* crosspage so they can record their respective events. In order to
* reach this code an exception had to vector through the IDT. The IDT
* is known to be in the data page. Therefore, the data page can be
* found by accessing IDTR and rounding down to page alignment.
*
* Input:
* None
*
* Output:
* %rax = Page aligned address of the current crosspage data area.
*
* Note:
* %rax (return value) and %rflags are destroyed, all other registers
* are preserved. Since this is only called by exception handlers, the
* CPU has already saved %rflags so no additional handling is required.
*
*---------------------------------------------------------------------------
*/

".p2align 4\n"
"SwitchExcGetCrossPageData:\n"
"subq $0x10, %%rsp\n"
"sidt 0(%%rsp)\n"
"movq 2(%%rsp), %%rax\n" /* DTR.offset */
"addq $0x10, %%rsp\n"
"andq %[PageAlignMask], %%rax\n"
ASM_RET

EXPORTED_ASM_SYMBOL(CrossPage_CodeEnd)

: /* No output list, this is not really C code. */
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/crosspage.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 2020 VMware, Inc. All rights reserved.
* Copyright (c) 2020-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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/hostKernel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 1998,2019 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/hostif.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (c) 1998-2021 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/hostifGlobalLock.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 1998 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/hostifMem.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (c) 1998, 2008, 2018 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/memtrack.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 1998-2018,2020 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/memtrack.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 1998,2017-2018,2020 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/moduleloop.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 1998-2020 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/phystrack.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 1998,2014,2019-2021 VMware, Inc. All rights reserved.
* 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
Expand Down
3 changes: 2 additions & 1 deletion vmmon-only/common/phystrack.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*********************************************************
* Copyright (C) 1998,2019 VMware, Inc. All rights reserved.
* 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
Expand Down
Loading