VirtualBox

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

Last change on this file since 69221 was 69111, checked in by vboxsync, 7 years ago

(C) year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.8 KB
Line 
1# $Id: Makefile.kmk 69111 2017-10-17 14:26:02Z 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
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
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
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
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_LIBS = $(LIB_RUNTIME)
234ifeq ($(KBUILD_TARGET),win)
235 tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -wd4189 # local variable is initialized but not used.
236else
237 tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -Wno-unused-value -Wno-unused-variable
238endif
239
240#
241# VMM heap testcase.
242#
243if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
244 tstMMHyperHeapHardened_TEMPLATE = VBoxR3HardenedTstExe
245 tstMMHyperHeapHardened_NAME = tstMMHyperHeap
246 tstMMHyperHeapHardened_DEFS = PROGRAM_NAME_STR=\"tstMMHyperHeap\"
247 tstMMHyperHeapHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
248 tstMMHyperHeap_TEMPLATE = VBoxR3HardenedTstDll
249else
250 tstMMHyperHeap_TEMPLATE = VBOXR3TSTEXE
251endif
252tstMMHyperHeap_SOURCES = tstMMHyperHeap.cpp
253tstMMHyperHeap_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
254
255#
256# Saved state manager testcase.
257#
258if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
259 tstSSMHardened_TEMPLATE = VBoxR3HardenedTstExe
260 tstSSMHardened_NAME = tstSSM
261 tstSSMHardened_DEFS = PROGRAM_NAME_STR=\"tstSSM\"
262 tstSSMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
263 tstSSM_TEMPLATE = VBoxR3HardenedTstDll
264else
265 tstSSM_TEMPLATE = VBOXR3TSTEXE
266endif
267tstSSM_INCS = $(VBOX_PATH_VMM_SRC)/include
268tstSSM_SOURCES = tstSSM.cpp
269tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
270
271#
272# Test some EM assembly routines used in instruction emulation.
273#
274tstInstrEmul_TEMPLATE = VBOXR3EXE
275tstInstrEmul_SOURCES = tstInstrEmul.cpp ../VMMAll/EMAllA.asm
276tstInstrEmul_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
277
278#
279# VMM configuration manager tests.
280#
281if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
282 tstCFGMHardened_TEMPLATE = VBoxR3HardenedTstExe
283 tstCFGMHardened_NAME = tstCFGM
284 tstCFGMHardened_DEFS = PROGRAM_NAME_STR=\"tstCFGM\"
285 tstCFGMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
286 tstCFGM_TEMPLATE = VBoxR3HardenedTstDll
287else
288 tstCFGM_TEMPLATE = VBOXR3TSTEXE
289endif
290tstCFGM_SOURCES = tstCFGM.cpp
291tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
292
293#
294# Comparing some compression algorithms considered for SSM usage.
295#
296tstCompressionBenchmark_TEMPLATE = VBOXR3TSTEXE
297tstCompressionBenchmark_SOURCES = tstCompressionBenchmark.cpp
298
299#
300# Two testcases for checking the ring-3 "long jump" code.
301#
302tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
303tstVMMR0CallHost-1_DEFS = VMM_R0_NO_SWITCH_STACK
304tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
305tstVMMR0CallHost-1_SOURCES = \
306 tstVMMR0CallHost-1.cpp
307tstVMMR0CallHost-1_SOURCES.amd64 = \
308 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
309tstVMMR0CallHost-1_SOURCES.x86 = \
310 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
311
312tstVMMR0CallHost-2_EXTENDS = tstVMMR0CallHost-1
313tstVMMR0CallHost-2_DEFS = VMM_R0_SWITCH_STACK
314
315#
316# For testing the VM request queue code.
317#
318if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
319 tstVMREQHardened_TEMPLATE = VBOXR3HARDENEDEXE
320 tstVMREQHardened_NAME = tstVMREQ
321 tstVMREQHardened_DEFS = PROGRAM_NAME_STR=\"tstVMREQ\"
322 tstVMREQHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
323 tstVMREQ_TEMPLATE = VBOXR3
324else
325 tstVMREQ_TEMPLATE = VBOXR3EXE
326endif
327tstVMREQ_SOURCES = tstVMREQ.cpp
328tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
329
330#
331# Tool for reanimate things like OS/2 dumps.
332#
333if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
334 tstAnimateHardened_TEMPLATE = VBOXR3HARDENEDEXE
335 tstAnimateHardened_NAME = tstAnimate
336 tstAnimateHardened_DEFS = PROGRAM_NAME_STR=\"tstAnimate\"
337 tstAnimateHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
338 tstAnimate_TEMPLATE = VBOXR3
339else
340 tstAnimate_TEMPLATE = VBOXR3EXE
341endif
342tstAnimate_SOURCES = tstAnimate.cpp
343tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
344
345tstX86-1_TEMPLATE = VBOXR3TSTEXE
346tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
347tstX86-1_LIBS = $(LIB_RUNTIME)
348tstX86-1_LDFLAGS.linux = $(VBOX_GCC_no-pie)
349
350tstX86-FpuSaveRestore_TEMPLATE = VBOXR3TSTEXE
351tstX86-FpuSaveRestore_SOURCES = tstX86-FpuSaveRestore.cpp tstX86-FpuSaveRestoreA.asm
352tstX86-FpuSaveRestore_LIBS = $(LIB_RUNTIME)
353
354ifdef VBOX_WITH_RAW_MODE
355
356 #
357 # Raw-mode VMM testcase.
358 #
359 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
360 tstVMMHardened_TEMPLATE = VBOXR3HARDENEDEXE
361 tstVMMHardened_NAME = tstVMM
362 tstVMMHardened_DEFS = PROGRAM_NAME_STR=\"tstVMM\"
363 tstVMMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
364 tstVMM_TEMPLATE = VBOXR3
365 else
366 tstVMM_TEMPLATE = VBOXR3EXE
367 endif
368 tstVMM_SOURCES = tstVMM.cpp
369 tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
370
371 #
372 # HM VMM testcase.
373 #
374 tstVMM-HM_TEMPLATE = VBOXR3EXE
375 tstVMM-HM_SOURCES = tstVMM-HM.cpp
376 tstVMM-HM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
377
378 #
379 # VMM host process fork test case (memory ++).
380 #
381 tstVMMFork_TEMPLATE = VBOXR3EXE
382 tstVMMFork_SOURCES = tstVMMFork.cpp
383 tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
384
385 #
386 # Raw-mode micro benchmark.
387 #
388 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
389 tstMicroHardened_TEMPLATE = VBOXR3HARDENEDEXE
390 tstMicroHardened_NAME = tstMicro
391 tstMicroHardened_DEFS = PROGRAM_NAME_STR=\"tstMicro\"
392 tstMicroHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
393 tstMicro_TEMPLATE = VBOXR3
394 else
395 tstMicro_TEMPLATE = VBOXR3EXE
396 endif
397 tstMicro_SOURCES = tstMicro.cpp
398 tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
399 tstMicro_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
400
401 tstMicroRC_TEMPLATE = VBoxRc
402 tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
403 tstMicroRC_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
404 tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
405 ifeq ($(VBOX_LDR_FMT32),pe)
406 tstMicroRC_LDFLAGS = -Entry:tstMicroRC
407 endif
408 tstMicroRC_SYSSUFF = .gc
409 tstMicroRC_LIBS = \
410 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
411 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
412 ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
413 tstMicroRC_LIBS += \
414 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
415 $(LIB_VMMRC)
416 endif
417 tstMicroRC_SOURCES.win = tstMicroRC.def
418
419endif # VBOX_WITH_RAW_MODE
420
421ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
422 #
423 # PDM asynchronous completation test.
424 #
425 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
426 tstPDMAsyncCompletionHardened_TEMPLATE = VBOXR3HARDENEDEXE
427 tstPDMAsyncCompletionHardened_NAME = tstPDMAsyncCompletion
428 tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletion\"
429 tstPDMAsyncCompletionHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
430 tstPDMAsyncCompletion_TEMPLATE = VBOXR3
431 else
432 tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
433 endif
434 tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
435 tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
436 tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
437
438 #
439 # PDM asynchronous completation stress test.
440 #
441 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
442 tstPDMAsyncCompletionStressHardened_TEMPLATE = VBOXR3HARDENEDEXE
443 tstPDMAsyncCompletionStressHardened_NAME = tstPDMAsyncCompletionStress
444 tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletionStress\"
445 tstPDMAsyncCompletionStressHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
446 tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3
447 else
448 tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
449 endif
450 tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
451 tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
452 tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
453endif
454
455ifndef VBOX_ONLY_EXTPACKS
456PROGRAMS += tstSSM-2
457tstSSM-2_TEMPLATE = VBOXR3TSTEXE
458tstSSM-2_DEFS = IN_VMM_STATIC
459tstSSM-2_SOURCES = tstSSM-2.cpp
460tstSSM-2_LIBS = $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB)
461endif
462
463#
464# Generate VM structure tests.
465#
466if !defined(VBOX_ONLY_EXTPACKS) \
467 && ( defined(VBOX_WITH_DTRACE_R3) \
468 || defined(VBOX_WITH_DTRACE_R0) \
469 || defined(VBOX_WITH_DTRACE_RC))
470 tstVMStructDTrace_TEMPLATE= VBOXR3AUTOTST
471 tstVMStructDTrace_DEFS = IN_VMM_R3 IN_DIS
472 ifdef VBOX_WITH_RAW_MODE
473 tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
474 endif
475 tstVMStructDTrace_INCS = \
476 $(VBOX_PATH_VMM_SRC)/include \
477 $(VBOX_PATH_VMM_SRC)/PATM \
478 $(VBOX_VMM_TESTCASE_OUT_DIR)
479 tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
480 ifdef VBOX_WITH_R0_LOGGING
481 tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
482 endif
483 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
484 tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
485 endif
486
487
488 VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
489 VMMLibDTraceStructTest_SOURCES = \
490 $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
491
492 $$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
493 $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
494 $(QUIET)$(RM) -f $@
495 $< > $@
496
497endif
498
499
500include $(FILE_KBUILD_SUB_FOOTER)
501
502
503#
504# Run rule for tstInstrEmul.
505#
506$(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run: $$(tstInstrEmul_1_STAGE_TARGET) | $$(dir $$@)
507 $(QUIET)$(RM) -f $@
508 $(QUIET)$(REDIRECT) -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
509 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
510 -- \
511 $(tstInstrEmul_1_STAGE_TARGET)
512 $(QUIET)$(APPEND) "$@" "done"
513
514
515#
516# Some handcrafted support targets for tstAsmStructs.
517#
518MY_ASA_ASM_STUFF = \
519 $(addprefix -D, \
520 $(DEFS) \
521 $(DEFS.$(KBUILD_TYPE)) \
522 $(DEFS.$(KBUILD_TARGET)) \
523 IN_RING3 $(ARCH_BITS_DEFS) \
524 $(DEFS.$(KBUILD_TARGET_ARCH)) \
525 $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
526 $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
527 ) \
528 -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
529 $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
530 ,-I$(inc)/)
531
532# 1a. make a header file which makes all the structures+members globals.
533$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
534 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
535 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
536 $(DEPTH)/include/iprt/asmdefs.mac \
537 $(DEPTH)/include/VBox/vmm/cpum.mac \
538 $(DEPTH)/include/VBox/vmm/vm.mac \
539 $(DEPTH)/include/VBox/sup.mac \
540 $(DEPTH)/include/iprt/x86.mac \
541 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
542 $(VBOX_PATH_VMM_SRC)/include/TRPMInternal.mac \
543 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
544 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
545 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
546 $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
547 | $$(dir $$@)
548 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
549ifndef DONT_USE_YASM
550 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
551 $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ $@.lst
552else
553 $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
554 $(VBOX_NM) $@.o | $(SED) \
555 -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
556 -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
557 > $@
558endif
559
560# 1b. make an elf/macho object containing the offsets.
561includedep $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
562$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
563 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
564 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
565 $(DEPTH)/include/iprt/asmdefs.mac \
566 $(DEPTH)/include/VBox/vmm/cpum.mac \
567 $(DEPTH)/include/VBox/vmm/hm_vmx.mac \
568 $(DEPTH)/include/VBox/vmm/stam.mac \
569 $(DEPTH)/include/VBox/vmm/trpm.mac \
570 $(DEPTH)/include/VBox/vmm/vm.mac \
571 $(DEPTH)/include/VBox/sup.mac \
572 $(DEPTH)/include/iprt/x86.mac \
573 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
574 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
575 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
576 $(VBOX_PATH_VMM_SRC)/include/VMMSwitcher.mac \
577 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
578 $$(if $$(eq $$(tstAsmStructsAsmDep_STUFF),$$(MY_ASA_ASM_STUFF)),,FORCE) \
579 | $$(dir $$@)
580 $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
581ifndef DONT_USE_YASM
582 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
583else
584 $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
585endif
586 %$(QUIET2)$(RM) -f -- $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
587 %$(QUIET2)$(APPEND) '$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep' 'tstAsmStructsAsmDep_STUFF=$(MY_ASA_ASM_STUFF)'
588
589# 2. use nm and sed to transform this into the header we want.
590$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
591 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
592 $(QUIET)$(RM) -f $@ $@.dump $@.tmp
593 $(QUIET)$(REDIRECT) -wo $@.dump -- $(VBOX_NM) $<
594 $(QUIET)$(SED) \
595 -e '/STAMPROFILEADV/d' \
596 \
597 -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*\./!d' \
598 -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\3, 0x0\2, \4);/' \
599 --output $@.tmp $@.dump
600 $(QUIET)$(SED) \
601 -e '/VM_size$$/d' \
602 -e '/VMCPU_size$$/d' \
603 -e '/VMMCPU_size$$/d' \
604 -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
605 -e '/HMCPU_size$$/d' \
606 \
607 -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*_size$$/!d' \
608 -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^_.]*\)_size/ CHECK_SIZE(\3, 0x0\2);/' \
609 --append $@.tmp $@.dump
610 $(QUIET)$(MV) -f $@.tmp $@
611 $(QUIET)$(RM) -f $@.dump
612
613ifdef VBOX_WITH_RAW_MODE
614# 3. transform the HC header into a RC one by omitting some HC only structures.
615$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
616 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
617 $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' --output $@ $^
618endif
619
620# 4. run it.
621$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
622 $$(tstAsmStructs_1_STAGE_TARGET) \
623 $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
624 $(QUIET)$(RM) -f $@
625 $(tstAsmStructs_1_STAGE_TARGET)
626ifdef VBOX_WITH_RAW_MODE
627 $(tstAsmStructsRC_1_STAGE_TARGET)
628endif
629 $(QUIET)$(APPEND) "$@" "done"
630
631
632
633#
634# Run rule for tstVMStructSize.
635#
636
637ifdef VBOX_WITH_RAW_MODE
638# 1. Manually dump selected structures and members.
639$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
640 $(call MSG_GENERATE,tstVMStructSize,$@)
641 $(QUIET)$(REDIRECT) -wo $@ -- $<
642endif # VBOX_WITH_RAW_MODE
643
644# 2. run it.
645$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
646 $(QUIET)$(RM) -f $@
647 $<
648 $(QUIET)$(APPEND) "$@" "done"
649
650# alias for the two struct tests.
651run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
652
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