VirtualBox

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

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

tstIEMAImpl: Split the data out and put it in separate files to avoid turning it into a compiler memory usage test. bugref:9898

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