VirtualBox

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

最後變更 在這個檔案從93730是 93725,由 vboxsync 提交於 3 年 前

VMM: More arm64 adjustments. bugref:9898

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette