VirtualBox

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

Last change on this file since 92689 was 92408, checked in by vboxsync, 3 years ago

VMM: Reworked most of the call-ring-3 stuff into setjmp-longjmp-on-assert and removed the stack switching/copying/resume code. bugref:10093 bugref:10124

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