VirtualBox

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

Last change on this file since 72552 was 72503, checked in by vboxsync, 7 years ago

VMM/testcase/Makefile.kmk: Need to pass VMM_COMMON_DEFS to a number of targets there too.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.0 KB
Line 
1# $Id: Makefile.kmk 72503 2018-06-11 11:27:07Z vboxsync $
2## @file
3# Sub-Makefile for the VMM testcases.
4#
5
6#
7# Copyright (C) 2006-2017 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#
22# Include sub-makefiles.
23#
24if 0 # Not ready for general consumption yet.
25 include $(PATH_SUB_CURRENT)/Instructions/Makefile.kmk
26endif
27
28#
29# Target lists.
30#
31PROGRAMS += tstVMStructSize tstAsmStructs
32ifdef VBOX_WITH_RAW_MODE
33 PROGRAMS += tstVMStructRC tstAsmStructsRC
34endif
35if !defined(VBOX_ONLY_EXTPACKS) \
36 && ( defined(VBOX_WITH_DTRACE_R3) \
37 || defined(VBOX_WITH_DTRACE_R0) \
38 || defined(VBOX_WITH_DTRACE_RC))
39 PROGRAMS += tstVMStructDTrace
40 INSTALLS += VMMLibDTraceStructTest
41endif
42ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
43 PROGRAMS += tstInstrEmul
44 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
45 PROGRAMS += tstGlobalConfigHardened
46 DLL += tstGlobalConfig
47 else
48 PROGRAMS += tstGlobalConfig
49 endif
50
51 ifdef VBOX_WITH_RAW_MODE
52 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
53 PROGRAMS += tstVMMHardened
54 DLLS += tstVMM
55 else
56 PROGRAMS += tstVMM tstVMM-HM
57 endif
58 ifneq ($(KBUILD_TARGET),win)
59 PROGRAMS += tstVMMFork
60 endif
61 endif
62 ifdef VBOX_WITH_TESTCASES
63 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
64 PROGRAMS += tstCFGMHardened tstSSMHardened tstVMREQHardened tstMMHyperHeapHardened tstAnimateHardened
65 DLLS += tstCFGM tstSSM tstVMREQ tstMMHyperHeap tstAnimate
66 else
67 PROGRAMS += tstCFGM tstSSM tstVMREQ tstMMHyperHeap tstAnimate
68 endif
69 PROGRAMS += \
70 tstCompressionBenchmark \
71 tstIEMCheckMc \
72 tstVMMR0CallHost-1 \
73 tstVMMR0CallHost-2 \
74 tstX86-FpuSaveRestore
75 ifn1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), solaris.x86 solaris.amd64 win.amd64 ) ## TODO: Fix the code.
76 PROGRAMS += tstX86-1
77 endif
78 ifdef VBOX_WITH_RAW_MODE
79 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
80 PROGRAMS += tstMicroHardened
81 DLLS += tstMicro
82 else
83 PROGRAMS += tstMicro
84 endif
85 SYSMODS += tstMicroRC
86 endif
87 ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
88 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
89 PROGRAMS += tstPDMAsyncCompletionHardened tstPDMAsyncCompletionStressHardened
90 DLLS += tstPDMAsyncCompletion tstPDMAsyncCompletionStress
91 else
92 PROGRAMS += tstPDMAsyncCompletion tstPDMAsyncCompletionStress
93 endif
94 endif
95 endif # VBOX_WITH_TESTCASES
96endif # !VBOX_ONLY_EXTPACKS_USE_IMPLIBS
97
98# Where we put our temporary files (just for simplicity)
99VBOX_VMM_TESTCASE_OUT_DIR := $(PATH_TARGET)/VMM
100BLDDIRS += $(VBOX_VMM_TESTCASE_OUT_DIR)
101
102#
103# We setup two 'other' targets for executing the two structure & alignment
104# validation testcases. Perhaps a bit hackish, but extremely useful.
105#
106ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
107 ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
108 OTHERS += \
109 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
110 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
111 endif
112endif
113
114# The normal testing pass.
115TESTING += \
116 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
117 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
118ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
119 TESTING += \
120 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run
121endif
122
123OTHER_CLEAN += \
124 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
125 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run \
126 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run \
127 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o \
128 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep \
129 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
130 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.o \
131 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.lst \
132 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h \
133 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h \
134 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
135
136#
137# Globals
138#
139VBOX_PATH_VMM_SRC = $(PATH_ROOT)/src/VBox/VMM
140
141#
142# Targets
143#
144ifdef VBOX_WITH_RAW_MODE
145 tstVMStructRC_TEMPLATE = VBoxRcExe
146 tstVMStructRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE $(VMM_COMMON_DEFS)
147 ifdef VBOX_WITH_R0_LOGGING
148 tstVMStructRC_DEFS += VBOX_WITH_R0_LOGGING
149 endif
150 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
151 tstVMStructRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
152 endif
153 tstVMStructRC_SOURCES = tstVMStructRC.cpp
154 tstVMStructRC_INCS = \
155 $(VBOX_PATH_VMM_SRC)/include \
156 $(VBOX_PATH_VMM_SRC)/PATM
157endif
158
159tstVMStructSize_TEMPLATE= VBOXR3AUTOTST
160tstVMStructSize_DEFS = IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
161ifdef VBOX_WITH_RAW_MODE
162 tstVMStructSize_DEFS += VBOX_WITH_RAW_MODE
163endif
164tstVMStructSize_INCS = \
165 $(VBOX_PATH_VMM_SRC)/include \
166 $(VBOX_PATH_VMM_SRC)/PATM \
167 $(VBOX_VMM_TESTCASE_OUT_DIR)
168tstVMStructSize_SOURCES = tstVMStructSize.cpp
169ifdef VBOX_WITH_RAW_MODE
170 tstVMStructSize.cpp_DEPS= $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
171endif
172ifdef VBOX_WITH_R0_LOGGING
173 tstVMStructSize_DEFS += VBOX_WITH_R0_LOGGING
174endif
175ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
176 tstVMStructSize_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
177endif
178
179tstAsmStructs_TEMPLATE = VBOXR3AUTOTST
180tstAsmStructs_DEFS = IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
181ifdef VBOX_WITH_RAW_MODE
182 tstAsmStructs_DEFS += VBOX_WITH_RAW_MODE
183endif
184ifdef VBOX_WITH_R0_LOGGING
185 tstAsmStructs_DEFS += VBOX_WITH_R0_LOGGING
186endif
187ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
188 tstAsmStructs_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
189endif
190tstAsmStructs_INCS = \
191 $(VBOX_PATH_VMM_SRC)/include \
192 $(VBOX_VMM_TESTCASE_OUT_DIR)
193tstAsmStructs_SOURCES = tstAsmStructs.cpp
194tstAsmStructs.cpp_DEPS = $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
195
196ifdef VBOX_WITH_RAW_MODE
197 tstAsmStructsRC_TEMPLATE= VBoxRcExe
198 tstAsmStructsRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE $(VMM_COMMON_DEFS)
199 ifdef VBOX_WITH_R0_LOGGING
200 tstAsmStructsRC_DEFS += VBOX_WITH_R0_LOGGING
201 endif
202 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
203 tstAsmStructsRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
204 endif
205 tstAsmStructsRC_INCS = \
206 $(VBOX_PATH_VMM_SRC)/include \
207 $(VBOX_VMM_TESTCASE_OUT_DIR)
208 tstAsmStructsRC_SOURCES = tstAsmStructs.cpp
209 tstAsmStructs.cpp_DEPS += $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h
210endif # VBOX_WITH_RAW_MODE
211
212
213#
214# Glboal config tool.
215#
216if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
217 tstGlobalConfigHardened_TEMPLATE = VBoxR3HardenedTstExe
218 tstGlobalConfigHardened_NAME = tstGlobalConfig
219 tstGlobalConfigHardened_DEFS = PROGRAM_NAME_STR=\"tstGlobalConfig\"
220 tstGlobalConfigHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
221 tstGlobalConfig_TEMPLATE = VBoxR3HardenedTstDll
222else
223 tstGlobalConfig_TEMPLATE = VBOXR3TSTEXE
224endif
225tstGlobalConfig_SOURCES = tstGlobalConfig.cpp
226tstGlobalConfig_LIBS = $(LIB_RUNTIME)
227
228#
229# Testcase for checking the repurposing of the IEM instruction code.
230#
231tstIEMCheckMc_TEMPLATE = VBOXR3TSTEXE
232tstIEMCheckMc_SOURCES = tstIEMCheckMc.cpp
233tstIEMCheckMc_DEFS = $(VMM_COMMON_DEFS)
234tstIEMCheckMc_LIBS = $(LIB_RUNTIME)
235ifeq ($(KBUILD_TARGET),win)
236 tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -wd4189 # local variable is initialized but not used.
237else
238 tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -Wno-unused-value -Wno-unused-variable
239endif
240
241#
242# VMM heap testcase.
243#
244if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
245 tstMMHyperHeapHardened_TEMPLATE = VBoxR3HardenedTstExe
246 tstMMHyperHeapHardened_NAME = tstMMHyperHeap
247 tstMMHyperHeapHardened_DEFS = PROGRAM_NAME_STR=\"tstMMHyperHeap\"
248 tstMMHyperHeapHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
249 tstMMHyperHeap_TEMPLATE = VBoxR3HardenedTstDll
250else
251 tstMMHyperHeap_TEMPLATE = VBOXR3TSTEXE
252endif
253tstMMHyperHeap_SOURCES = tstMMHyperHeap.cpp
254tstMMHyperHeap_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
255
256#
257# Saved state manager testcase.
258#
259if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
260 tstSSMHardened_TEMPLATE = VBoxR3HardenedTstExe
261 tstSSMHardened_NAME = tstSSM
262 tstSSMHardened_DEFS = PROGRAM_NAME_STR=\"tstSSM\"
263 tstSSMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
264 tstSSM_TEMPLATE = VBoxR3HardenedTstDll
265else
266 tstSSM_TEMPLATE = VBOXR3TSTEXE
267endif
268tstSSM_INCS = $(VBOX_PATH_VMM_SRC)/include
269tstSSM_SOURCES = tstSSM.cpp
270tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
271
272#
273# Test some EM assembly routines used in instruction emulation.
274#
275tstInstrEmul_TEMPLATE = VBOXR3EXE
276tstInstrEmul_SOURCES = tstInstrEmul.cpp ../VMMAll/EMAllA.asm
277tstInstrEmul_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
278
279#
280# VMM configuration manager tests.
281#
282if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
283 tstCFGMHardened_TEMPLATE = VBoxR3HardenedTstExe
284 tstCFGMHardened_NAME = tstCFGM
285 tstCFGMHardened_DEFS = PROGRAM_NAME_STR=\"tstCFGM\"
286 tstCFGMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
287 tstCFGM_TEMPLATE = VBoxR3HardenedTstDll
288else
289 tstCFGM_TEMPLATE = VBOXR3TSTEXE
290endif
291tstCFGM_SOURCES = tstCFGM.cpp
292tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
293
294#
295# Comparing some compression algorithms considered for SSM usage.
296#
297tstCompressionBenchmark_TEMPLATE = VBOXR3TSTEXE
298tstCompressionBenchmark_SOURCES = tstCompressionBenchmark.cpp
299
300#
301# Two testcases for checking the ring-3 "long jump" code.
302#
303tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
304tstVMMR0CallHost-1_DEFS = VMM_R0_NO_SWITCH_STACK
305tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
306tstVMMR0CallHost-1_SOURCES = \
307 tstVMMR0CallHost-1.cpp
308tstVMMR0CallHost-1_SOURCES.amd64 = \
309 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
310tstVMMR0CallHost-1_SOURCES.x86 = \
311 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
312
313tstVMMR0CallHost-2_EXTENDS = tstVMMR0CallHost-1
314tstVMMR0CallHost-2_DEFS = VMM_R0_SWITCH_STACK
315
316#
317# For testing the VM request queue code.
318#
319if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
320 tstVMREQHardened_TEMPLATE = VBOXR3HARDENEDEXE
321 tstVMREQHardened_NAME = tstVMREQ
322 tstVMREQHardened_DEFS = PROGRAM_NAME_STR=\"tstVMREQ\"
323 tstVMREQHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
324 tstVMREQ_TEMPLATE = VBOXR3
325else
326 tstVMREQ_TEMPLATE = VBOXR3EXE
327endif
328tstVMREQ_SOURCES = tstVMREQ.cpp
329tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
330
331#
332# Tool for reanimate things like OS/2 dumps.
333#
334if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
335 tstAnimateHardened_TEMPLATE = VBOXR3HARDENEDEXE
336 tstAnimateHardened_NAME = tstAnimate
337 tstAnimateHardened_DEFS = PROGRAM_NAME_STR=\"tstAnimate\"
338 tstAnimateHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
339 tstAnimate_TEMPLATE = VBOXR3
340else
341 tstAnimate_TEMPLATE = VBOXR3EXE
342endif
343tstAnimate_SOURCES = tstAnimate.cpp
344tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
345
346tstX86-1_TEMPLATE = VBOXR3TSTEXE
347tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
348tstX86-1_LIBS = $(LIB_RUNTIME)
349tstX86-1_LDFLAGS.linux = $(VBOX_GCC_no-pie)
350
351tstX86-FpuSaveRestore_TEMPLATE = VBOXR3TSTEXE
352tstX86-FpuSaveRestore_SOURCES = tstX86-FpuSaveRestore.cpp tstX86-FpuSaveRestoreA.asm
353tstX86-FpuSaveRestore_LIBS = $(LIB_RUNTIME)
354
355ifdef VBOX_WITH_RAW_MODE
356
357 #
358 # Raw-mode VMM testcase.
359 #
360 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
361 tstVMMHardened_TEMPLATE = VBOXR3HARDENEDEXE
362 tstVMMHardened_NAME = tstVMM
363 tstVMMHardened_DEFS = PROGRAM_NAME_STR=\"tstVMM\"
364 tstVMMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
365 tstVMM_TEMPLATE = VBOXR3
366 else
367 tstVMM_TEMPLATE = VBOXR3EXE
368 endif
369 tstVMM_SOURCES = tstVMM.cpp
370 tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
371
372 #
373 # HM VMM testcase.
374 #
375 tstVMM-HM_TEMPLATE = VBOXR3EXE
376 tstVMM-HM_SOURCES = tstVMM-HM.cpp
377 tstVMM-HM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
378
379 #
380 # VMM host process fork test case (memory ++).
381 #
382 tstVMMFork_TEMPLATE = VBOXR3EXE
383 tstVMMFork_SOURCES = tstVMMFork.cpp
384 tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
385
386 #
387 # Raw-mode micro benchmark.
388 #
389 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
390 tstMicroHardened_TEMPLATE = VBOXR3HARDENEDEXE
391 tstMicroHardened_NAME = tstMicro
392 tstMicroHardened_DEFS = PROGRAM_NAME_STR=\"tstMicro\"
393 tstMicroHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
394 tstMicro_TEMPLATE = VBOXR3
395 else
396 tstMicro_TEMPLATE = VBOXR3EXE
397 endif
398 tstMicro_SOURCES = tstMicro.cpp
399 tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
400 tstMicro_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
401
402 tstMicroRC_TEMPLATE = VBoxRc
403 tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
404 tstMicroRC_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
405 tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
406 ifeq ($(VBOX_LDR_FMT32),pe)
407 tstMicroRC_LDFLAGS = -Entry:tstMicroRC
408 endif
409 tstMicroRC_SYSSUFF = .gc
410 tstMicroRC_LIBS = \
411 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
412 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
413 ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
414 tstMicroRC_LIBS += \
415 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
416 $(LIB_VMMRC)
417 endif
418 tstMicroRC_SOURCES.win = tstMicroRC.def
419
420endif # VBOX_WITH_RAW_MODE
421
422ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
423 #
424 # PDM asynchronous completation test.
425 #
426 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
427 tstPDMAsyncCompletionHardened_TEMPLATE = VBOXR3HARDENEDEXE
428 tstPDMAsyncCompletionHardened_NAME = tstPDMAsyncCompletion
429 tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletion\"
430 tstPDMAsyncCompletionHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
431 tstPDMAsyncCompletion_TEMPLATE = VBOXR3
432 else
433 tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
434 endif
435 tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
436 tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
437 tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
438
439 #
440 # PDM asynchronous completation stress test.
441 #
442 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
443 tstPDMAsyncCompletionStressHardened_TEMPLATE = VBOXR3HARDENEDEXE
444 tstPDMAsyncCompletionStressHardened_NAME = tstPDMAsyncCompletionStress
445 tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletionStress\"
446 tstPDMAsyncCompletionStressHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
447 tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3
448 else
449 tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
450 endif
451 tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
452 tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
453 tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
454endif
455
456ifndef VBOX_ONLY_EXTPACKS
457PROGRAMS += tstSSM-2
458tstSSM-2_TEMPLATE = VBOXR3TSTEXE
459tstSSM-2_DEFS = IN_VMM_STATIC
460tstSSM-2_SOURCES = tstSSM-2.cpp
461tstSSM-2_LIBS = $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB)
462endif
463
464#
465# Generate VM structure tests.
466#
467if !defined(VBOX_ONLY_EXTPACKS) \
468 && ( defined(VBOX_WITH_DTRACE_R3) \
469 || defined(VBOX_WITH_DTRACE_R0) \
470 || defined(VBOX_WITH_DTRACE_RC))
471 tstVMStructDTrace_TEMPLATE= VBOXR3AUTOTST
472 tstVMStructDTrace_DEFS = IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
473 ifdef VBOX_WITH_RAW_MODE
474 tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
475 endif
476 tstVMStructDTrace_INCS = \
477 $(VBOX_PATH_VMM_SRC)/include \
478 $(VBOX_PATH_VMM_SRC)/PATM \
479 $(VBOX_VMM_TESTCASE_OUT_DIR)
480 tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
481 ifdef VBOX_WITH_R0_LOGGING
482 tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
483 endif
484 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
485 tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
486 endif
487
488
489 VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
490 VMMLibDTraceStructTest_SOURCES = \
491 $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
492
493 $$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
494 $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
495 $(QUIET)$(RM) -f $@
496 $< > $@
497
498endif
499
500
501include $(FILE_KBUILD_SUB_FOOTER)
502
503
504#
505# Run rule for tstInstrEmul.
506#
507$(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run: $$(tstInstrEmul_1_STAGE_TARGET) | $$(dir $$@)
508 $(QUIET)$(RM) -f $@
509 $(QUIET)$(REDIRECT) -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
510 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
511 -- \
512 $(tstInstrEmul_1_STAGE_TARGET)
513 $(QUIET)$(APPEND) "$@" "done"
514
515
516#
517# Some handcrafted support targets for tstAsmStructs.
518#
519MY_ASA_ASM_STUFF = \
520 $(addprefix -D, \
521 $(DEFS) \
522 $(DEFS.$(KBUILD_TYPE)) \
523 $(DEFS.$(KBUILD_TARGET)) \
524 IN_RING3 $(ARCH_BITS_DEFS) \
525 $(DEFS.$(KBUILD_TARGET_ARCH)) \
526 $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
527 $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
528 ) \
529 -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
530 $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
531 ,-I$(inc)/)
532
533# 1a. make a header file which makes all the structures+members globals.
534$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
535 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
536 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
537 $(DEPTH)/include/iprt/asmdefs.mac \
538 $(DEPTH)/include/VBox/vmm/cpum.mac \
539 $(DEPTH)/include/VBox/vmm/vm.mac \
540 $(DEPTH)/include/VBox/sup.mac \
541 $(DEPTH)/include/iprt/x86.mac \
542 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
543 $(VBOX_PATH_VMM_SRC)/include/TRPMInternal.mac \
544 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
545 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
546 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
547 $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
548 | $$(dir $$@)
549 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
550ifndef DONT_USE_YASM
551 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
552 $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ [email protected]
553else
554 $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
555 $(VBOX_NM) [email protected] | $(SED) \
556 -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
557 -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
558 > $@
559endif
560
561# 1b. make an elf/macho object containing the offsets.
562includedep $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
563$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
564 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
565 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
566 $(DEPTH)/include/iprt/asmdefs.mac \
567 $(DEPTH)/include/VBox/vmm/cpum.mac \
568 $(DEPTH)/include/VBox/vmm/hm_vmx.mac \
569 $(DEPTH)/include/VBox/vmm/stam.mac \
570 $(DEPTH)/include/VBox/vmm/trpm.mac \
571 $(DEPTH)/include/VBox/vmm/vm.mac \
572 $(DEPTH)/include/VBox/sup.mac \
573 $(DEPTH)/include/iprt/x86.mac \
574 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
575 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
576 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
577 $(VBOX_PATH_VMM_SRC)/include/VMMSwitcher.mac \
578 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
579 $$(if $$(eq $$(tstAsmStructsAsmDep_STUFF),$$(MY_ASA_ASM_STUFF)),,FORCE) \
580 | $$(dir $$@)
581 $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
582ifndef DONT_USE_YASM
583 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
584else
585 $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
586endif
587 %$(QUIET2)$(RM) -f -- $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
588 %$(QUIET2)$(APPEND) '$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep' 'tstAsmStructsAsmDep_STUFF=$(MY_ASA_ASM_STUFF)'
589
590# 2. use nm and sed to transform this into the header we want.
591$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
592 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
593 $(QUIET)$(RM) -f $@ [email protected] [email protected]
594 $(QUIET)$(REDIRECT) -wo [email protected] -- $(VBOX_NM) $<
595 $(QUIET)$(SED) \
596 -e '/STAMPROFILEADV/d' \
597 \
598 -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*\./!d' \
599 -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\3, 0x0\2, \4);/' \
600 --output [email protected] [email protected]
601 $(QUIET)$(SED) \
602 -e '/VM_size$$/d' \
603 -e '/VMCPU_size$$/d' \
604 -e '/VMMCPU_size$$/d' \
605 -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
606 -e '/HMCPU_size$$/d' \
607 \
608 -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*_size$$/!d' \
609 -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^_.]*\)_size/ CHECK_SIZE(\3, 0x0\2);/' \
610 --append [email protected] [email protected]
611 $(QUIET)$(MV) -f [email protected] $@
612 $(QUIET)$(RM) -f [email protected]
613
614ifdef VBOX_WITH_RAW_MODE
615# 3. transform the HC header into a RC one by omitting some HC only structures.
616$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
617 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
618 $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' --output $@ $^
619endif
620
621# 4. run it.
622$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
623 $$(tstAsmStructs_1_STAGE_TARGET) \
624 $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
625 $(QUIET)$(RM) -f $@
626 $(tstAsmStructs_1_STAGE_TARGET)
627ifdef VBOX_WITH_RAW_MODE
628 $(tstAsmStructsRC_1_STAGE_TARGET)
629endif
630 $(QUIET)$(APPEND) "$@" "done"
631
632
633
634#
635# Run rule for tstVMStructSize.
636#
637
638ifdef VBOX_WITH_RAW_MODE
639# 1. Manually dump selected structures and members.
640$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
641 $(call MSG_GENERATE,tstVMStructSize,$@)
642 $(QUIET)$(REDIRECT) -wo $@ -- $<
643endif # VBOX_WITH_RAW_MODE
644
645# 2. run it.
646$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
647 $(QUIET)$(RM) -f $@
648 $<
649 $(QUIET)$(APPEND) "$@" "done"
650
651# alias for the two struct tests.
652run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
653
Note: See TracBrowser for help on using the repository browser.

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