VirtualBox

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

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

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