VirtualBox

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

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

VMM/IEM: Try deal with basic Intel/AMD EFLAGS difference for binary and div/mul operations (intel side). bugref:9898

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