VirtualBox

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

Last change on this file since 56225 was 55290, checked in by vboxsync, 10 years ago

HM: Save/Load/Restore XCR0 handling during world switching. Implemented XSETBV for VT-x.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.9 KB
Line 
1# $Id: Makefile.kmk 55290 2015-04-15 15:04:30Z 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#
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 ) \
541 -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
542 $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
543 ,-I$(inc)/)
544
545# 1a. make a header file which makes all the structures+members globals.
546$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
547 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
548 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
549 $(DEPTH)/include/iprt/asmdefs.mac \
550 $(DEPTH)/include/VBox/vmm/cpum.mac \
551 $(DEPTH)/include/VBox/vmm/vm.mac \
552 $(DEPTH)/include/VBox/sup.mac \
553 $(DEPTH)/include/iprt/x86.mac \
554 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
555 $(VBOX_PATH_VMM_SRC)/include/TRPMInternal.mac \
556 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
557 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
558 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
559 $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
560 | $$(dir $$@)
561 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
562ifndef DONT_USE_YASM
563 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
564 $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ [email protected]
565else
566 $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
567 $(VBOX_NM) [email protected] | $(SED) \
568 -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
569 -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
570 > $@
571endif
572
573# 1b. make an elf/macho object containing the offsets.
574$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
575 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
576 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
577 $(DEPTH)/include/iprt/asmdefs.mac \
578 $(DEPTH)/include/VBox/vmm/cpum.mac \
579 $(DEPTH)/include/VBox/vmm/hm_vmx.mac \
580 $(DEPTH)/include/VBox/vmm/stam.mac \
581 $(DEPTH)/include/VBox/vmm/trpm.mac \
582 $(DEPTH)/include/VBox/vmm/vm.mac \
583 $(DEPTH)/include/VBox/sup.mac \
584 $(DEPTH)/include/iprt/x86.mac \
585 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
586 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
587 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
588 $(VBOX_PATH_VMM_SRC)/include/VMMSwitcher.mac \
589 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
590 | $$(dir $$@)
591 $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
592ifndef DONT_USE_YASM
593 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
594else
595 $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
596endif
597
598# 2. use nm and sed to transform this into the header we want.
599$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
600 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
601 $(QUIET)$(RM) -f $@ [email protected] [email protected]
602 $(QUIET)$(REDIRECT) -wo [email protected] -- $(VBOX_NM) $<
603 $(QUIET)$(SED) \
604 -e '/STAMPROFILEADV/d' \
605 \
606 -e '/00[0-9a-fA-F]* [aA] [^_.]*\./!d' \
607 -e 's/\(00[0-9a-fA-F]*\) [aA] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\2, 0x0\1, \3);/' \
608 --output [email protected] [email protected]
609 $(QUIET)$(SED) \
610 -e '/VM_size$$/d' \
611 -e '/VMCPU_size$$/d' \
612 -e '/VMMCPU_size$$/d' \
613 -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
614 -e '/HMCPU_size$$/d' \
615 \
616 -e '/00[0-9a-fA-F]* [aA] [^_.]*_size$$/!d' \
617 -e 's/\(00[0-9a-fA-F]*\) [aA] \([^_.]*\)_size/ CHECK_SIZE(\2, 0x0\1);/' \
618 --append [email protected] [email protected]
619 $(QUIET)$(MV) -f [email protected] $@
620 $(QUIET)$(RM) -f [email protected]
621
622ifdef VBOX_WITH_RAW_MODE
623# 3. transform the HC header into a RC one by omitting some HC only structures.
624$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
625 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
626 $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' --output $@ $^
627endif
628
629# 4. run it.
630$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
631 $$(tstAsmStructs_1_STAGE_TARGET) \
632 $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
633 $(QUIET)$(RM) -f $@
634 $(tstAsmStructs_1_STAGE_TARGET)
635ifdef VBOX_WITH_RAW_MODE
636 $(tstAsmStructsRC_1_STAGE_TARGET)
637endif
638 $(QUIET)$(APPEND) "$@" "done"
639
640
641
642#
643# Run rule for tstVMStructSize.
644#
645
646ifdef VBOX_WITH_RAW_MODE
647# 1. Manually dump selected structures and members.
648$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
649 $(call MSG_GENERATE,tstVMStructSize,$@)
650 $(QUIET)$(REDIRECT) -wo $@ -- $<
651endif # VBOX_WITH_RAW_MODE
652
653# 2. run it.
654$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
655 $(QUIET)$(RM) -f $@
656 $<
657 $(QUIET)$(APPEND) "$@" "done"
658
659# alias for the two struct tests.
660run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
661
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