VirtualBox

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

Last change on this file since 85972 was 84540, checked in by vboxsync, 5 years ago

Reverting r138262 (i.e. restoring VBOX_WITH_AUTOMATIC_DEFS_QUOTING). Corrected the conditions for it's definition instead. bugref:8489

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