VirtualBox

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

Last change on this file since 74134 was 72892, checked in by vboxsync, 7 years ago

EM: We no longer need the assembly code in EMAllA.asm anymore.

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