VirtualBox

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

Last change on this file since 60605 was 60542, checked in by vboxsync, 9 years ago

VMM/APIC: Much fun with alignment and sizes.

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