VirtualBox

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

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

VMM/PDMQueue: Rewrote the queue code to not use the hyper heap and be a bit safer. Added a testcase (driverless). bugref:10093

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.2 KB
Line 
1# $Id: Makefile.kmk 93609 2022-02-05 19:03:08Z vboxsync $
2## @file
3# Sub-Makefile for the VMM testcases.
4#
5
6#
7# Copyright (C) 2006-2022 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 tstPDMQueue \
72 tstSSM \
73 tstVMMR0CallHost-1 \
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-0 setjmp/longjmp code.
303#
304tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
305tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
306tstVMMR0CallHost-1_SOURCES = \
307 tstVMMR0CallHost-1.cpp
308tstVMMR0CallHost-1_SOURCES.amd64 = \
309 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
310tstVMMR0CallHost-1_SOURCES.x86 = \
311 $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
312
313
314#
315# For testing the VM request queue code.
316#
317if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
318tstVMREQHardened_TEMPLATE = VBOXR3HARDENEDEXE
319tstVMREQHardened_NAME = tstVMREQ
320 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
321tstVMREQHardened_DEFS = PROGRAM_NAME_STR="tstVMREQ"
322 else
323tstVMREQHardened_DEFS = PROGRAM_NAME_STR=\"tstVMREQ\"
324 endif
325tstVMREQHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
326tstVMREQ_TEMPLATE = VBOXR3
327else
328tstVMREQ_TEMPLATE = VBOXR3EXE
329endif
330tstVMREQ_DEFS = $(VMM_COMMON_DEFS)
331tstVMREQ_SOURCES = tstVMREQ.cpp
332tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
333
334#
335# Tool for reanimate things like OS/2 dumps.
336#
337if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
338tstAnimateHardened_TEMPLATE = VBOXR3HARDENEDEXE
339tstAnimateHardened_NAME = tstAnimate
340 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
341tstAnimateHardened_DEFS = PROGRAM_NAME_STR="tstAnimate"
342 else
343tstAnimateHardened_DEFS = PROGRAM_NAME_STR=\"tstAnimate\"
344 endif
345tstAnimateHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
346tstAnimate_TEMPLATE = VBOXR3
347else
348tstAnimate_TEMPLATE = VBOXR3EXE
349endif
350tstAnimate_DEFS = $(VMM_COMMON_DEFS)
351tstAnimate_SOURCES = tstAnimate.cpp
352tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
353
354tstX86-1_TEMPLATE = VBOXR3TSTEXE
355tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
356tstX86-1_LIBS = $(LIB_RUNTIME)
357tstX86-1_LDFLAGS.linux = $(VBOX_GCC_no-pie)
358
359tstX86-FpuSaveRestore_TEMPLATE = VBOXR3TSTEXE
360tstX86-FpuSaveRestore_SOURCES = tstX86-FpuSaveRestore.cpp tstX86-FpuSaveRestoreA.asm
361tstX86-FpuSaveRestore_LIBS = $(LIB_RUNTIME)
362
363ifdef VBOX_WITH_RAW_MODE
364
365 #
366 # Raw-mode VMM testcase.
367 #
368 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
369tstVMMHardened_TEMPLATE = VBOXR3HARDENEDEXE
370tstVMMHardened_NAME = tstVMM
371 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
372tstVMMHardened_DEFS = PROGRAM_NAME_STR="tstVMM"
373 else
374tstVMMHardened_DEFS = PROGRAM_NAME_STR=\"tstVMM\"
375 endif
376tstVMMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
377tstVMM_TEMPLATE = VBOXR3
378 else
379tstVMM_TEMPLATE = VBOXR3EXE
380 endif
381tstVMM_SOURCES = tstVMM.cpp
382tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
383
384#
385# HM VMM testcase.
386#
387tstVMM-HM_TEMPLATE = VBOXR3EXE
388tstVMM-HM_SOURCES = tstVMM-HM.cpp
389tstVMM-HM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
390
391#
392# VMM host process fork test case (memory ++).
393#
394tstVMMFork_TEMPLATE = VBOXR3EXE
395tstVMMFork_SOURCES = tstVMMFork.cpp
396tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
397
398#
399# Raw-mode micro benchmark.
400#
401 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
402tstMicroHardened_TEMPLATE = VBOXR3HARDENEDEXE
403tstMicroHardened_NAME = tstMicro
404 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
405tstMicroHardened_DEFS = PROGRAM_NAME_STR="tstMicro"
406 else
407tstMicroHardened_DEFS = PROGRAM_NAME_STR=\"tstMicro\"
408 endif
409tstMicroHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
410tstMicro_TEMPLATE = VBOXR3
411 else
412tstMicro_TEMPLATE = VBOXR3EXE
413 endif
414tstMicro_SOURCES = tstMicro.cpp
415tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
416tstMicro_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
417
418tstMicroRC_TEMPLATE = VBoxRc
419tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
420tstMicroRC_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
421tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
422 ifeq ($(VBOX_LDR_FMT32),pe)
423tstMicroRC_LDFLAGS = -Entry:tstMicroRC
424 endif
425tstMicroRC_SYSSUFF = .gc
426tstMicroRC_LIBS = \
427 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
428 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
429 ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
430tstMicroRC_LIBS += \
431 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
432 $(LIB_VMMRC)
433 endif
434tstMicroRC_SOURCES.win = tstMicroRC.def
435
436endif # VBOX_WITH_RAW_MODE
437
438
439if !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
440#
441# Special NEM host testcase.
442#
443 if ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "darwin.amd64" && (defined(VBOX_WITH_NATIVE_NEM) || "$(USERNAME)" == "bird")) \
444 || ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "linux.amd64" && (defined(VBOX_WITH_NATIVE_NEM) || "$(USERNAME)" == "bird")) \
445 || ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "win.amd64" && defined(VBOX_WITH_NATIVE_NEM))
446PROGRAMS += NemRawBench-1
447NemRawBench-1_TEMPLATE = VBoxR3Static
448NemRawBench-1_SOURCES = NemRawBench-1.cpp
449NemRawBench-1_BLD_TYPE = release
450NemRawBench-1_INCS.win = \
451 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/um \
452 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/shared
453NemRawBench-1_CXXFLAGS.darwin = \
454 -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform//Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
455#NemRawBench-1_LDFLAGS.darwin = \
456# -F/System/Library/Frameworks \
457# -framework Hypervisor
458NemRawBench-1_LDFLAGS.darwin = \
459 /System/Library/Frameworks/Hypervisor.framework/Hypervisor
460 endif
461endif
462
463#
464# PDM Queue tests.
465#
466tstPDMQueue_TEMPLATE := VBOXR3EXE
467tstPDMQueue_DEFS = $(VMM_COMMON_DEFS)
468tstPDMQueue_SOURCES := tstPDMQueue.cpp
469tstPDMQueue_LIBS := $(LIB_VMM) $(LIB_RUNTIME)
470
471
472ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
473#
474# PDM asynchronous completation test.
475#
476 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
477tstPDMAsyncCompletionHardened_TEMPLATE = VBOXR3HARDENEDEXE
478tstPDMAsyncCompletionHardened_NAME = tstPDMAsyncCompletion
479 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
480tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR="tstPDMAsyncCompletion"
481 else
482tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletion\"
483 endif
484tstPDMAsyncCompletionHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
485tstPDMAsyncCompletion_TEMPLATE = VBOXR3
486 else
487tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
488 endif
489tstPDMAsyncCompletion_DEFS = $(VMM_COMMON_DEFS)
490tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
491tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
492tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
493
494#
495# PDM asynchronous completation stress test.
496#
497 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
498tstPDMAsyncCompletionStressHardened_TEMPLATE = VBOXR3HARDENEDEXE
499tstPDMAsyncCompletionStressHardened_NAME = tstPDMAsyncCompletionStress
500 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
501tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR="tstPDMAsyncCompletionStress"
502 else
503tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletionStress\"
504 endif
505tstPDMAsyncCompletionStressHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
506tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3
507 else
508tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
509 endif
510tstPDMAsyncCompletionStress_DEFS = $(VMM_COMMON_DEFS)
511tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
512tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
513tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
514endif
515
516ifndef VBOX_ONLY_EXTPACKS
517PROGRAMS += tstSSM-2
518tstSSM-2_TEMPLATE = VBOXR3TSTEXE
519tstSSM-2_DEFS = IN_VMM_STATIC
520tstSSM-2_SOURCES = tstSSM-2.cpp
521tstSSM-2_LIBS = $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB)
522endif
523
524#
525# Generate VM structure tests.
526#
527if !defined(VBOX_ONLY_EXTPACKS) \
528 && ( defined(VBOX_WITH_DTRACE_R3) \
529 || defined(VBOX_WITH_DTRACE_R0) \
530 || defined(VBOX_WITH_DTRACE_RC))
531tstVMStructDTrace_TEMPLATE = VBOXR3AUTOTST
532tstVMStructDTrace_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
533 ifdef VBOX_WITH_RAW_MODE
534tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
535 endif
536tstVMStructDTrace_INCS = \
537 $(VBOX_PATH_VMM_SRC)/include \
538 $(VBOX_PATH_VMM_SRC)/PATM \
539 $(VBOX_VMM_TESTCASE_OUT_DIR)
540tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
541 ifdef VBOX_WITH_R0_LOGGING
542tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
543 endif
544 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
545tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
546 endif
547
548
549VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
550VMMLibDTraceStructTest_SOURCES = \
551 $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
552VMMLibDTraceStructTest_CLEAN = \
553 $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
554
555$$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
556 $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
557 $(QUIET)$(RM) -f $@
558 $< > $@
559
560endif
561
562
563include $(FILE_KBUILD_SUB_FOOTER)
564
565
566#
567# Some handcrafted support targets for tstAsmStructs.
568#
569MY_ASA_ASM_STUFF = \
570 $(addprefix -D, \
571 $(DEFS) \
572 $(DEFS.$(KBUILD_TYPE)) \
573 $(DEFS.$(KBUILD_TARGET)) \
574 IN_RING3 $(ARCH_BITS_DEFS) \
575 $(DEFS.$(KBUILD_TARGET_ARCH)) \
576 $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
577 $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
578 $(VMM_COMMON_DEFS) \
579 ) \
580 -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
581 $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
582 ,-I$(inc)/)
583
584# 1a. make a header file which makes all the structures+members globals.
585$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
586 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
587 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
588 $(DEPTH)/include/iprt/asmdefs.mac \
589 $(DEPTH)/include/VBox/vmm/cpum.mac \
590 $(DEPTH)/include/VBox/vmm/vm.mac \
591 $(DEPTH)/include/VBox/vmm/gvm.mac \
592 $(DEPTH)/include/VBox/sup.mac \
593 $(DEPTH)/include/iprt/x86.mac \
594 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
595 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
596 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
597 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
598 $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
599 | $$(dir $$@)
600 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
601ifndef DONT_USE_YASM
602 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
603 $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ [email protected]
604else
605 $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
606 $(VBOX_NM) [email protected] | $(SED) \
607 -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
608 -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
609 > $@
610endif
611
612# 1b. make an elf/macho object containing the offsets.
613includedep $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
614$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
615 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
616 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
617 $(DEPTH)/include/iprt/asmdefs.mac \
618 $(DEPTH)/include/VBox/vmm/cpum.mac \
619 $(DEPTH)/include/VBox/vmm/hm_vmx.mac \
620 $(DEPTH)/include/VBox/vmm/stam.mac \
621 $(DEPTH)/include/VBox/vmm/vm.mac \
622 $(DEPTH)/include/VBox/sup.mac \
623 $(DEPTH)/include/iprt/x86.mac \
624 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
625 $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
626 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
627 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
628 $$(if $$(eq $$(tstAsmStructsAsmDep_STUFF),$$(MY_ASA_ASM_STUFF)),,FORCE) \
629 | $$(dir $$@)
630 $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
631ifndef DONT_USE_YASM
632 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
633else
634 $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
635endif
636 %$(QUIET2)$(RM) -f -- $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
637 %$(QUIET2)$(APPEND) '$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep' 'tstAsmStructsAsmDep_STUFF=$(MY_ASA_ASM_STUFF)'
638
639# 2. use nm and sed to transform this into the header we want.
640$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
641 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
642 $(QUIET)$(RM) -f $@ [email protected] [email protected]
643 $(QUIET)$(REDIRECT) -wo [email protected] -- $(VBOX_NM) $<
644 $(QUIET)$(SED) \
645 -e '/STAMPROFILEADV/d' \
646 \
647 -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*\./!d' \
648 -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\3, 0x0\2, \4);/' \
649 --output [email protected] [email protected]
650 $(QUIET)$(SED) \
651 -e '/VM_size$$/d' \
652 -e '/VMCPU_size$$/d' \
653 -e '/VMMCPU_size$$/d' \
654 -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
655 -e '/HMCPU_size$$/d' \
656 \
657 -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*_size$$/!d' \
658 -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^_.]*\)_size/ CHECK_SIZE(\3, 0x0\2);/' \
659 --append [email protected] [email protected]
660 $(QUIET)$(MV) -f [email protected] $@
661 $(QUIET)$(RM) -f [email protected]
662
663# 3. run it.
664$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
665 $$(tstAsmStructs_1_STAGE_TARGET) \
666 $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
667 $(QUIET)$(RM) -f $@
668 $(tstAsmStructs_1_STAGE_TARGET)
669ifdef VBOX_WITH_RAW_MODE
670 $(tstAsmStructsRC_1_STAGE_TARGET)
671endif
672 $(QUIET)$(APPEND) "$@" "done"
673
674
675
676#
677# Run rule for tstVMStructSize.
678#
679
680ifdef VBOX_WITH_RAW_MODE
681# 1. Manually dump selected structures and members.
682$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
683 $(call MSG_GENERATE,tstVMStructSize,$@)
684 $(QUIET)$(REDIRECT) -wo $@ -- $<
685endif # VBOX_WITH_RAW_MODE
686
687# 2. run it.
688$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
689 $(QUIET)$(RM) -f $@
690 $<
691 $(QUIET)$(APPEND) "$@" "done"
692
693# alias for the two struct tests.
694run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
695
Note: See TracBrowser for help on using the repository browser.

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