VirtualBox

source: vbox/trunk/src/VBox/VMM/Makefile.kmk@ 60441

Last change on this file since 60441 was 60398, checked in by vboxsync, 9 years ago

VMM/APIC: Get rid of specialized R0 code and clean up ordering issues.
It's still not nice that CPUMR3Reset() momentarily gets an un-initialized APIC base MSR until
it's re-cached again using CPUMR3InitCompleted() but I hope to eventually get rid of this
caching business entirely once the old APIC infrastructure can be kicked out.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.1 KB
Line 
1# $Id: Makefile.kmk 60398 2016-04-08 16:29:01Z vboxsync $
2## @file
3# Top-level makefile for the VMM.
4#
5
6#
7# Copyright (C) 2006-2015 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21# Include sub-makefiles.
22ifndef VBOX_ONLY_EXTPACKS
23 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
24endif
25include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
26
27
28# Fail on unsupported hosts.
29ifeq ($(KBUILD_TARGET_ARCH),x86)
30 ifeq ($(KBUILD_TARGET),darwin)
31 $(error 32-bit darwin is no longer a supported VirtualBox host. Go back to 4.3 or older for 32-bit support.)
32 else ifeq ($(KBUILD_TARGET),solaris)
33 $(error 32-bit solaris is no longer a supported VirtualBox host. Go back to 4.2 or older for 32-bit support.)
34 endif
35endif
36
37
38#
39# Globals
40#
41
42## DEFS variable that is picked up by all three VMM targets (R0, R3, RC).
43# Can be prepended to by setting it in LocalConfig.kmk
44VMM_COMMON_DEFS ?= VBOX_IN_VMM
45ifdef VBOX_WITH_2ND_IEM_STEP
46 VMM_COMMON_DEFS += VBOX_WITH_2ND_IEM_STEP
47endif
48ifdef VBOX_WITH_3RD_IEM_STEP
49 VMM_COMMON_DEFS += VBOX_WITH_3RD_IEM_STEP
50endif
51#ifdef VBOX_WITH_IEM
52# VMM_COMMON_DEFS += VBOX_WITH_IEM
53#endif
54ifdef VBOX_WITH_REM
55 VMM_COMMON_DEFS += VBOX_WITH_REM
56endif
57ifdef VBOX_WITH_MULTI_CORE
58 VMM_COMMON_DEFS += VBOX_WITH_MULTI_CORE
59endif
60ifdef VBOX_WITH_R0_LOGGING
61 VMM_COMMON_DEFS += VBOX_WITH_R0_LOGGING
62endif
63ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
64 VMM_COMMON_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
65endif
66ifdef VBOX_WITH_PCI_PASSTHROUGH
67 VMM_COMMON_DEFS += VBOX_WITH_PCI_PASSTHROUGH
68endif
69ifdef VBOX_WITH_DTRACE_RC
70 VMM_COMMON_DEFS += VBOX_WITH_DTRACE_RC
71endif
72ifdef VBOX_WITH_SAFE_STR
73 VMM_COMMON_DEFS += VBOX_WITH_SAFE_STR
74endif
75ifdef VBOX_WITH_RAW_RING1
76 VMM_COMMON_DEFS += VBOX_WITH_RAW_RING1
77endif
78ifdef VBOX_WITH_64ON32_IDT
79 VMM_COMMON_DEFS += VBOX_WITH_64ON32_IDT
80endif
81ifdef VBOX_WITH_64ON32_CMOS_DEBUG
82 VMM_COMMON_DEFS += VBOX_WITH_64ON32_CMOS_DEBUG
83endif
84ifdef VBOXSTRICTRC_STRICT_ENABLED
85 VMM_COMMON_DEFS += VBOXSTRICTRC_STRICT_ENABLED
86endif
87ifeq ($(KBUILD_TARGET),amd64)
88 VMM_COMMON_DEFS += VBOX_WITH_MORE_RING0_MEM_MAPPINGS
89endif
90ifdef VBOX_WITH_NEW_APIC
91 VMM_COMMON_DEFS += VBOX_WITH_NEW_APIC
92endif
93
94# VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS
95
96# Special IEM debug mode which compares the result with HM/REM
97ifdef IEM_VERIFICATION_MODE
98 VMM_COMMON_DEFS += IEM_VERIFICATION_MODE IEM_VERIFICATION_MODE_FULL IEM_VERIFICATION_MODE_FULL_HM
99endif
100
101
102#
103# The VMM DLL.
104#
105ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
106 DLLS += VBoxVMM
107endif
108VBoxVMM_TEMPLATE = VBoxR3DllNoPic
109VBoxVMM_SONAME.linux = VBoxVMM.so
110
111VBoxVMM_DEFS = IN_VMM_R3 IN_DIS IN_GMM_R3 IN_DBG $(VMM_COMMON_DEFS)
112## @todo eliminate IN_GMM_R3
113ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
114 VBoxVMM_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
115endif
116ifdef VBOX_WITH_VUSB
117 VBoxVMM_DEFS += VBOX_WITH_USB
118endif
119ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
120 VBoxVMM_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
121endif
122ifdef VBOX_WITH_NETSHAPER
123 VBoxVMM_DEFS += VBOX_WITH_NETSHAPER
124endif
125ifdef VBOX_WITH_RAW_MODE
126 VBoxVMM_DEFS += VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0
127endif
128ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
129 VBoxVMM_DEFS += VMM_R0_SWITCH_STACK
130endif
131if "$(KBUILD_TYPE)" == "debug" && "$(USERNAME)" == "bird"
132 VBoxVMM_DEFS += RTMEM_WRAP_TO_EF_APIS
133endif
134VBoxVMM_DEFS.darwin = VMM_R0_SWITCH_STACK
135
136VBoxVMM_INCS = \
137 include \
138 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
139VBoxVMM_ASINCS = .
140
141VBoxVMM_SOURCES = \
142 VBoxVMM.d \
143 VMMR3/CFGM.cpp \
144 VMMR3/CPUM.cpp \
145 VMMR3/CPUMR3CpuId.cpp \
146 VMMR3/CPUMR3Db.cpp \
147 VMMR3/CPUMDbg.cpp \
148 VMMR3/DBGF.cpp \
149 VMMR3/DBGFAddr.cpp \
150 VMMR3/DBGFAddrSpace.cpp \
151 VMMR3/DBGFBp.cpp \
152 VMMR3/DBGFCoreWrite.cpp \
153 VMMR3/DBGFCpu.cpp \
154 VMMR3/DBGFDisas.cpp \
155 VMMR3/DBGFInfo.cpp \
156 VMMR3/DBGFLog.cpp \
157 VMMR3/DBGFMem.cpp \
158 VMMR3/DBGFOS.cpp \
159 VMMR3/DBGFR3PlugIn.cpp \
160 VMMR3/DBGFReg.cpp \
161 VMMR3/DBGFStack.cpp \
162 VMMR3/DBGFR3Trace.cpp \
163 VMMR3/EM.cpp \
164 VMMR3/EMR3Dbg.cpp \
165 $(if $(VBOX_WITH_RAW_MODE),VMMR3/EMRaw.cpp) \
166 VMMR3/EMHM.cpp \
167 VMMR3/FTM.cpp \
168 VMMR3/GIM.cpp \
169 VMMR3/GIMHv.cpp \
170 VMMR3/GIMKvm.cpp \
171 VMMR3/GIMMinimal.cpp \
172 VMMR3/IEMR3.cpp \
173 VMMR3/IOM.cpp \
174 VMMR3/GMM.cpp \
175 VMMR3/MM.cpp \
176 VMMR3/MMHeap.cpp \
177 VMMR3/MMHyper.cpp \
178 VMMR3/MMPagePool.cpp \
179 VMMR3/MMUkHeap.cpp \
180 VMMR3/PDM.cpp \
181 VMMR3/PDMBlkCache.cpp \
182 VMMR3/PDMDevice.cpp \
183 VMMR3/PDMDevHlp.cpp \
184 VMMR3/PDMDevMiscHlp.cpp \
185 VMMR3/PDMDriver.cpp \
186 VMMR3/PDMLdr.cpp \
187 VMMR3/PDMCritSect.cpp \
188 VMMR3/PDMQueue.cpp \
189 VMMR3/PDMThread.cpp \
190 VMMR3/PGM.cpp \
191 VMMR3/PGMDbg.cpp \
192 VMMR3/PGMR3DbgA.asm \
193 VMMR3/PGMHandler.cpp \
194 VMMR3/PGMMap.cpp \
195 VMMR3/PGMPhys.cpp \
196 VMMR3/PGMPool.cpp \
197 VMMR3/PGMSavedState.cpp \
198 VMMR3/PGMSharedPage.cpp \
199 VMMR3/SELM.cpp \
200 VMMR3/SSM.cpp \
201 VMMR3/STAM.cpp \
202 VMMR3/TM.cpp \
203 VMMR3/TRPM.cpp \
204 VMMR3/VM.cpp \
205 VMMR3/VMEmt.cpp \
206 VMMR3/VMReq.cpp \
207 VMMR3/VMM.cpp \
208 VMMR3/VMMGuruMeditation.cpp \
209 VMMR3/VMMSwitcher.cpp \
210 VMMR3/VMMTests.cpp \
211 VMMR3/HM.cpp \
212 $(if-expr defined(VBOX_WITH_RAW_MODE), \
213 VMMR3/CSAM.cpp \
214 VMMR3/PATM.cpp \
215 VMMR3/PATMPatch.cpp \
216 VMMR3/PATMGuest.cpp \
217 VMMR3/PATMA.asm \
218 VMMR3/PATMSSM.cpp \
219 VMMR3/PATMR3Dbg.cpp \
220 ,) \
221 VMMAll/CPUMAllRegs.cpp \
222 VMMAll/CPUMAllMsrs.cpp \
223 VMMAll/CPUMStack.cpp \
224 VMMAll/DBGFAll.cpp \
225 VMMAll/HMAll.cpp \
226 VMMAll/IEMAll.cpp \
227 VMMAll/IEMAllAImpl.asm \
228 VMMAll/IEMAllAImplC.cpp \
229 VMMAll/IOMAll.cpp \
230 VMMAll/IOMAllMMIO.cpp \
231 VMMAll/MMAll.cpp \
232 VMMAll/MMAllHyper.cpp \
233 VMMAll/MMAllPagePool.cpp \
234 VMMAll/PDMAll.cpp \
235 VMMAll/PDMAllCritSect.cpp \
236 VMMAll/PDMAllCritSectRw.cpp \
237 VMMAll/PDMAllCritSectBoth.cpp \
238 VMMAll/PDMAllQueue.cpp \
239 VMMAll/PGMAll.cpp \
240 VMMAll/PGMAllHandler.cpp \
241 VMMAll/PGMAllMap.cpp \
242 VMMAll/PGMAllPhys.cpp \
243 VMMAll/PGMAllPool.cpp \
244 VMMAll/REMAll.cpp \
245 VMMAll/SELMAll.cpp \
246 VMMAll/EMAll.cpp \
247 VMMAll/EMAllA.asm \
248 VMMAll/FTMAll.cpp \
249 VMMAll/GIMAll.cpp \
250 VMMAll/GIMAllHv.cpp \
251 VMMAll/GIMAllKvm.cpp \
252 VMMAll/TMAll.cpp \
253 VMMAll/TMAllCpu.cpp \
254 VMMAll/TMAllReal.cpp \
255 VMMAll/TMAllVirtual.cpp \
256 VMMAll/TRPMAll.cpp \
257 VMMAll/VMAll.cpp \
258 VMMAll/VMMAll.cpp \
259 VMMAll/VMMAllA.asm \
260 $(if-expr defined(VBOX_WITH_RAW_MODE), \
261 VMMAll/CSAMAll.cpp \
262 VMMAll/PATMAll.cpp \
263 ,)
264ifdef VBOX_WITH_VUSB
265 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
266endif
267ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
268 VBoxVMM_SOURCES += \
269 VMMR3/PDMAsyncCompletion.cpp \
270 VMMR3/PDMAsyncCompletionFile.cpp \
271 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
272 VMMR3/PDMAsyncCompletionFileNormal.cpp
273endif
274ifdef VBOX_WITH_NETSHAPER
275 VBoxVMM_SOURCES += \
276 VMMR3/PDMNetShaper.cpp \
277 VMMAll/PDMAllNetShaper.cpp
278endif
279ifdef VBOX_WITH_NEW_APIC
280 VBoxVMM_SOURCES += \
281 VMMR3/APIC.cpp \
282 VMMAll/APICAll.cpp
283endif
284
285ifdef VBOX_WITH_RAW_MODE
286 VBoxVMM_SOURCES.x86 += \
287 VMMSwitcher/32BitTo32Bit.asm \
288 VMMSwitcher/32BitToPAE.asm \
289 VMMSwitcher/PAETo32Bit.asm \
290 VMMSwitcher/PAEToPAE.asm
291 VBoxVMM_SOURCES.amd64 = \
292 VMMSwitcher/AMD64To32Bit.asm \
293 VMMSwitcher/AMD64ToPAE.asm
294endif
295VBoxVMM_SOURCES.x86 += \
296 VMMSwitcher/32BitToAMD64.asm \
297 VMMSwitcher/PAEToAMD64.asm \
298 VMMSwitcher/X86Stub.asm
299VBoxVMM_SOURCES.amd64 += \
300 VMMSwitcher/AMD64Stub.asm
301
302VBoxVMM_LIBS = \
303 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
304ifdef VBOX_WITH_DEBUGGER
305 VBoxVMM_LIBS += \
306 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
307endif
308VBoxVMM_LIBS += \
309 $(LIB_REM) \
310 $(LIB_RUNTIME)
311
312VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
313VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
314VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
315VBoxVMM_LDFLAGS.solaris = -mimpure-text
316
317# SSM wish to know the build type, host os and arch.
318VMMR3/SSM.cpp_DEFS += \
319 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
320 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
321 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
322
323
324#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
325# ifeq ($(KBUILD_HOST), linux)
326#VBoxVMM_LIBS += aio
327# endif
328#endif
329
330$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
331
332
333if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
334
335 #
336 # VMMRCBuiltin.lib
337 #
338 LIBRARIES += VMMRCBuiltin
339 VMMRCBuiltin_TEMPLATE = VBoxRc
340 ifeq ($(VBOX_LDR_FMT32),pe)
341 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
342 endif
343 ifeq ($(VBOX_LDR_FMT32),lx)
344 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
345 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
346 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
347 endif
348
349
350 #
351 # VMMRCImp.lib
352 #
353 LIBRARIES += VMMRCImp
354 VMMRCImp_TEMPLATE = VBoxRc
355 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
356 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
357
358 $$(VMMRCImp_0_OUTDIR)/VMMRC.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRC.def | $$(dir $$@)
359 ifeq ($(VBOX_LDR_FMT32),lx)
360 $(SED) \
361 -e '/not-os2/d' \
362 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
363 -e 's/[ \t]DATA[ \t]*/ /' \
364 --output $@ \
365 $<
366 $(APPEND) "$@" ""
367 $(APPEND) "$@" " ___ehInit"
368 else
369 $(SED) \
370 -e '/not-win/d' \
371 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
372 --output $@ $<
373 endif
374
375endif # RC && (pe || lx)
376
377
378if1of ($(VBOX_LDR_FMT), pe lx)
379 #
380 # VMMR0Imp.lib
381 #
382 LIBRARIES += VMMR0Imp
383 VMMR0Imp_TEMPLATE = VBoxR0
384 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
385 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
386 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
387 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
388 endif
389
390 $$(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(PATH_SUB_CURRENT)/VMMR0/VMMR0.def | $$(dir $$@)
391 ifeq ($(VBOX_LDR_FMT),lx)
392 $(SED) \
393 -e '/not-os2/d' \
394 -e '/not-amd64/d' \
395 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
396 -e 's/[ \t]DATA[ \t]*/ /' \
397 --output $@ $<
398 $(APPEND) "$@" ""
399 $(APPEND) "$@" " ___ehInit"
400 else
401 $(SED) \
402 -e '/not-win/d' \
403 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
404 --output $@ $<
405 endif
406endif # R0: pe + lx
407
408
409#
410# VMMR3Imp.lib
411#
412IMPORT_LIBS += VMMR3Imp
413$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
414
415ifneq ($(VBOX_LIB_VMM_LAZY),$(LIB_VMM))
416 #
417 # VMMR3LazyImp.lib (experimental)
418 #
419 LIBRARIES += VMMR3LazyImp
420 VMMR3LazyImp_TEMPLATE = VBoxR3Dll
421 VMMR3LazyImp_INST = $(INST_LIB)
422 VMMR3LazyImp_SOURCES = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
423 VMMR3LazyImp_CLEAN = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
424 $$(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm: $(PATH_SUB_CURRENT)/VMMR3/VMMR3.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
425 $(VBOX_DEF_2_LAZY_LOAD) --output $@ --library VBoxVMM $<
426endif
427
428
429if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
430 #
431 # VMMRC.rc
432 #
433 SYSMODS += VMMRC
434 VMMRC_TEMPLATE = VBoxRc
435 VMMRC_NAME = VMMRC
436
437 VMMRC_DEFS = IN_VMM_RC IN_RT_RC IN_DIS DIS_CORE_ONLY VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0 IN_SUP_RC \
438 $(VMM_COMMON_DEFS)
439 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
440 VMMRC_DEFS += VMM_R0_SWITCH_STACK
441 endif
442
443 VMMRC_INCS := \
444 include \
445 VMMRC \
446 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
447
448 VMMRC_LIBS = \
449 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
450 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB) \
451 $(PATH_STAGE_LIB)/SUPRC$(VBOX_SUFF_LIB)
452 ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
453 VMMRC_LIBS += \
454 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB)
455 endif
456
457 VMMRC_SOURCES = \
458 VBoxVMM.d \
459 VMMRC/VMMRC0.asm \
460 VMMRC/VMMRCDeps.cpp \
461 VMMRC/CPUMRC.cpp \
462 VMMRC/CPUMRCA.asm \
463 VMMRC/CPUMRCPatchHlp.asm \
464 VMMRC/EMRCA.asm \
465 VMMRC/IOMRC.cpp \
466 VMMRC/MMRamRC.cpp \
467 VMMRC/MMRamRCA.asm \
468 VMMRC/PDMRCDevice.cpp \
469 VMMRC/PGMRC.cpp \
470 VMMRC/SELMRC.cpp \
471 VMMRC/TRPMRC.cpp \
472 VMMRC/TRPMRCHandlers.cpp \
473 VMMRC/TRPMRCHandlersA.asm \
474 VMMRC/VMMRC.cpp \
475 VMMRC/VMMRCA.asm \
476 $(if-expr defined(VBOX_WITH_RAW_MODE), \
477 VMMRC/CSAMRC.cpp \
478 VMMRC/PATMRC.cpp \
479 ,) \
480 VMMRZ/DBGFRZ.cpp \
481 VMMRZ/PGMRZDynMap.cpp \
482 VMMRZ/VMMRZ.cpp \
483 VMMAll/CPUMAllRegs.cpp \
484 VMMAll/CPUMAllMsrs.cpp \
485 VMMAll/DBGFAll.cpp \
486 VMMAll/IEMAll.cpp \
487 VMMAll/IEMAllAImpl.asm \
488 VMMAll/IEMAllAImplC.cpp \
489 VMMAll/IOMAll.cpp \
490 VMMAll/IOMAllMMIO.cpp \
491 VMMAll/EMAll.cpp \
492 VMMAll/EMAllA.asm \
493 VMMAll/FTMAll.cpp \
494 VMMAll/GIMAll.cpp \
495 VMMAll/GIMAllHv.cpp \
496 VMMAll/GIMAllKvm.cpp \
497 VMMAll/MMAll.cpp \
498 VMMAll/MMAllHyper.cpp \
499 VMMAll/PDMAll.cpp \
500 VMMAll/PDMAllCritSect.cpp \
501 VMMAll/PDMAllCritSectRw.cpp \
502 VMMAll/PDMAllCritSectBoth.cpp \
503 VMMAll/PDMAllQueue.cpp \
504 VMMAll/PGMAll.cpp \
505 VMMAll/PGMAllHandler.cpp \
506 VMMAll/PGMAllMap.cpp \
507 VMMAll/PGMAllPhys.cpp \
508 VMMAll/PGMAllPool.cpp \
509 VMMAll/REMAll.cpp \
510 VMMAll/SELMAll.cpp \
511 VMMAll/TMAll.cpp \
512 VMMAll/TMAllCpu.cpp \
513 VMMAll/TMAllReal.cpp \
514 VMMAll/TMAllVirtual.cpp \
515 VMMAll/TRPMAll.cpp \
516 VMMAll/VMAll.cpp \
517 VMMAll/VMMAll.cpp \
518 VMMAll/VMMAllA.asm \
519 $(if-expr defined(VBOX_WITH_RAW_MODE), \
520 VMMAll/CSAMAll.cpp \
521 VMMAll/PATMAll.cpp \
522 ,)
523 ifeq ($(VBOX_LDR_FMT32),pe)
524 VMMRC_SOURCES += VMMRC/VMMRC.def
525 endif
526 ifeq ($(VBOX_LDR_FMT32),lx)
527 VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
528 endif
529 ifdef VBOX_WITH_NEW_APIC
530 VMMRC_SOURCES += VMMAll/APICAll.cpp
531 endif
532
533 # the very last one.
534 VMMRC_SOURCES += VMMRC/VMMRC99.asm
535
536 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
537
538 $(call VBOX_SET_VER_INFO_RC,VMMRC,VirtualBox VMM - raw-mode context parts) # Version info / description.
539endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
540
541
542ifndef VBOX_ONLY_EXTPACKS
543 #
544 # VMMR0.r0
545 #
546 SYSMODS += VMMR0
547 VMMR0_TEMPLATE = VBoxR0
548 VMMR0_SYSSUFF = .r0
549
550 VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
551 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
552 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
553 ifdef VBOX_WITH_PCI_PASSTHROUGH
554 VMMR0_DEFS += IN_PCIRAW_R0
555 endif
556 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
557 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
558 endif
559 ifdef VBOX_WITH_RAW_MODE
560 VMMR0_DEFS += VBOX_WITH_RAW_MODE
561 endif
562 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
563 VMMR0_DEFS += VMM_R0_SWITCH_STACK
564 endif
565 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
566 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
567
568 ifeq ($(VBOX_LDR_FMT),elf)
569 VMMR0_CXXFLAGS += $(filter-out -Wno-unused,$(TEMPLATE_VBoxR0_CXXFLAGS)) -Wunused-variable -Wno-unused-parameter
570 endif
571
572 VMMR0_INCS = \
573 include \
574 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
575
576 VMMR0_SOURCES = \
577 VBoxVMM.d \
578 VMMR0/CPUMR0.cpp \
579 VMMR0/CPUMR0A.asm \
580 VMMR0/GIMR0.cpp \
581 VMMR0/GIMR0Hv.cpp \
582 VMMR0/GIMR0Kvm.cpp \
583 VMMR0/GMMR0.cpp \
584 VMMR0/GVMMR0.cpp \
585 VMMR0/HMR0.cpp \
586 VMMR0/HMR0A.asm \
587 VMMR0/HMVMXR0.cpp \
588 VMMR0/HMSVMR0.cpp \
589 VMMR0/PDMR0Device.cpp \
590 VMMR0/PDMR0Driver.cpp \
591 VMMR0/PGMR0.cpp \
592 VMMR0/PGMR0SharedPage.cpp \
593 VMMR0/TRPMR0.cpp \
594 VMMR0/TRPMR0A.asm \
595 VMMR0/VMMR0.cpp \
596 VMMRZ/DBGFRZ.cpp \
597 VMMRZ/VMMRZ.cpp \
598 VMMAll/CPUMAllRegs.cpp \
599 VMMAll/CPUMAllMsrs.cpp \
600 VMMAll/CPUMStack.cpp \
601 VMMAll/DBGFAll.cpp \
602 VMMAll/EMAll.cpp \
603 VMMAll/EMAllA.asm \
604 VMMAll/FTMAll.cpp \
605 VMMAll/GIMAll.cpp \
606 VMMAll/GIMAllHv.cpp \
607 VMMAll/GIMAllKvm.cpp \
608 VMMAll/HMAll.cpp \
609 VMMAll/IEMAll.cpp \
610 VMMAll/IEMAllAImpl.asm \
611 VMMAll/IEMAllAImplC.cpp \
612 VMMAll/IOMAll.cpp \
613 VMMAll/IOMAllMMIO.cpp \
614 VMMAll/MMAll.cpp \
615 VMMAll/MMAllHyper.cpp \
616 VMMAll/MMAllPagePool.cpp \
617 VMMAll/PDMAll.cpp \
618 VMMAll/PDMAllCritSect.cpp \
619 VMMAll/PDMAllCritSectRw.cpp \
620 VMMAll/PDMAllCritSectBoth.cpp \
621 VMMAll/PDMAllQueue.cpp \
622 VMMAll/PGMAll.cpp \
623 VMMAll/PGMAllHandler.cpp \
624 VMMAll/PGMAllMap.cpp \
625 VMMAll/PGMAllPhys.cpp \
626 VMMAll/PGMAllPool.cpp \
627 VMMAll/REMAll.cpp \
628 VMMAll/SELMAll.cpp \
629 VMMAll/TMAll.cpp \
630 VMMAll/TMAllCpu.cpp \
631 VMMAll/TMAllReal.cpp \
632 VMMAll/TMAllVirtual.cpp \
633 VMMAll/TRPMAll.cpp \
634 VMMAll/VMAll.cpp \
635 VMMAll/VMMAll.cpp \
636 VMMAll/VMMAllA.asm
637 if1of ($(VBOX_LDR_FMT), pe lx)
638 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
639 endif
640 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
641 VMMR0_SOURCES += \
642 VMMR0/VMMR0TripleFaultHack.cpp \
643 VMMR0/VMMR0TripleFaultHackA.asm
644 endif
645 ifdef VBOX_WITH_NETSHAPER
646 VMMR0_SOURCES += \
647 VMMAll/PDMAllNetShaper.cpp
648 endif
649 ifdef VBOX_WITH_NEW_APIC
650 VMMR0_SOURCES += \
651 VMMAll/APICAll.cpp
652 endif
653 VMMR0_SOURCES.amd64 = \
654 VMMR0/VMMR0JmpA-amd64.asm
655 VMMR0_SOURCES.x86 = \
656 VMMR0/VMMR0JmpA-x86.asm
657
658 VMMR0_LIBS = \
659 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
660 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
661 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
662 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
663 VMMR0_LIBS += \
664 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
665 endif
666
667 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
668endif # !VBOX_ONLY_EXTPACKS
669
670
671ifndef VBOX_ONLY_EXTPACKS
672 #
673 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
674 #
675 LIBRARIES += SSMStandalone
676 SSMStandalone_TEMPLATE = VBOXR3EXE
677 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE
678 SSMStandalone_INCS = include
679 SSMStandalone_SOURCES = \
680 VMMR3/SSM.cpp \
681 VMMR3/CPUMR3Db.cpp
682endif # !VBOX_ONLY_EXTPACKS
683
684
685if !defined(VBOX_ONLY_EXTPACKS) \
686 && ( defined(VBOX_WITH_DTRACE_R3) \
687 || defined(VBOX_WITH_DTRACE_R0) \
688 || defined(VBOX_WITH_DTRACE_RC))
689 #
690 # Install the dtrace library files.
691 #
692 INSTALLS += VMMLibDTrace
693 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
694 VMMLibDTrace_SOURCES = \
695 dtrace/lib/vbox-types.d \
696 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
697 $(VMMLibDTrace_0_OUTDIR)/vm.d \
698 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
699 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
700 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
701 $(VMMLibDTrace_0_OUTDIR)/x86.d \
702
703
704 ##
705 # Turn the header $2 into the DTrace library script $1.
706 #
707 define def_vmm_lib_dtrace_preprocess
708 $$$$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
709 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$$<)
710 $$(QUIET)$(VBOX_VBOXCPP) -d \
711 -D VBOX_FOR_DTRACE_LIB \
712 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
713 -D IN_RING0 \
714 -D RT_C_DECLS_BEGIN= \
715 -D RT_C_DECLS_END= \
716 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
717 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
718 -D 'R0PTRTYPE(a_Type)=a_Type' \
719 -D 'AssertCompile(a_Expr)=' \
720 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
721 -D 'bool=uint8_t' \
722 $$(foreach def,\
723 $$(DEFS) \
724 $$(DEFS.$$(KBUILD_TARGET)) \
725 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
726 $$(VMM_COMMON_DEFS) \
727 $$(ARCH_BITS_DEFS)\
728 ,-D '$$(def)') \
729 $$< \
730 $$@
731 $$(QUIET)$$(CHMOD) 644 $$@
732 endef
733 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
734 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
735 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
736 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
737 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
738
739endif
740
741
742
743#
744# For vmmGetSvnRev.
745#
746VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
747
748#
749# Disable annoying warnings about array subscript above array bounds in aPages[]
750#
751ifneq ($(KBUILD_TARGET),win)
752 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
753 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
754 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
755 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
756 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
757endif
758
759#
760# Always optimize the interpreter.
761#
762ifn1of ($(USERNAME),bird)
763if1of ($(KBUILD_TARGET), win)
764 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
765 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
766 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
767 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
768else
769 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
770 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
771 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
772 VMMAll/IEMAll.cpp_CXXFLAGS += -fomit-frame-pointer # Omitting the frame pointer results in larger code, but it might be worth it. (esp addressing vs ebp?)
773endif
774endif # bird wants good stacks
775
776
777# Alias the CPU database entries.
778$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
779
780
781#
782# Test for undefined symbols.
783#
784if1of ($(SYSMODS),VMMRC)
785 test-undef-rc:: $(PATH_TARGET)/undef-rc.run
786 OTHERS += $(PATH_TARGET)/undef-rc.run
787 CLEANS += $(PATH_TARGET)/undef-rc.run
788 $(PATH_TARGET)/undef-rc.run: \
789 $$(VMMRC_1_TARGET)
790 ifn1of ($(KBUILD_TARGET), linux solaris)
791 else
792 $(call MSG_L1,VMM: Testing for undefined symbols in VMMRC using nm...)
793 $(QUIET)$(VBOX_NM) $^ 2> /dev/null \
794 | $(SED) -n \
795 -e '/^ *U .*/!d' \
796 -e 's/ *U //' \
797 \
798 -e '/^g_VM\>/d'\
799 -e '/^g_CPUM\>/d'\
800 -e '/^g_Logger\>/d'\
801 -e '/^g_RelLogger\>/d'\
802 -e '/^g_TRPM\>/d'\
803 -e '/^g_TRPMCPU\>/d'\
804 -e '/^g_pSUPGlobalInfoPage\>/d'\
805 -e '/^g_trpmHyperCtxCore\>/d' \
806 -e '/^g_trpmGuestCtxCore\>/d' \
807 \
808 -e 's/\(.*\)$(DOLLAR)/ Undefined symbol: \1/' \
809 -e 'p' \
810 -e 'q 1'
811 endif
812 $(QUIET)$(APPEND) -t $@
813endif
814
815include $(FILE_KBUILD_SUB_FOOTER)
816
817
818# Alias the PGM templates to the object in which they are defined.
819PGMInternal.o \
820PGMBth.o PGMGst.o PGMShw.o \
821PGMBth.obj PGMGst.obj PGMShw.obj: PGM.o
822
823PGMAllBth.o PGMAllGst.o PGMAllShw.o \
824PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
825
826PGMRCBth.o PGMRCGst.o PGMRCShw.o \
827PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
828
829PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
830
831PGMInline.o PGMInline.obj: PGMDbg.o
832
833# Alias the IEM templates to the object in which they are instantiated.
834IEMInternal.o \
835IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
836IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
837IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAll.o
838
839# Alias the switcher templates.
840PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
841LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
842AMD64andLegacy.o AMD64andLegacy.obj: AMD64To32Bit.o AMD64ToPAE.o
843
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette