VirtualBox

source: vbox/trunk/src/VBox/VMM/include/NEMInternal.h@ 93352

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

VMM/NEM-win: Kicked out more code relating to using the VID API directly and to ring-0. bugref:10118 bugref:10162

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 20.9 KB
 
1/* $Id: NEMInternal.h 93352 2022-01-20 00:41:56Z vboxsync $ */
2/** @file
3 * NEM - Internal header file.
4 */
5
6/*
7 * Copyright (C) 2018-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
18#ifndef VMM_INCLUDED_SRC_include_NEMInternal_h
19#define VMM_INCLUDED_SRC_include_NEMInternal_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <VBox/cdefs.h>
25#include <VBox/types.h>
26#include <VBox/vmm/nem.h>
27#include <VBox/vmm/cpum.h> /* For CPUMCPUVENDOR. */
28#include <VBox/vmm/stam.h>
29#include <VBox/vmm/vmapi.h>
30#ifdef RT_OS_WINDOWS
31#include <iprt/nt/hyperv.h>
32#include <iprt/critsect.h>
33#elif defined(RT_OS_DARWIN)
34# include "VMXInternal.h"
35#endif
36
37RT_C_DECLS_BEGIN
38
39
40/** @defgroup grp_nem_int Internal
41 * @ingroup grp_nem
42 * @internal
43 * @{
44 */
45
46#if defined(VBOX_WITH_PGM_NEM_MODE) && !defined(VBOX_WITH_NATIVE_NEM)
47# error "VBOX_WITH_PGM_NEM_MODE requires VBOX_WITH_NATIVE_NEM to be defined"
48#endif
49
50
51#ifdef RT_OS_WINDOWS
52/*
53 * Windows: Code configuration.
54 */
55/* nothing at the moment */
56
57/**
58 * Windows VID I/O control information.
59 */
60typedef struct NEMWINIOCTL
61{
62 /** The I/O control function number. */
63 uint32_t uFunction;
64 uint32_t cbInput;
65 uint32_t cbOutput;
66} NEMWINIOCTL;
67
68/** @name Windows: Our two-bit physical page state for PGMPAGE
69 * @{ */
70# define NEM_WIN_PAGE_STATE_NOT_SET 0
71# define NEM_WIN_PAGE_STATE_UNMAPPED 1
72# define NEM_WIN_PAGE_STATE_READABLE 2
73# define NEM_WIN_PAGE_STATE_WRITABLE 3
74/** @} */
75
76/** Windows: Checks if a_GCPhys is subject to the limited A20 gate emulation. */
77# define NEM_WIN_IS_SUBJECT_TO_A20(a_GCPhys) ((RTGCPHYS)((a_GCPhys) - _1M) < (RTGCPHYS)_64K)
78/** Windows: Checks if a_GCPhys is relevant to the limited A20 gate emulation. */
79# define NEM_WIN_IS_RELEVANT_TO_A20(a_GCPhys) \
80 ( ((RTGCPHYS)((a_GCPhys) - _1M) < (RTGCPHYS)_64K) || ((RTGCPHYS)(a_GCPhys) < (RTGCPHYS)_64K) )
81
82/** The CPUMCTX_EXTRN_XXX mask for IEM. */
83# define NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM ( IEM_CPUMCTX_EXTRN_MUST_MASK | CPUMCTX_EXTRN_INHIBIT_INT \
84 | CPUMCTX_EXTRN_INHIBIT_NMI )
85/** The CPUMCTX_EXTRN_XXX mask for IEM when raising exceptions. */
86# define NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM_XCPT (IEM_CPUMCTX_EXTRN_XCPT_MASK | NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM)
87
88/** @name Windows: Interrupt window flags (NEM_WIN_INTW_F_XXX).
89 * @{ */
90# define NEM_WIN_INTW_F_NMI UINT8_C(0x01)
91# define NEM_WIN_INTW_F_REGULAR UINT8_C(0x02)
92# define NEM_WIN_INTW_F_PRIO_MASK UINT8_C(0x3c)
93# define NEM_WIN_INTW_F_PRIO_SHIFT 2
94/** @} */
95
96#endif /* RT_OS_WINDOWS */
97
98
99#ifdef RT_OS_DARWIN
100/** vCPU ID declaration to avoid dragging in HV headers here. */
101typedef unsigned hv_vcpuid_t;
102/** The HV VM memory space ID (ASID). */
103typedef unsigned hv_vm_space_t;
104
105
106/** @name Darwin: Our two-bit physical page state for PGMPAGE
107 * @{ */
108# define NEM_DARWIN_PAGE_STATE_NOT_SET 0
109# define NEM_DARWIN_PAGE_STATE_UNMAPPED 1
110# define NEM_DARWIN_PAGE_STATE_READABLE 2
111# define NEM_DARWIN_PAGE_STATE_WRITABLE 3
112/** @} */
113
114/** The CPUMCTX_EXTRN_XXX mask for IEM. */
115# define NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM ( IEM_CPUMCTX_EXTRN_MUST_MASK | CPUMCTX_EXTRN_INHIBIT_INT \
116 | CPUMCTX_EXTRN_INHIBIT_NMI )
117/** The CPUMCTX_EXTRN_XXX mask for IEM when raising exceptions. */
118# define NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM_XCPT (IEM_CPUMCTX_EXTRN_XCPT_MASK | NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM)
119
120#endif
121
122
123/** Trick to make slickedit see the static functions in the template. */
124#ifndef IN_SLICKEDIT
125# define NEM_TMPL_STATIC static
126#else
127# define NEM_TMPL_STATIC
128#endif
129
130
131/**
132 * Generic NEM exit type enumeration for use with EMHistoryAddExit.
133 *
134 * On windows we've got two different set of exit types and they are both jumping
135 * around the place value wise, so EM can use their values.
136 *
137 * @note We only have exit types for exits not covered by EM here.
138 */
139typedef enum NEMEXITTYPE
140{
141 NEMEXITTYPE_INVALID = 0,
142
143 /* Common: */
144 NEMEXITTYPE_INTTERRUPT_WINDOW,
145 NEMEXITTYPE_HALT,
146
147 /* Windows: */
148 NEMEXITTYPE_UNRECOVERABLE_EXCEPTION,
149 NEMEXITTYPE_INVALID_VP_REGISTER_VALUE,
150 NEMEXITTYPE_XCPT_UD,
151 NEMEXITTYPE_XCPT_DB,
152 NEMEXITTYPE_XCPT_BP,
153 NEMEXITTYPE_CANCELED,
154 NEMEXITTYPE_MEMORY_ACCESS,
155
156 /* Linux: */
157 NEMEXITTYPE_INTERNAL_ERROR_EMULATION,
158 NEMEXITTYPE_INTERNAL_ERROR_FATAL,
159 NEMEXITTYPE_INTERRUPTED,
160 NEMEXITTYPE_FAILED_ENTRY,
161
162 /* End of valid types. */
163 NEMEXITTYPE_END
164} NEMEXITTYPE;
165
166
167/**
168 * NEM VM Instance data.
169 */
170typedef struct NEM
171{
172 /** NEM_MAGIC. */
173 uint32_t u32Magic;
174
175 /** Set if enabled. */
176 bool fEnabled;
177 /** Set if long mode guests are allowed. */
178 bool fAllow64BitGuests;
179
180#if defined(RT_OS_LINUX)
181 /** The '/dev/kvm' file descriptor. */
182 int32_t fdKvm;
183 /** The KVM_CREATE_VM file descriptor. */
184 int32_t fdVm;
185
186 /** KVM_GET_VCPU_MMAP_SIZE. */
187 uint32_t cbVCpuMmap;
188 /** KVM_CAP_NR_MEMSLOTS. */
189 uint32_t cMaxMemSlots;
190 /** KVM_CAP_X86_ROBUST_SINGLESTEP. */
191 bool fRobustSingleStep;
192
193 /** Hint where there might be a free slot. */
194 uint16_t idPrevSlot;
195 /** Memory slot ID allocation bitmap. */
196 uint64_t bmSlotIds[_32K / 8 / sizeof(uint64_t)];
197
198#elif defined(RT_OS_WINDOWS)
199 /** Set if we've created the EMTs. */
200 bool fCreatedEmts : 1;
201 /** WHvRunVpExitReasonX64Cpuid is supported. */
202 bool fExtendedMsrExit : 1;
203 /** WHvRunVpExitReasonX64MsrAccess is supported. */
204 bool fExtendedCpuIdExit : 1;
205 /** WHvRunVpExitReasonException is supported. */
206 bool fExtendedXcptExit : 1;
207# ifdef NEM_WIN_WITH_A20
208 /** Set if we've started more than one CPU and cannot mess with A20. */
209 bool fA20Fixed : 1;
210 /** Set if A20 is enabled. */
211 bool fA20Enabled : 1;
212# endif
213 /** The reported CPU vendor. */
214 CPUMCPUVENDOR enmCpuVendor;
215 /** Cache line flush size as a power of two. */
216 uint8_t cCacheLineFlushShift;
217 /** The result of WHvCapabilityCodeProcessorFeatures. */
218 union
219 {
220 /** 64-bit view. */
221 uint64_t u64;
222# ifdef _WINHVAPIDEFS_H_
223 /** Interpreed features. */
224 WHV_PROCESSOR_FEATURES u;
225# endif
226 } uCpuFeatures;
227
228 /** The partition handle. */
229# ifdef _WINHVAPIDEFS_H_
230 WHV_PARTITION_HANDLE
231# else
232 RTHCUINTPTR
233# endif
234 hPartition;
235 /** The device handle for the partition, for use with Vid APIs or direct I/O
236 * controls. */
237 RTR3PTR hPartitionDevice;
238
239 /** Number of currently mapped pages. */
240 uint32_t volatile cMappedPages;
241 /** Max number of pages we dare map at once. */
242#ifdef VBOX_WITH_PGM_NEM_MODE
243 /** @todo consider removing this. */
244#endif
245 uint32_t cMaxMappedPages;
246 STAMCOUNTER StatMapPage;
247 STAMCOUNTER StatUnmapPage;
248# if !defined(VBOX_WITH_PGM_NEM_MODE)
249 STAMCOUNTER StatUnmapAllPages;
250# endif
251 STAMCOUNTER StatMapPageFailed;
252 STAMCOUNTER StatUnmapPageFailed;
253# ifdef VBOX_WITH_PGM_NEM_MODE
254 STAMPROFILE StatProfMapGpaRange;
255 STAMPROFILE StatProfUnmapGpaRange;
256# endif
257 STAMPROFILE StatProfMapGpaRangePage;
258 STAMPROFILE StatProfUnmapGpaRangePage;
259
260 /** Statistics updated by NEMR0UpdateStatistics. */
261 struct
262 {
263 uint64_t cPagesAvailable;
264 uint64_t cPagesInUse;
265 } R0Stats;
266
267#elif defined(RT_OS_DARWIN)
268 /** Set if we've created the EMTs. */
269 bool fCreatedEmts : 1;
270 /** Set if hv_vm_create() was called successfully. */
271 bool fCreatedVm : 1;
272 /** Set if hv_vm_space_create() was called successfully. */
273 bool fCreatedAsid : 1;
274 /** The ASID for this VM (only valid if fCreatedAsid is true). */
275 hv_vm_space_t uVmAsid;
276 STAMCOUNTER StatMapPage;
277 STAMCOUNTER StatUnmapPage;
278 STAMCOUNTER StatMapPageFailed;
279 STAMCOUNTER StatUnmapPageFailed;
280#endif /* RT_OS_WINDOWS */
281} NEM;
282/** Pointer to NEM VM instance data. */
283typedef NEM *PNEM;
284
285/** NEM::u32Magic value. */
286#define NEM_MAGIC UINT32_C(0x004d454e)
287/** NEM::u32Magic value after termination. */
288#define NEM_MAGIC_DEAD UINT32_C(0xdead1111)
289
290
291/**
292 * NEM VMCPU Instance data.
293 */
294typedef struct NEMCPU
295{
296 /** NEMCPU_MAGIC. */
297 uint32_t u32Magic;
298 /** Whether \#UD needs to be intercepted and presented to GIM. */
299 bool fGIMTrapXcptUD : 1;
300 /** Whether \#GP needs to be intercept for mesa driver workaround. */
301 bool fTrapXcptGpForLovelyMesaDrv: 1;
302
303#if defined(RT_OS_LINUX)
304 uint8_t abPadding[3];
305 /** The KVM VCpu file descriptor. */
306 int32_t fdVCpu;
307 /** Pointer to the KVM_RUN data exchange region. */
308 R3PTRTYPE(struct kvm_run *) pRun;
309 /** The MSR_IA32_APICBASE value known to KVM. */
310 uint64_t uKvmApicBase;
311
312 /** @name Statistics
313 * @{ */
314 STAMCOUNTER StatExitTotal;
315 STAMCOUNTER StatExitIo;
316 STAMCOUNTER StatExitMmio;
317 STAMCOUNTER StatExitSetTpr;
318 STAMCOUNTER StatExitTprAccess;
319 STAMCOUNTER StatExitRdMsr;
320 STAMCOUNTER StatExitWrMsr;
321 STAMCOUNTER StatExitIrqWindowOpen;
322 STAMCOUNTER StatExitHalt;
323 STAMCOUNTER StatExitIntr;
324 STAMCOUNTER StatExitHypercall;
325 STAMCOUNTER StatExitDebug;
326 STAMCOUNTER StatExitBusLock;
327 STAMCOUNTER StatExitInternalErrorEmulation;
328 STAMCOUNTER StatExitInternalErrorFatal;
329# if 0
330 STAMCOUNTER StatExitCpuId;
331 STAMCOUNTER StatExitUnrecoverable;
332 STAMCOUNTER StatGetMsgTimeout;
333 STAMCOUNTER StatStopCpuSuccess;
334 STAMCOUNTER StatStopCpuPending;
335 STAMCOUNTER StatStopCpuPendingAlerts;
336 STAMCOUNTER StatStopCpuPendingOdd;
337 STAMCOUNTER StatCancelChangedState;
338 STAMCOUNTER StatCancelAlertedThread;
339# endif
340 STAMCOUNTER StatBreakOnCancel;
341 STAMCOUNTER StatBreakOnFFPre;
342 STAMCOUNTER StatBreakOnFFPost;
343 STAMCOUNTER StatBreakOnStatus;
344 STAMCOUNTER StatFlushExitOnReturn;
345 STAMCOUNTER StatFlushExitOnReturn1Loop;
346 STAMCOUNTER StatFlushExitOnReturn2Loops;
347 STAMCOUNTER StatFlushExitOnReturn3Loops;
348 STAMCOUNTER StatFlushExitOnReturn4PlusLoops;
349 STAMCOUNTER StatImportOnDemand;
350 STAMCOUNTER StatImportOnReturn;
351 STAMCOUNTER StatImportOnReturnSkipped;
352 STAMCOUNTER StatImportPendingInterrupt;
353 STAMCOUNTER StatExportPendingInterrupt;
354 STAMCOUNTER StatQueryCpuTick;
355 /** @} */
356
357
358#elif defined(RT_OS_WINDOWS)
359 /** The current state of the interrupt windows (NEM_WIN_INTW_F_XXX). */
360 uint8_t fCurrentInterruptWindows;
361 /** The desired state of the interrupt windows (NEM_WIN_INTW_F_XXX). */
362 uint8_t fDesiredInterruptWindows;
363 /** Last copy of HV_X64_VP_EXECUTION_STATE::InterruptShadow. */
364 bool fLastInterruptShadow : 1;
365 uint32_t uPadding;
366 /** The VID_MSHAGN_F_XXX flags.
367 * Either VID_MSHAGN_F_HANDLE_MESSAGE | VID_MSHAGN_F_GET_NEXT_MESSAGE or zero. */
368 uint32_t fHandleAndGetFlags;
369 /** What VidMessageSlotMap returns and is used for passing exit info. */
370 RTR3PTR pvMsgSlotMapping;
371 /** The windows thread handle. */
372 RTR3PTR hNativeThreadHandle;
373
374 /** @name Statistics
375 * @{ */
376 STAMCOUNTER StatExitPortIo;
377 STAMCOUNTER StatExitMemUnmapped;
378 STAMCOUNTER StatExitMemIntercept;
379 STAMCOUNTER StatExitHalt;
380 STAMCOUNTER StatExitInterruptWindow;
381 STAMCOUNTER StatExitCpuId;
382 STAMCOUNTER StatExitMsr;
383 STAMCOUNTER StatExitException;
384 STAMCOUNTER StatExitExceptionBp;
385 STAMCOUNTER StatExitExceptionDb;
386 STAMCOUNTER StatExitExceptionGp;
387 STAMCOUNTER StatExitExceptionGpMesa;
388 STAMCOUNTER StatExitExceptionUd;
389 STAMCOUNTER StatExitExceptionUdHandled;
390 STAMCOUNTER StatExitUnrecoverable;
391 STAMCOUNTER StatGetMsgTimeout;
392 STAMCOUNTER StatStopCpuSuccess;
393 STAMCOUNTER StatStopCpuPending;
394 STAMCOUNTER StatStopCpuPendingAlerts;
395 STAMCOUNTER StatStopCpuPendingOdd;
396 STAMCOUNTER StatCancelChangedState;
397 STAMCOUNTER StatCancelAlertedThread;
398 STAMCOUNTER StatBreakOnCancel;
399 STAMCOUNTER StatBreakOnFFPre;
400 STAMCOUNTER StatBreakOnFFPost;
401 STAMCOUNTER StatBreakOnStatus;
402 STAMCOUNTER StatImportOnDemand;
403 STAMCOUNTER StatImportOnReturn;
404 STAMCOUNTER StatImportOnReturnSkipped;
405 STAMCOUNTER StatQueryCpuTick;
406 /** @} */
407
408#elif defined(RT_OS_DARWIN)
409 /** The vCPU handle associated with the EMT executing this vCPU. */
410 hv_vcpuid_t hVCpuId;
411
412 /** @name State shared with the VT-x code.
413 * @{ */
414 /** Whether we should use the debug loop because of single stepping or special
415 * debug breakpoints / events are armed. */
416 bool fUseDebugLoop;
417 /** Whether we're executing a single instruction. */
418 bool fSingleInstruction;
419
420 bool afAlignment0[2];
421
422 /** An additional error code used for some gurus. */
423 uint32_t u32HMError;
424 /** The last exit-to-ring-3 reason. */
425 int32_t rcLastExitToR3;
426 /** CPU-context changed flags (see HM_CHANGED_xxx). */
427 uint64_t fCtxChanged;
428
429 /** The guest VMCS information. */
430 VMXVMCSINFO VmcsInfo;
431
432 /** VT-x data. */
433 struct HMCPUVMX
434 {
435 /** @name Guest information.
436 * @{ */
437 /** Guest VMCS information shared with ring-3. */
438 VMXVMCSINFOSHARED VmcsInfo;
439 /** Nested-guest VMCS information shared with ring-3. */
440 VMXVMCSINFOSHARED VmcsInfoNstGst;
441 /** Whether the nested-guest VMCS was the last current VMCS (shadow copy for ring-3).
442 * @see HMR0PERVCPU::vmx.fSwitchedToNstGstVmcs */
443 bool fSwitchedToNstGstVmcsCopyForRing3;
444 /** Whether the static guest VMCS controls has been merged with the
445 * nested-guest VMCS controls. */
446 bool fMergedNstGstCtls;
447 /** Whether the nested-guest VMCS has been copied to the shadow VMCS. */
448 bool fCopiedNstGstToShadowVmcs;
449 /** Whether flushing the TLB is required due to switching to/from the
450 * nested-guest. */
451 bool fSwitchedNstGstFlushTlb;
452 /** Alignment. */
453 bool afAlignment0[4];
454 /** Cached guest APIC-base MSR for identifying when to map the APIC-access page. */
455 uint64_t u64GstMsrApicBase;
456 /** @} */
457
458 /** @name Error reporting and diagnostics.
459 * @{ */
460 /** VT-x error-reporting (mainly for ring-3 propagation). */
461 struct
462 {
463 RTCPUID idCurrentCpu;
464 RTCPUID idEnteredCpu;
465 RTHCPHYS HCPhysCurrentVmcs;
466 uint32_t u32VmcsRev;
467 uint32_t u32InstrError;
468 uint32_t u32ExitReason;
469 uint32_t u32GuestIntrState;
470 } LastError;
471 /** @} */
472 } vmx;
473
474 /** Event injection state. */
475 HMEVENT Event;
476
477 /** Current shadow paging mode for updating CR4.
478 * @todo move later (@bugref{9217}). */
479 PGMMODE enmShadowMode;
480 uint32_t u32TemporaryPadding;
481
482 /** The PAE PDPEs used with Nested Paging (only valid when
483 * VMCPU_FF_HM_UPDATE_PAE_PDPES is set). */
484 X86PDPE aPdpes[4];
485 /** Pointer to the VMX statistics. */
486 PVMXSTATISTICS pVmxStats;
487
488 /** @name Statistics
489 * @{ */
490 STAMCOUNTER StatExitAll;
491 STAMCOUNTER StatBreakOnCancel;
492 STAMCOUNTER StatBreakOnFFPre;
493 STAMCOUNTER StatBreakOnFFPost;
494 STAMCOUNTER StatBreakOnStatus;
495 STAMCOUNTER StatImportOnDemand;
496 STAMCOUNTER StatImportOnReturn;
497 STAMCOUNTER StatImportOnReturnSkipped;
498 STAMCOUNTER StatQueryCpuTick;
499#ifdef VBOX_WITH_STATISTICS
500 STAMPROFILEADV StatProfGstStateImport;
501 STAMPROFILEADV StatProfGstStateExport;
502#endif
503 /** @} */
504
505 /** @} */
506#endif /* RT_OS_DARWIN */
507} NEMCPU;
508/** Pointer to NEM VMCPU instance data. */
509typedef NEMCPU *PNEMCPU;
510
511/** NEMCPU::u32Magic value. */
512#define NEMCPU_MAGIC UINT32_C(0x4d454e20)
513/** NEMCPU::u32Magic value after termination. */
514#define NEMCPU_MAGIC_DEAD UINT32_C(0xdead2222)
515
516
517#ifdef IN_RING0
518# ifdef RT_OS_WINDOWS
519/**
520 * Windows: Hypercall input/ouput page info.
521 */
522typedef struct NEMR0HYPERCALLDATA
523{
524 /** Host physical address of the hypercall input/output page. */
525 RTHCPHYS HCPhysPage;
526 /** Pointer to the hypercall input/output page. */
527 uint8_t *pbPage;
528 /** Handle to the memory object of the hypercall input/output page. */
529 RTR0MEMOBJ hMemObj;
530} NEMR0HYPERCALLDATA;
531/** Pointer to a Windows hypercall input/output page info. */
532typedef NEMR0HYPERCALLDATA *PNEMR0HYPERCALLDATA;
533# endif /* RT_OS_WINDOWS */
534
535/**
536 * NEM GVMCPU instance data.
537 */
538typedef struct NEMR0PERVCPU
539{
540 uint32_t uDummy;
541} NEMR0PERVCPU;
542
543/**
544 * NEM GVM instance data.
545 */
546typedef struct NEMR0PERVM
547{
548 uint32_t uDummy;
549} NEMR0PERVM;
550
551#endif /* IN_RING*/
552
553
554#ifdef IN_RING3
555int nemR3NativeInit(PVM pVM, bool fFallback, bool fForced);
556int nemR3NativeInitAfterCPUM(PVM pVM);
557int nemR3NativeInitCompleted(PVM pVM, VMINITCOMPLETED enmWhat);
558int nemR3NativeTerm(PVM pVM);
559void nemR3NativeReset(PVM pVM);
560void nemR3NativeResetCpu(PVMCPU pVCpu, bool fInitIpi);
561VBOXSTRICTRC nemR3NativeRunGC(PVM pVM, PVMCPU pVCpu);
562bool nemR3NativeCanExecuteGuest(PVM pVM, PVMCPU pVCpu);
563bool nemR3NativeSetSingleInstruction(PVM pVM, PVMCPU pVCpu, bool fEnable);
564void nemR3NativeNotifyFF(PVM pVM, PVMCPU pVCpu, uint32_t fFlags);
565#endif
566
567void nemHCNativeNotifyHandlerPhysicalRegister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb);
568void nemHCNativeNotifyHandlerPhysicalModify(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld,
569 RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fRestoreAsRAM);
570int nemHCNativeNotifyPhysPageAllocated(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
571 PGMPAGETYPE enmType, uint8_t *pu2State);
572
573
574#ifdef RT_OS_WINDOWS
575/** Maximum number of pages we can map in a single NEMR0MapPages call. */
576# define NEM_MAX_MAP_PAGES ((PAGE_SIZE - RT_UOFFSETOF(HV_INPUT_MAP_GPA_PAGES, PageList)) / sizeof(HV_SPA_PAGE_NUMBER))
577/** Maximum number of pages we can unmap in a single NEMR0UnmapPages call. */
578# define NEM_MAX_UNMAP_PAGES 4095
579
580#endif
581/** @} */
582
583RT_C_DECLS_END
584
585#endif /* !VMM_INCLUDED_SRC_include_NEMInternal_h */
586
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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