1 | # $Id: Config.kmk 106920 2024-11-11 01:09:38Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # kBuild Configuration file for the VMM.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox base platform packages, as
|
---|
10 | # available from https://www.virtualbox.org.
|
---|
11 | #
|
---|
12 | # This program is free software; you can redistribute it and/or
|
---|
13 | # modify it under the terms of the GNU General Public License
|
---|
14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
15 | # License.
|
---|
16 | #
|
---|
17 | # This program is distributed in the hope that it will be useful, but
|
---|
18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | # General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | #
|
---|
25 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | #
|
---|
27 |
|
---|
28 | VBOX_VMM_CONFIG_KMK_INCLUDED = 1
|
---|
29 |
|
---|
30 | # Include the top-level configure file.
|
---|
31 | ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
|
---|
32 | include $(PATH_ROOT)/Config.kmk
|
---|
33 | endif
|
---|
34 |
|
---|
35 | #
|
---|
36 | # Globals
|
---|
37 | #
|
---|
38 |
|
---|
39 | VBOX_PATH_SRC_VMM := $(PATH_ROOT)/src/VBox/VMM
|
---|
40 |
|
---|
41 | ## DEFS variable that is picked up by all three VMM targets (R0, R3, RC).
|
---|
42 | # Can be prepended to by setting it in LocalConfig.kmk
|
---|
43 | VMM_COMMON_DEFS := USING_VMM_COMMON_DEFS
|
---|
44 | ifdef VBOX_WITH_R0_MODULES
|
---|
45 | VMM_COMMON_DEFS += VBOX_WITH_R0_MODULES
|
---|
46 | ifdef VBOX_WITH_MINIMAL_R0
|
---|
47 | VMM_COMMON_DEFS += VBOX_WITH_MINIMAL_R0
|
---|
48 | endif
|
---|
49 | endif
|
---|
50 | ifdef VBOX_WITH_HWVIRT
|
---|
51 | VMM_COMMON_DEFS += VBOX_WITH_HWVIRT
|
---|
52 | endif
|
---|
53 | ifdef VBOX_WITH_NESTED_HWVIRT_SVM
|
---|
54 | VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_SVM
|
---|
55 | endif
|
---|
56 |
|
---|
57 | # IEM config:
|
---|
58 | ifndef IEM_WITHOUT_3DNOW
|
---|
59 | VMM_COMMON_DEFS += IEM_WITH_3DNOW
|
---|
60 | else
|
---|
61 | VMM_COMMON_DEFS += IEM_WITHOUT_3DNOW
|
---|
62 | endif
|
---|
63 | ifndef IEM_WITHOUT_THREE_0F_38
|
---|
64 | VMM_COMMON_DEFS += IEM_WITH_THREE_0F_38
|
---|
65 | else
|
---|
66 | VMM_COMMON_DEFS += IEM_WITHOUT_THREE_0F_38
|
---|
67 | endif
|
---|
68 | ifndef IEM_WITHOUT_THREE_0F_3A
|
---|
69 | VMM_COMMON_DEFS += IEM_WITH_THREE_0F_3A
|
---|
70 | else
|
---|
71 | VMM_COMMON_DEFS += IEM_WITHOUT_THREE_0F_3A
|
---|
72 | endif
|
---|
73 | ifndef IEM_WITHOUT_VEX
|
---|
74 | VMM_COMMON_DEFS += IEM_WITH_VEX
|
---|
75 | else
|
---|
76 | VMM_COMMON_DEFS += IEM_WITHOUT_VEX
|
---|
77 | endif
|
---|
78 | ifdef VBOX_WITH_IEM_RECOMPILER # Selectely removing hwvirt doesn't work yet with the recompiler. Python code doesn't check #ifdefs.
|
---|
79 | VMM_COMMON_DEFS += VBOX_WITH_IEM_RECOMPILER IEM_WITH_CODE_TLB IEM_WITH_DATA_TLB
|
---|
80 | ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER
|
---|
81 | VMM_COMMON_DEFS += VBOX_WITH_IEM_NATIVE_RECOMPILER
|
---|
82 | endif
|
---|
83 | VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_VMX
|
---|
84 | #ifdef VBOX_WITH_NESTED_HWVIRT_VMX_EPT # Busted with TLB enabled.
|
---|
85 | # VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_VMX_EPT
|
---|
86 | #endif
|
---|
87 | ifdef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
|
---|
88 | VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
|
---|
89 | endif
|
---|
90 | else ifdef VBOX_WITH_IEM_TLB ## @todo VMX code doesn't compile with TLBs enabled.
|
---|
91 | VMM_COMMON_DEFS += IEM_WITH_CODE_TLB IEM_WITH_DATA_TLB
|
---|
92 | else
|
---|
93 | ifdef VBOX_WITH_NESTED_HWVIRT_VMX
|
---|
94 | VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_VMX
|
---|
95 | endif
|
---|
96 | ifdef VBOX_WITH_NESTED_HWVIRT_VMX_EPT
|
---|
97 | VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_VMX_EPT
|
---|
98 | endif
|
---|
99 | ifdef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
|
---|
100 | VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
|
---|
101 | endif
|
---|
102 | endif
|
---|
103 | ifdef IEM_WITHOUT_ASSEMBLY
|
---|
104 | VMM_COMMON_DEFS += IEM_WITHOUT_ASSEMBLY
|
---|
105 | endif
|
---|
106 |
|
---|
107 | # part of global DEFS
|
---|
108 | ifdef VBOX_WITH_MULTI_CORE
|
---|
109 | VMM_COMMON_DEFS += VBOX_WITH_MULTI_CORE
|
---|
110 | endif
|
---|
111 | ifdef VBOX_WITH_R0_LOGGING
|
---|
112 | VMM_COMMON_DEFS += VBOX_WITH_R0_LOGGING
|
---|
113 | endif
|
---|
114 | ifdef VBOX_WITH_PCI_PASSTHROUGH
|
---|
115 | VMM_COMMON_DEFS += VBOX_WITH_PCI_PASSTHROUGH
|
---|
116 | endif
|
---|
117 | ifdef VBOX_WITH_DTRACE_RC
|
---|
118 | VMM_COMMON_DEFS += VBOX_WITH_DTRACE_RC
|
---|
119 | endif
|
---|
120 | ifdef VBOX_WITH_SAFE_STR
|
---|
121 | VMM_COMMON_DEFS += VBOX_WITH_SAFE_STR
|
---|
122 | endif
|
---|
123 | ifdef VBOX_WITH_64ON32_CMOS_DEBUG
|
---|
124 | VMM_COMMON_DEFS += VBOX_WITH_64ON32_CMOS_DEBUG
|
---|
125 | endif
|
---|
126 | ifdef VBOXSTRICTRC_STRICT_ENABLED
|
---|
127 | VMM_COMMON_DEFS += VBOXSTRICTRC_STRICT_ENABLED
|
---|
128 | endif
|
---|
129 | if defined(VBOX_WITH_NATIVE_NEM) || !defined(VBOX_WITHOUT_PGM_NEM_MODE)
|
---|
130 | VMM_COMMON_DEFS += VBOX_WITH_PGM_NEM_MODE
|
---|
131 | endif
|
---|
132 | ifdef VBOX_WITH_NATIVE_NEM
|
---|
133 | if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.amd64 linux.amd64 win.amd64)
|
---|
134 | VMM_COMMON_DEFS += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0
|
---|
135 | endif
|
---|
136 | endif
|
---|
137 | if1of ($(KBUILD_TARGET), freebsd linux solaris) # Hosts that implements SUPR0HCPhysToVirt.
|
---|
138 | VMM_COMMON_DEFS += VBOX_WITH_LINEAR_HOST_PHYS_MEM
|
---|
139 | endif
|
---|
140 |
|
---|
141 |
|
---|
142 | # VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS
|
---|
143 |
|
---|
144 |
|
---|
145 | #
|
---|
146 | # Generate macro template for IEM instruction statistics.
|
---|
147 | #
|
---|
148 | # @param 1 The target name.
|
---|
149 | # @param 2 The dir to put the header in.
|
---|
150 | #
|
---|
151 | define def_VBoxGenIEMInstructionStatisticsTmpl_Header
|
---|
152 | $(1)_INTERMEDIATES += $(2)/IEMInstructionStatisticsTmpl.h
|
---|
153 | $(1)_CLEAN += \
|
---|
154 | $(2)/IEMInstructionStatisticsTmpl.h.ts \
|
---|
155 | $(2)/IEMInstructionStatisticsTmpl.h
|
---|
156 | $$(call KB_FN_AUTO_CMD_DEPS,$(2)/IEMInstructionStatisticsTmpl.h.ts)
|
---|
157 | $(2)/IEMInstructionStatisticsTmpl.h.ts \
|
---|
158 | +| $(2)/IEMInstructionStatisticsTmpl.h: \
|
---|
159 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstCommon.cpp.h \
|
---|
160 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstOneByte.cpp.h \
|
---|
161 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstTwoByte0f.cpp.h \
|
---|
162 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstThree0f38.cpp.h \
|
---|
163 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstThree0f3a.cpp.h \
|
---|
164 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstVexMap1.cpp.h \
|
---|
165 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstVexMap2.cpp.h \
|
---|
166 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInstVexMap3.cpp.h \
|
---|
167 | $$(VBOX_PATH_SRC_VMM)/VMMAll/IEMAllInst3DNow.cpp.h
|
---|
168 | $$(QUIET)$(call MSG_GENERATE,$(1),$$@,VMMAll/IEMAllInst*.cpp.h)
|
---|
169 | $$(QUIET)$$(RM) -f -- "$$@.tmp" "$$@.tmp" "$$@.sorted"
|
---|
170 | $$(QUIET)$$(MKDIR) -p -- "$$(dir $$@)"
|
---|
171 | $$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
|
---|
172 | $$(QUIET)$$(SED) \
|
---|
173 | -e '/IEMOP_MNEMONIC\(\|[01234]\|[01234]EX\)(/!d' \
|
---|
174 | -e '/^ *# *define *IEMOP_MNEMONIC/d' \
|
---|
175 | -e ':look-for-end-of-invocation' \
|
---|
176 | -e '/)/bend-of-invocation' \
|
---|
177 | -e 'N' \
|
---|
178 | -e 'blook-for-end-of-invocation' \
|
---|
179 | -e ':end-of-invocation' \
|
---|
180 | -e 's/\n/ /g' \
|
---|
181 | -e 's/ */ /g' \
|
---|
182 | -e 's/^.*IEMOP_MNEMONIC\(\|[01234]\|[01234]EX\)(/IEM_DO_INSTR_STAT\1(/' \
|
---|
183 | -e 's/;.*$$(DOLLAR)//' \
|
---|
184 | --output "$$@.tmp" $$(filter %.cpp.h,$$^)
|
---|
185 | # Windows sort does some kind of seeking. So, we must use a temporary file and kmk_cat to define and undefine our macros.
|
---|
186 | $$(QUIET)$$(REDIRECT) -wto "$$@.sorted" -- sort "$$@.tmp"
|
---|
187 | $$(QUIET)$$(APPEND) -nt "$$@" \
|
---|
188 | '/* Warning autogenerated by VMM/Makefile.kmk. */ ' \
|
---|
189 | '#define IEM_DO_INSTR_STAT0(f,u,l,fd,fi) IEM_DO_INSTR_STAT(l, #l)' \
|
---|
190 | '#define IEM_DO_INSTR_STAT1(f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1, #l " " #o1)' \
|
---|
191 | '#define IEM_DO_INSTR_STAT2(f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2, #l " " #o1 "," #o2)' \
|
---|
192 | '#define IEM_DO_INSTR_STAT3(f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3, #l " " #o1 "," #o2 "," #o3)' \
|
---|
193 | '#define IEM_DO_INSTR_STAT4(f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3 ## _ ## o4, #l " " #o1 "," #o2 "," #o3 "," #o4)' \
|
---|
194 | '#define IEM_DO_INSTR_STAT0EX(s,m,f,u,l,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
|
---|
195 | '#define IEM_DO_INSTR_STAT1EX(s,m,f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
|
---|
196 | '#define IEM_DO_INSTR_STAT2EX(s,m,f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
|
---|
197 | '#define IEM_DO_INSTR_STAT3EX(s,m,f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
|
---|
198 | '#define IEM_DO_INSTR_STAT4EX(s,m,f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
|
---|
199 | ''
|
---|
200 | $$(QUIET)$$(REDIRECT) -ato "$$@" -- $$(CAT_EXT) "$$@.sorted"
|
---|
201 | $$(QUIET)$$(APPEND) -n "$$@" \
|
---|
202 | '' \
|
---|
203 | '#undef IEM_DO_INSTR_STAT0' \
|
---|
204 | '#undef IEM_DO_INSTR_STAT1' \
|
---|
205 | '#undef IEM_DO_INSTR_STAT2' \
|
---|
206 | '#undef IEM_DO_INSTR_STAT3' \
|
---|
207 | '#undef IEM_DO_INSTR_STAT4' \
|
---|
208 | '#undef IEM_DO_INSTR_STAT0EX' \
|
---|
209 | '#undef IEM_DO_INSTR_STAT1EX' \
|
---|
210 | '#undef IEM_DO_INSTR_STAT2EX' \
|
---|
211 | '#undef IEM_DO_INSTR_STAT3EX' \
|
---|
212 | '#undef IEM_DO_INSTR_STAT4EX' \
|
---|
213 | ''
|
---|
214 | $$(QUIET)$$(RM) -f -- "$$@.tmp" "$$@.sorted"
|
---|
215 | $$(QUIET)$$(CP) -v -f --changed -- "$$@" "$$(patsubst %.ts,%,$$@)"
|
---|
216 |
|
---|
217 | endef
|
---|