VirtualBox

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

Last change on this file since 84044 was 82968, checked in by vboxsync, 4 years ago

Copyright year updates by scm.

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

© 2023 Oracle
ContactPrivacy policyTerms of Use