VirtualBox

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

Last change on this file since 54030 was 53902, checked in by vboxsync, 10 years ago

extpack build fix

  • 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 53902 2015-01-21 16:08:43Z vboxsync $
2## @file
3# Sub-Makefile for the VMM testcases.
4#
5
6#
7# Copyright (C) 2006-2013 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)/tstAsmStructs.h \
128 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o \
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)/tstAsmStructs.h.dump \
133 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h \
134 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h \
135 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
136
137#
138# Globals
139#
140VBOX_PATH_VMM_SRC = $(PATH_ROOT)/src/VBox/VMM
141
142#
143# Targets
144#
145ifdef VBOX_WITH_RAW_MODE
146 tstVMStructRC_TEMPLATE = VBoxRcExe
147 tstVMStructRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE
148 ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
149 tstVMStructRC_DEFS += \
150 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC \
151 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_RC
152 endif
153 ifdef VBOX_WITH_R0_LOGGING
154 tstVMStructRC_DEFS += VBOX_WITH_R0_LOGGING
155 endif
156 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
157 tstVMStructRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
158 endif
159 tstVMStructRC_SOURCES = tstVMStructRC.cpp
160 tstVMStructRC_INCS = \
161 $(VBOX_PATH_VMM_SRC)/include \
162 $(VBOX_PATH_VMM_SRC)/PATM
163endif
164
165tstVMStructSize_TEMPLATE= VBOXR3AUTOTST
166tstVMStructSize_DEFS = IN_VMM_R3 IN_DIS
167ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
168 tstVMStructSize_DEFS += \
169 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
170 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
171endif
172ifdef VBOX_WITH_RAW_MODE
173 tstVMStructSize_DEFS += VBOX_WITH_RAW_MODE
174endif
175tstVMStructSize_INCS = \
176 $(VBOX_PATH_VMM_SRC)/include \
177 $(VBOX_PATH_VMM_SRC)/PATM \
178 $(VBOX_VMM_TESTCASE_OUT_DIR)
179tstVMStructSize_SOURCES = tstVMStructSize.cpp
180ifdef VBOX_WITH_RAW_MODE
181 tstVMStructSize.cpp_DEPS= $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
182endif
183ifdef VBOX_WITH_R0_LOGGING
184 tstVMStructSize_DEFS += VBOX_WITH_R0_LOGGING
185endif
186ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
187 tstVMStructSize_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
188endif
189
190tstAsmStructs_TEMPLATE = VBOXR3AUTOTST
191tstAsmStructs_DEFS = IN_VMM_R3 IN_DIS
192ifdef VBOX_WITH_RAW_MODE
193 tstAsmStructs_DEFS += VBOX_WITH_RAW_MODE
194endif
195ifdef VBOX_WITH_R0_LOGGING
196 tstAsmStructs_DEFS += VBOX_WITH_R0_LOGGING
197endif
198ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
199 tstAsmStructs_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
200endif
201tstAsmStructs_INCS = \
202 $(VBOX_PATH_VMM_SRC)/include \
203 $(VBOX_VMM_TESTCASE_OUT_DIR)
204tstAsmStructs_SOURCES = tstAsmStructs.cpp
205tstAsmStructs.cpp_DEPS = $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
206
207ifdef VBOX_WITH_RAW_MODE
208 tstAsmStructsRC_TEMPLATE= VBoxRcExe
209 tstAsmStructsRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE
210 ifdef VBOX_WITH_R0_LOGGING
211 tstAsmStructsRC_DEFS += VBOX_WITH_R0_LOGGING
212 endif
213 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
214 tstAsmStructsRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
215 endif
216 tstAsmStructsRC_INCS = \
217 $(VBOX_PATH_VMM_SRC)/include \
218 $(VBOX_VMM_TESTCASE_OUT_DIR)
219 tstAsmStructsRC_SOURCES = tstAsmStructs.cpp
220 tstAsmStructs.cpp_DEPS += $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h
221endif # VBOX_WITH_RAW_MODE
222
223
224#
225# Glboal config tool.
226#
227if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
228 tstGlobalConfigHardened_TEMPLATE = VBoxR3HardenedTstExe
229 tstGlobalConfigHardened_NAME = tstGlobalConfig
230 tstGlobalConfigHardened_DEFS = PROGRAM_NAME_STR=\"tstGlobalConfig\"
231 tstGlobalConfigHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
232 tstGlobalConfig_TEMPLATE = VBoxR3TstDll
233else
234 tstGlobalConfig_TEMPLATE = VBOXR3TSTEXE
235endif
236tstGlobalConfig_SOURCES = tstGlobalConfig.cpp
237tstGlobalConfig_LIBS = $(LIB_RUNTIME)
238
239#
240# Testcase for checking the repurposing of the IEM instruction code.
241#
242tstIEMCheckMc_TEMPLATE = VBOXR3TSTEXE
243tstIEMCheckMc_SOURCES = tstIEMCheckMc.cpp
244tstIEMCheckMc_LIBS = $(LIB_RUNTIME)
245ifneq ($(KBUILD_TARGET),win)
246tstIEMCheckMc_CXXFLAGS = -Wno-unused-parameter
247endif
248
249#
250# VMM heap testcase.
251#
252if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
253 tstMMHyperHeapHardened_TEMPLATE = VBoxR3HardenedTstExe
254 tstMMHyperHeapHardened_NAME = tstMMHyperHeap
255 tstMMHyperHeapHardened_DEFS = PROGRAM_NAME_STR=\"tstMMHyperHeap\"
256 tstMMHyperHeapHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
257 tstMMHyperHeap_TEMPLATE = VBoxR3TstDll
258else
259 tstMMHyperHeap_TEMPLATE = VBOXR3TSTEXE
260endif
261tstMMHyperHeap_SOURCES = tstMMHyperHeap.cpp
262tstMMHyperHeap_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
263
264#
265# Saved state manager testcase.
266#
267if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
268 tstSSMHardened_TEMPLATE = VBoxR3HardenedTstExe
269 tstSSMHardened_NAME = tstSSM
270 tstSSMHardened_DEFS = PROGRAM_NAME_STR=\"tstSSM\"
271 tstSSMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
272 tstSSM_TEMPLATE = VBoxR3TstDll
273else
274 tstSSM_TEMPLATE = VBOXR3TSTEXE
275endif
276tstSSM_INCS = $(VBOX_PATH_VMM_SRC)/include
277tstSSM_SOURCES = tstSSM.cpp
278tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
279
280#
281# Test some EM assembly routines used in instruction emulation.
282#
283tstInstrEmul_TEMPLATE = VBOXR3EXE
284tstInstrEmul_SOURCES = tstInstrEmul.cpp ../VMMAll/EMAllA.asm
285tstInstrEmul_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
286
287#
288# VMM configuration manager tests.
289#
290if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
291 tstCFGMHardened_TEMPLATE = VBoxR3HardenedTstExe
292 tstCFGMHardened_NAME = tstCFGM
293 tstCFGMHardened_DEFS = PROGRAM_NAME_STR=\"tstCFGM\"
294 tstCFGMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
295 tstCFGM_TEMPLATE = VBoxR3TstDll
296else
297 tstCFGM_TEMPLATE = VBOXR3TSTEXE
298endif
299tstCFGM_SOURCES = tstCFGM.cpp
300tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
301
302#
303# Comparing some compression algorithms considered for SSM usage.
304#
305tstCompressionBenchmark_TEMPLATE = VBOXR3TSTEXE
306tstCompressionBenchmark_SOURCES = tstCompressionBenchmark.cpp
307
308#
309# Two testcases for checking the ring-3 "long jump" code.
310#
311tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
312tstVMMR0CallHost-1_DEFS = VMM_R0_NO_SWITCH_STACK
313tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
314tstVMMR0CallHost-1_SOURCES = \
315 tstVMMR0CallHost-1.cpp
316tstVMMR0CallHost-1_SOURCES.amd64 = \
317 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
318tstVMMR0CallHost-1_SOURCES.x86 = \
319 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
320
321tstVMMR0CallHost-2_EXTENDS = tstVMMR0CallHost-1
322tstVMMR0CallHost-2_DEFS = VMM_R0_SWITCH_STACK
323
324#
325# For testing the VM request queue code.
326#
327if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
328 tstVMREQHardened_TEMPLATE = VBOXR3HARDENEDEXE
329 tstVMREQHardened_NAME = tstVMREQ
330 tstVMREQHardened_DEFS = PROGRAM_NAME_STR=\"tstVMREQ\"
331 tstVMREQHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
332 tstVMREQ_TEMPLATE = VBOXR3
333else
334 tstVMREQ_TEMPLATE = VBOXR3EXE
335endif
336tstVMREQ_SOURCES = tstVMREQ.cpp
337tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
338
339#
340# Tool for reanimate things like OS/2 dumps.
341#
342if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
343 tstAnimateHardened_TEMPLATE = VBOXR3HARDENEDEXE
344 tstAnimateHardened_NAME = tstAnimate
345 tstAnimateHardened_DEFS = PROGRAM_NAME_STR=\"tstAnimate\"
346 tstAnimateHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
347 tstAnimate_TEMPLATE = VBOXR3
348else
349 tstAnimate_TEMPLATE = VBOXR3EXE
350endif
351tstAnimate_SOURCES = tstAnimate.cpp
352tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
353
354tstX86-1_TEMPLATE = VBOXR3TSTEXE
355tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
356tstX86-1_LIBS = $(LIB_RUNTIME)
357
358tstX86-FpuSaveRestore_TEMPLATE = VBOXR3TSTEXE
359tstX86-FpuSaveRestore_SOURCES = tstX86-FpuSaveRestore.cpp tstX86-FpuSaveRestoreA.asm
360tstX86-FpuSaveRestore_LIBS = $(LIB_RUNTIME)
361
362ifdef VBOX_WITH_RAW_MODE
363
364 #
365 # Raw-mode VMM testcase.
366 #
367 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
368 tstVMMHardened_TEMPLATE = VBOXR3HARDENEDEXE
369 tstVMMHardened_NAME = tstVMM
370 tstVMMHardened_DEFS = PROGRAM_NAME_STR=\"tstVMM\"
371 tstVMMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
372 tstVMM_TEMPLATE = VBOXR3
373 else
374 tstVMM_TEMPLATE = VBOXR3EXE
375 endif
376 tstVMM_SOURCES = tstVMM.cpp
377 tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
378
379 #
380 # HM VMM testcase.
381 #
382 tstVMM-HM_TEMPLATE = VBOXR3EXE
383 tstVMM-HM_SOURCES = tstVMM-HM.cpp
384 tstVMM-HM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
385
386 #
387 # VMM host process fork test case (memory ++).
388 #
389 tstVMMFork_TEMPLATE = VBOXR3EXE
390 tstVMMFork_SOURCES = tstVMMFork.cpp
391 tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
392
393 #
394 # Raw-mode micro benchmark.
395 #
396 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
397 tstMicroHardened_TEMPLATE = VBOXR3HARDENEDEXE
398 tstMicroHardened_NAME = tstMicro
399 tstMicroHardened_DEFS = PROGRAM_NAME_STR=\"tstMicro\"
400 tstMicroHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
401 tstMicro_TEMPLATE = VBOXR3
402 else
403 tstMicro_TEMPLATE = VBOXR3EXE
404 endif
405 tstMicro_SOURCES = tstMicro.cpp
406 tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
407 tstMicro_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
408
409 tstMicroRC_TEMPLATE = VBoxRc
410 tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
411 tstMicroRC_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
412 tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
413 ifeq ($(VBOX_LDR_FMT32),pe)
414 tstMicroRC_LDFLAGS = -Entry:tstMicroRC
415 endif
416 tstMicroRC_SYSSUFF = .gc
417 tstMicroRC_LIBS = \
418 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
419 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
420 ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
421 tstMicroRC_LIBS += \
422 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
423 $(LIB_VMMGC)
424 endif
425 tstMicroRC_SOURCES.win = tstMicroRC.def
426
427endif # VBOX_WITH_RAW_MODE
428
429ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
430 #
431 # PDM asynchronous completation test.
432 #
433 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
434 tstPDMAsyncCompletionHardened_TEMPLATE = VBOXR3HARDENEDEXE
435 tstPDMAsyncCompletionHardened_NAME = tstPDMAsyncCompletion
436 tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletion\"
437 tstPDMAsyncCompletionHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
438 tstPDMAsyncCompletion_TEMPLATE = VBOXR3
439 else
440 tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
441 endif
442 tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
443 tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
444 tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
445
446 #
447 # PDM asynchronous completation stress test.
448 #
449 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
450 tstPDMAsyncCompletionStressHardened_TEMPLATE = VBOXR3HARDENEDEXE
451 tstPDMAsyncCompletionStressHardened_NAME = tstPDMAsyncCompletionStress
452 tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletionStress\"
453 tstPDMAsyncCompletionStressHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
454 tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3
455 else
456 tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
457 endif
458 tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
459 tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
460 tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
461endif
462
463ifndef VBOX_ONLY_EXTPACKS
464PROGRAMS += tstSSM-2
465tstSSM-2_TEMPLATE = VBOXR3TSTEXE
466tstSSM-2_DEFS = IN_VMM_STATIC
467tstSSM-2_SOURCES = tstSSM-2.cpp
468tstSSM-2_LIBS = $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB)
469endif
470
471#
472# Generate VM structure tests.
473#
474if !defined(VBOX_ONLY_EXTPACKS) \
475 && ( defined(VBOX_WITH_DTRACE_R3) \
476 || defined(VBOX_WITH_DTRACE_R0) \
477 || defined(VBOX_WITH_DTRACE_RC))
478 tstVMStructDTrace_TEMPLATE= VBOXR3AUTOTST
479 tstVMStructDTrace_DEFS = IN_VMM_R3 IN_DIS
480 ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
481 tstVMStructDTrace_DEFS += \
482 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
483 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
484 endif
485 ifdef VBOX_WITH_RAW_MODE
486 tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
487 endif
488 tstVMStructDTrace_INCS = \
489 $(VBOX_PATH_VMM_SRC)/include \
490 $(VBOX_PATH_VMM_SRC)/PATM \
491 $(VBOX_VMM_TESTCASE_OUT_DIR)
492 tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
493 ifdef VBOX_WITH_R0_LOGGING
494 tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
495 endif
496 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
497 tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
498 endif
499
500
501 VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
502 VMMLibDTraceStructTest_SOURCES = \
503 $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
504
505 $$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
506 $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
507 $(QUIET)$(RM) -f $@
508 $< > $@
509
510endif
511
512
513include $(FILE_KBUILD_SUB_FOOTER)
514
515
516#
517# Run rule for tstInstrEmul.
518#
519$(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run: $$(tstInstrEmul_1_STAGE_TARGET) | $$(dir $$@)
520 $(QUIET)$(RM) -f $@
521 $(QUIET)$(REDIRECT) -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
522 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
523 -- \
524 $(tstInstrEmul_1_STAGE_TARGET)
525 $(QUIET)$(APPEND) "$@" "done"
526
527
528#
529# Some handcrafted support targets for tstAsmStructs.
530#
531
532ifeq ($(KBUILD_HOST),win)
533 ifndef TOOL_MINGW32
534 include $(KBUILD_PATH)/tools/MINGW32.kmk
535 endif
536 VBOX_NM ?= $(PATH_TOOL_MINGW32)/bin/nm.exe -p
537else
538 VBOX_NM ?= nm -p
539endif
540
541MY_ASA_ASM_STUFF = \
542 $(addprefix -D, \
543 $(DEFS) \
544 $(DEFS.$(KBUILD_TYPE)) \
545 $(DEFS.$(KBUILD_TARGET)) \
546 IN_RING3 $(ARCH_BITS_DEFS) \
547 $(DEFS.$(KBUILD_TARGET_ARCH)) \
548 $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
549 $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
550 ) \
551 -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
552 $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
553 ,-I$(inc)/)
554
555# 1a. make a header file which makes all the structures+members globals.
556$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
557 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
558 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
559 $(DEPTH)/include/iprt/asmdefs.mac \
560 $(DEPTH)/include/VBox/vmm/cpum.mac \
561 $(DEPTH)/include/VBox/vmm/vm.mac \
562 $(DEPTH)/include/VBox/sup.mac \
563 $(DEPTH)/include/iprt/x86.mac \
564 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
565 $(VBOX_PATH_VMM_SRC)/include/TRPMInternal.mac \
566 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
567 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
568 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
569 $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
570 | $$(dir $$@)
571 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
572ifndef DONT_USE_YASM
573 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
574 $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ $@.lst
575else
576 $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
577 $(VBOX_NM) $@.o | $(SED) \
578 -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
579 -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
580 > $@
581endif
582
583# 1b. make an elf/macho object containing the offsets.
584$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
585 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
586 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
587 $(DEPTH)/include/iprt/asmdefs.mac \
588 $(DEPTH)/include/VBox/vmm/cpum.mac \
589 $(DEPTH)/include/VBox/vmm/hm_vmx.mac \
590 $(DEPTH)/include/VBox/vmm/stam.mac \
591 $(DEPTH)/include/VBox/vmm/trpm.mac \
592 $(DEPTH)/include/VBox/vmm/vm.mac \
593 $(DEPTH)/include/VBox/sup.mac \
594 $(DEPTH)/include/iprt/x86.mac \
595 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
596 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
597 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
598 $(VBOX_PATH_VMM_SRC)/include/VMMSwitcher.mac \
599 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
600 | $$(dir $$@)
601 $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
602ifndef DONT_USE_YASM
603 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
604else
605 $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
606endif
607
608# 2. use nm and sed to transform this into the header we want.
609$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
610 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
611 $(QUIET)$(RM) -f $@ $@.dump $@.tmp
612 $(QUIET)$(REDIRECT) -wo $@.dump -- $(VBOX_NM) $<
613 $(QUIET)$(SED) \
614 -e '/STAMPROFILEADV/d' \
615 \
616 -e '/00[0-9a-fA-F]* [aA] [^_.]*\./!d' \
617 -e 's/\(00[0-9a-fA-F]*\) [aA] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\2, 0x0\1, \3);/' \
618 --output $@.tmp $@.dump
619 $(QUIET)$(SED) \
620 -e '/VM_size$$/d' \
621 -e '/VMCPU_size$$/d' \
622 -e '/VMMCPU_size$$/d' \
623 -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
624 \
625 -e '/00[0-9a-fA-F]* [aA] [^_.]*_size$$/!d' \
626 -e 's/\(00[0-9a-fA-F]*\) [aA] \([^_.]*\)_size/ CHECK_SIZE(\2, 0x0\1);/' \
627 --append $@.tmp $@.dump
628 $(QUIET)$(MV) -f $@.tmp $@
629 $(QUIET)$(RM) -f $@.dump
630
631ifdef VBOX_WITH_RAW_MODE
632# 3. transform the HC header into a RC one by omitting some HC only structures.
633$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
634 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
635 $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' --output $@ $^
636endif
637
638# 4. run it.
639$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
640 $$(tstAsmStructs_1_STAGE_TARGET) \
641 $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
642 $(QUIET)$(RM) -f $@
643 $(tstAsmStructs_1_STAGE_TARGET)
644ifdef VBOX_WITH_RAW_MODE
645 $(tstAsmStructsRC_1_STAGE_TARGET)
646endif
647 $(QUIET)$(APPEND) "$@" "done"
648
649
650
651#
652# Run rule for tstVMStructSize.
653#
654
655ifdef VBOX_WITH_RAW_MODE
656# 1. Manually dump selected structures and members.
657$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
658 $(call MSG_GENERATE,tstVMStructSize,$@)
659 $(QUIET)$(REDIRECT) -wo $@ -- $<
660endif # VBOX_WITH_RAW_MODE
661
662# 2. run it.
663$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
664 $(QUIET)$(RM) -f $@
665 $<
666 $(QUIET)$(APPEND) "$@" "done"
667
668# alias for the two struct tests.
669run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
670
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