1 | ; $Id: bootsector2-cpu-pf-1.asm 62484 2016-07-22 18:35:33Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; Bootsector test for various types of #PFs.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2007-2016 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 | ; The contents of this file may alternatively be used under the terms
|
---|
18 | ; of the Common Development and Distribution License Version 1.0
|
---|
19 | ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | ; VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | ; CDDL are applicable instead of those of the GPL.
|
---|
22 | ;
|
---|
23 | ; You may elect to license modified versions of this file under the
|
---|
24 | ; terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | ;
|
---|
26 |
|
---|
27 |
|
---|
28 | ;*******************************************************************************
|
---|
29 | ;* Header Files *
|
---|
30 | ;*******************************************************************************
|
---|
31 | %include "iprt/asmdefs.mac"
|
---|
32 | %include "iprt/x86.mac"
|
---|
33 | %include "VBox/VMMDevTesting.mac"
|
---|
34 |
|
---|
35 |
|
---|
36 | ;*******************************************************************************
|
---|
37 | ;* Defined Constants And Macros *
|
---|
38 | ;*******************************************************************************
|
---|
39 | ;; Base address at which we can start testing page tables and page directories.
|
---|
40 | %define TST_SCRATCH_PD_BASE BS2_MUCK_ABOUT_BASE
|
---|
41 | ;; Base address at which we can start testing the page pointer table.
|
---|
42 | %define TST_SCRATCH_PDPT_BASE (1 << X86_PDPT_SHIFT)
|
---|
43 | ;; Base address at which we can start testing the page map level 4.
|
---|
44 | %define TST_SCRATCH_PML4_BASE ((1 << X86_PML4_SHIFT) + TST_SCRATCH_PD_BASE)
|
---|
45 |
|
---|
46 | ;; The number of loops done during calibration.
|
---|
47 | %define TST_CALIBRATE_LOOP_COUNT 10000
|
---|
48 | ;; The desired benchmark period (seconds).
|
---|
49 | %define TST_BENCHMARK_PERIOD_IN_SECS 2
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 | ;
|
---|
54 | ; Include and execute the init code.
|
---|
55 | ;
|
---|
56 | %define BS2_INIT_RM
|
---|
57 | %define BS2_WITH_TRAPS
|
---|
58 | %define BS2_INC_RM
|
---|
59 | ; %define BS2_INC_PP16
|
---|
60 | %define BS2_INC_PP32
|
---|
61 | ; %define BS2_INC_PAE16
|
---|
62 | %define BS2_INC_PAE32
|
---|
63 | ; %define BS2_INC_LM16
|
---|
64 | ; %define BS2_INC_LM32
|
---|
65 | %define BS2_INC_LM64
|
---|
66 | %include "bootsector2-common-init-code.mac"
|
---|
67 |
|
---|
68 |
|
---|
69 | ;
|
---|
70 | ; The benchmark driver
|
---|
71 | ;
|
---|
72 | BEGINPROC main
|
---|
73 | ;
|
---|
74 | ; Test prologue.
|
---|
75 | ;
|
---|
76 | mov ax, .s_szTstName
|
---|
77 | call TestInit_r86
|
---|
78 | call Bs2EnableA20_r86
|
---|
79 |
|
---|
80 | ;
|
---|
81 | ; Execute the tests
|
---|
82 | ;
|
---|
83 | %if 1
|
---|
84 | %if 1
|
---|
85 | xor eax, eax ; NXE=0 (N/A)
|
---|
86 | call NAME(DoTestsForMode_rm_pp32)
|
---|
87 | %endif
|
---|
88 | %if 1
|
---|
89 | xor eax, eax ; NXE=0
|
---|
90 | call NAME(DoTestsForMode_rm_pae32)
|
---|
91 | mov eax, 1 ; NXE=1
|
---|
92 | call NAME(DoTestsForMode_rm_pae32)
|
---|
93 | %endif
|
---|
94 | %if 1
|
---|
95 | xor eax, eax ; NXE=0
|
---|
96 | call NAME(DoTestsForMode_rm_lm64)
|
---|
97 | mov eax, 1 ; NXE=1
|
---|
98 | call NAME(DoTestsForMode_rm_lm64)
|
---|
99 | %endif
|
---|
100 | %endif
|
---|
101 |
|
---|
102 | ;
|
---|
103 | ; Execute benchmarks.
|
---|
104 | ;
|
---|
105 | %if 1
|
---|
106 | mov ax, .s_szTstBenchmark
|
---|
107 | call NAME(TestSub_r86)
|
---|
108 | call NAME(DoBenchmarksForMode_rm_pp32)
|
---|
109 | call NAME(DoBenchmarksForMode_rm_pae32)
|
---|
110 | call NAME(DoBenchmarksForMode_rm_lm64)
|
---|
111 | call NAME(TestSubDone_r86)
|
---|
112 | %endif
|
---|
113 |
|
---|
114 | ;
|
---|
115 | ; We're done.
|
---|
116 | ;
|
---|
117 | call TestTerm_r86
|
---|
118 | ret
|
---|
119 |
|
---|
120 | .s_szTstBenchmark:
|
---|
121 | db 'Benchmark', 0
|
---|
122 | .s_szTstName:
|
---|
123 | db 'tstIOIntr', 0
|
---|
124 | .s_szTstX:
|
---|
125 | db 'X', 0
|
---|
126 | ENDPROC main
|
---|
127 |
|
---|
128 |
|
---|
129 | ;
|
---|
130 | ; Instantiate the template code.
|
---|
131 | ;
|
---|
132 | %include "bootsector2-template-footer.mac" ; reset the initial environemnt.
|
---|
133 |
|
---|
134 | ;%define TMPL_PP16
|
---|
135 | ;%include "bootsector2-cpu-pf-1-template.mac"
|
---|
136 | %define TMPL_PP32
|
---|
137 | %include "bootsector2-cpu-pf-1-template.mac"
|
---|
138 | ;%define TMPL_PAE16
|
---|
139 | ;%include "bootsector2-cpu-pf-1-template.mac"
|
---|
140 | %define TMPL_PAE32
|
---|
141 | %include "bootsector2-cpu-pf-1-template.mac"
|
---|
142 | ;%define TMPL_LM16
|
---|
143 | ;%include "bootsector2-cpu-pf-1-template.mac"
|
---|
144 | ;%define TMPL_LM32
|
---|
145 | ;%include "bootsector2-cpu-pf-1-template.mac"
|
---|
146 | %define TMPL_LM64
|
---|
147 | %include "bootsector2-cpu-pf-1-template.mac"
|
---|
148 |
|
---|
149 |
|
---|
150 | ;
|
---|
151 | ; End sections and image.
|
---|
152 | ;
|
---|
153 | %include "bootsector2-common-end.mac"
|
---|
154 |
|
---|