VirtualBox

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

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

VMM/IEM,tstIEMAImpl: A handful of FPU instructions produces different results on AMD, it seems. bugref:9898

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