1 | /* $Id: NEMR0Native-stubs.cpp 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * NEM - Native execution manager, ring-0 stubs until there is a driverless mode.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2021-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 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*********************************************************************************************************************************
|
---|
30 | * Header Files *
|
---|
31 | *********************************************************************************************************************************/
|
---|
32 | #define LOG_GROUP LOG_GROUP_NEM
|
---|
33 | #include <VBox/vmm/nem.h>
|
---|
34 | #include "NEMInternal.h"
|
---|
35 | #include <VBox/vmm/gvm.h>
|
---|
36 | #include <VBox/vmm/vmcc.h>
|
---|
37 | #include <VBox/vmm/gvmm.h>
|
---|
38 |
|
---|
39 | #include <iprt/errcore.h>
|
---|
40 |
|
---|
41 |
|
---|
42 | /*********************************************************************************************************************************
|
---|
43 | * Internal Functions *
|
---|
44 | *********************************************************************************************************************************/
|
---|
45 |
|
---|
46 |
|
---|
47 | /*********************************************************************************************************************************
|
---|
48 | * Global Variables *
|
---|
49 | *********************************************************************************************************************************/
|
---|
50 |
|
---|
51 |
|
---|
52 | /*********************************************************************************************************************************
|
---|
53 | * Internal Functions *
|
---|
54 | *********************************************************************************************************************************/
|
---|
55 |
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Module initialization for NEM.
|
---|
59 | */
|
---|
60 | VMMR0_INT_DECL(int) NEMR0Init(void)
|
---|
61 | {
|
---|
62 | return VINF_SUCCESS;
|
---|
63 | }
|
---|
64 |
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Module termination for NEM.
|
---|
68 | */
|
---|
69 | VMMR0_INT_DECL(void) NEMR0Term(void)
|
---|
70 | {
|
---|
71 | }
|
---|
72 |
|
---|
73 |
|
---|
74 | VMMR0_INT_DECL(int) NEMR0InitVM(PGVM pGVM)
|
---|
75 | {
|
---|
76 | RT_NOREF(pGVM);
|
---|
77 | return VINF_SUCCESS;
|
---|
78 | }
|
---|
79 |
|
---|
80 |
|
---|
81 | VMMR0_INT_DECL(int) NEMR0InitVMPart2(PGVM pGVM)
|
---|
82 | {
|
---|
83 | RT_NOREF(pGVM);
|
---|
84 | return VINF_SUCCESS;
|
---|
85 | }
|
---|
86 |
|
---|
87 |
|
---|
88 | VMMR0_INT_DECL(void) NEMR0CleanupVM(PGVM pGVM)
|
---|
89 | {
|
---|
90 | RT_NOREF(pGVM);
|
---|
91 | }
|
---|
92 |
|
---|
93 |
|
---|
94 | VMMR0_INT_DECL(int) NEMR0MapPages(PGVM pGVM, VMCPUID idCpu)
|
---|
95 | {
|
---|
96 | RT_NOREF(pGVM, idCpu);
|
---|
97 | AssertFailed();
|
---|
98 | return VERR_NOT_SUPPORTED;
|
---|
99 | }
|
---|
100 |
|
---|
101 |
|
---|
102 | VMMR0_INT_DECL(int) NEMR0UnmapPages(PGVM pGVM, VMCPUID idCpu)
|
---|
103 | {
|
---|
104 | RT_NOREF(pGVM, idCpu);
|
---|
105 | AssertFailed();
|
---|
106 | return VERR_NOT_SUPPORTED;
|
---|
107 | }
|
---|
108 |
|
---|
109 |
|
---|
110 | VMMR0_INT_DECL(int) NEMR0ExportState(PGVM pGVM, VMCPUID idCpu)
|
---|
111 | {
|
---|
112 | RT_NOREF(pGVM, idCpu);
|
---|
113 | AssertFailed();
|
---|
114 | return VERR_NOT_IMPLEMENTED;
|
---|
115 | }
|
---|
116 |
|
---|
117 |
|
---|
118 | VMMR0_INT_DECL(int) NEMR0ImportState(PGVM pGVM, VMCPUID idCpu, uint64_t fWhat)
|
---|
119 | {
|
---|
120 | RT_NOREF(pGVM, idCpu, fWhat);
|
---|
121 | AssertFailed();
|
---|
122 | return VERR_NOT_IMPLEMENTED;
|
---|
123 | }
|
---|
124 |
|
---|
125 |
|
---|
126 | VMMR0_INT_DECL(int) NEMR0QueryCpuTick(PGVM pGVM, VMCPUID idCpu)
|
---|
127 | {
|
---|
128 | RT_NOREF(pGVM, idCpu);
|
---|
129 | AssertFailed();
|
---|
130 | return VERR_NOT_IMPLEMENTED;
|
---|
131 | }
|
---|
132 |
|
---|
133 |
|
---|
134 | VMMR0_INT_DECL(int) NEMR0ResumeCpuTickOnAll(PGVM pGVM, VMCPUID idCpu, uint64_t uPausedTscValue)
|
---|
135 | {
|
---|
136 | RT_NOREF(pGVM, idCpu, uPausedTscValue);
|
---|
137 | AssertFailed();
|
---|
138 | return VERR_NOT_IMPLEMENTED;
|
---|
139 | }
|
---|
140 |
|
---|
141 |
|
---|
142 | VMMR0_INT_DECL(VBOXSTRICTRC) NEMR0RunGuestCode(PGVM pGVM, VMCPUID idCpu)
|
---|
143 | {
|
---|
144 | RT_NOREF(pGVM, idCpu);
|
---|
145 | AssertFailed();
|
---|
146 | return VERR_NOT_IMPLEMENTED;
|
---|
147 | }
|
---|
148 |
|
---|
149 |
|
---|
150 | VMMR0_INT_DECL(int) NEMR0UpdateStatistics(PGVM pGVM, VMCPUID idCpu)
|
---|
151 | {
|
---|
152 | RT_NOREF(pGVM, idCpu);
|
---|
153 | AssertFailed();
|
---|
154 | return VINF_SUCCESS;
|
---|
155 | }
|
---|
156 |
|
---|
157 |
|
---|
158 | VMMR0_INT_DECL(int) NEMR0DoExperiment(PGVM pGVM, VMCPUID idCpu, uint64_t u64Arg)
|
---|
159 | {
|
---|
160 | RT_NOREF(pGVM, idCpu, u64Arg);
|
---|
161 | AssertFailed();
|
---|
162 | return VERR_NOT_SUPPORTED;
|
---|
163 | }
|
---|
164 |
|
---|
165 |
|
---|
166 | void nemHCNativeNotifyHandlerPhysicalRegister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb)
|
---|
167 | {
|
---|
168 | Log5(("nemHCNativeNotifyHandlerPhysicalRegister: %RGp LB %RGp enmKind=%d\n", GCPhys, cb, enmKind));
|
---|
169 | AssertFailed();
|
---|
170 | NOREF(pVM); NOREF(enmKind); NOREF(GCPhys); NOREF(cb);
|
---|
171 | }
|
---|
172 |
|
---|
173 |
|
---|
174 | void nemHCNativeNotifyHandlerPhysicalModify(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld,
|
---|
175 | RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fRestoreAsRAM)
|
---|
176 | {
|
---|
177 | Log5(("nemHCNativeNotifyHandlerPhysicalModify: %RGp LB %RGp -> %RGp enmKind=%d fRestoreAsRAM=%d\n",
|
---|
178 | GCPhysOld, cb, GCPhysNew, enmKind, fRestoreAsRAM));
|
---|
179 | AssertFailed();
|
---|
180 | NOREF(pVM); NOREF(enmKind); NOREF(GCPhysOld); NOREF(GCPhysNew); NOREF(cb); NOREF(fRestoreAsRAM);
|
---|
181 | }
|
---|
182 |
|
---|
183 |
|
---|
184 | int nemHCNativeNotifyPhysPageAllocated(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
|
---|
185 | PGMPAGETYPE enmType, uint8_t *pu2State)
|
---|
186 | {
|
---|
187 | Log5(("nemHCNativeNotifyPhysPageAllocated: %RGp HCPhys=%RHp fPageProt=%#x enmType=%d *pu2State=%d\n",
|
---|
188 | GCPhys, HCPhys, fPageProt, enmType, *pu2State));
|
---|
189 | AssertFailed();
|
---|
190 | RT_NOREF(pVM, GCPhys, HCPhys, fPageProt, enmType, pu2State);
|
---|
191 | return VERR_NOT_SUPPORTED;
|
---|
192 | }
|
---|
193 |
|
---|
194 |
|
---|
195 | void nemHCNativeNotifyPhysPageProtChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
|
---|
196 | PGMPAGETYPE enmType, uint8_t *pu2State)
|
---|
197 | {
|
---|
198 | Log5(("nemHCNativeNotifyPhysPageProtChanged: %RGp HCPhys=%RHp fPageProt=%#x enmType=%d *pu2State=%d\n",
|
---|
199 | GCPhys, HCPhys, fPageProt, enmType, *pu2State));
|
---|
200 | AssertFailed();
|
---|
201 | RT_NOREF(pVM, GCPhys, HCPhys, fPageProt, enmType, pu2State);
|
---|
202 | }
|
---|
203 |
|
---|
204 |
|
---|
205 | void nemHCNativeNotifyPhysPageChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew,
|
---|
206 | uint32_t fPageProt, PGMPAGETYPE enmType, uint8_t *pu2State)
|
---|
207 | {
|
---|
208 | Log5(("nemHCNativeNotifyPhysPageChanged: %RGp HCPhys=%RHp->%RHp fPageProt=%#x enmType=%d *pu2State=%d\n",
|
---|
209 | GCPhys, HCPhysPrev, HCPhysNew, fPageProt, enmType, *pu2State));
|
---|
210 | AssertFailed();
|
---|
211 | RT_NOREF(pVM, GCPhys, HCPhysPrev, HCPhysNew, fPageProt, enmType, pu2State);
|
---|
212 | }
|
---|
213 |
|
---|
214 |
|
---|
215 | VMM_INT_DECL(int) NEMHCQueryCpuTick(PVMCPUCC pVCpu, uint64_t *pcTicks, uint32_t *puAux)
|
---|
216 | {
|
---|
217 | LogFlowFunc(("pVCpu=%p pcTicks=%RX64 puAux=%RX32\n", pVCpu, pcTicks, puAux));
|
---|
218 | AssertFailed();
|
---|
219 | RT_NOREF(pVCpu, pcTicks, puAux);
|
---|
220 | return VERR_NOT_SUPPORTED;
|
---|
221 | }
|
---|
222 |
|
---|
223 |
|
---|
224 | VMM_INT_DECL(int) NEMHCResumeCpuTickOnAll(PVMCC pVM, PVMCPUCC pVCpu, uint64_t uPausedTscValue)
|
---|
225 | {
|
---|
226 | LogFlowFunc(("pVM=%p pVCpu=%p uPausedTscValue=%RX64\n", pVM, pVCpu, uPausedTscValue));
|
---|
227 | AssertFailed();
|
---|
228 | RT_NOREF(pVM, pVCpu, uPausedTscValue);
|
---|
229 | return VERR_NOT_SUPPORTED;
|
---|
230 | }
|
---|
231 |
|
---|
232 |
|
---|
233 | VMM_INT_DECL(void) NEMHCNotifyHandlerPhysicalDeregister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,
|
---|
234 | RTR3PTR pvMemR3, uint8_t *pu2State)
|
---|
235 | {
|
---|
236 | Log5(("NEMHCNotifyHandlerPhysicalDeregister: %RGp LB %RGp enmKind=%d pvMemR3=%p pu2State=%p (%d)\n",
|
---|
237 | GCPhys, cb, enmKind, pvMemR3, pu2State, *pu2State));
|
---|
238 | AssertFailed();
|
---|
239 | RT_NOREF(pVM, enmKind, GCPhys, cb, pvMemR3, pu2State);
|
---|
240 | }
|
---|
241 |
|
---|
242 |
|
---|
243 | VMM_INT_DECL(void) NEMHCNotifyPhysPageChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew,
|
---|
244 | RTR3PTR pvNewR3, uint32_t fPageProt, PGMPAGETYPE enmType, uint8_t *pu2State)
|
---|
245 | {
|
---|
246 | Log5(("NEMHCNotifyPhysPageChanged: %RGp HCPhys=%RHp->%RHp fPageProt=%#x enmType=%d *pu2State=%d\n",
|
---|
247 | GCPhys, HCPhysPrev, HCPhysNew, fPageProt, enmType, *pu2State));
|
---|
248 | AssertFailed();
|
---|
249 | RT_NOREF(pVM, GCPhys, HCPhysPrev, HCPhysNew, pvNewR3, fPageProt, enmType, pu2State);
|
---|
250 | }
|
---|
251 |
|
---|
252 |
|
---|
253 | VMM_INT_DECL(void) NEMHCNotifyPhysPageProtChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, RTR3PTR pvR3, uint32_t fPageProt,
|
---|
254 | PGMPAGETYPE enmType, uint8_t *pu2State)
|
---|
255 | {
|
---|
256 | Log5(("NEMHCNotifyPhysPageProtChanged: %RGp HCPhys=%RHp fPageProt=%#x enmType=%d *pu2State=%d\n",
|
---|
257 | GCPhys, HCPhys, fPageProt, enmType, *pu2State));
|
---|
258 | AssertFailed();
|
---|
259 | RT_NOREF(pVM, GCPhys, HCPhys, pvR3, fPageProt, enmType, pu2State);
|
---|
260 | }
|
---|
261 |
|
---|
262 |
|
---|
263 | VMM_INT_DECL(int) NEMImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat)
|
---|
264 | {
|
---|
265 | AssertFailed();
|
---|
266 | RT_NOREF(pVCpu, fWhat);
|
---|
267 | return VERR_NOT_IMPLEMENTED;
|
---|
268 | }
|
---|