VirtualBox

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

最後變更 在這個檔案從80284是 80282,由 vboxsync 提交於 6 年 前

tstSSM: Does not need to be hardnend. bugref:9217

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette