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