VirtualBox

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

Last change on this file since 96686 was 96682, checked in by vboxsync, 2 years ago

VMM/testcase/tstIEMAImpl: Implement basic cvtps2pd testcase, ​bugref:9898

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