VirtualBox

source: vbox/trunk/src/VBox/VMM/include/PGMSlatDefs.h@ 96296

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

VMM: Nested VMX: bugref:10092 Added PGMSlatDefs.h.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 7.4 KB
 
1/* $Id: PGMSlatDefs.h 96296 2022-08-18 11:48:02Z vboxsync $ */
2/** @file
3 * VBox - Page Manager, SLAT Paging Template - All context code.
4 */
5
6/*
7 * Copyright (C) 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
19/*******************************************************************************
20* Defined Constants And Macros *
21*******************************************************************************/
22
23#undef SLAT_IS_PGENTRY_PRESENT
24#undef SLAT_IS_PML4E_VALID
25#undef SLAT_IS_PDPE_VALID
26#undef SLAT_IS_BIG_PDPE_VALID
27#undef SLAT_IS_PDE_VALID
28#undef SLAT_IS_BIG_PDE_VALID
29#undef SLAT_IS_PTE_VALID
30#undef SLAT_GET_PDPE1G_GCPHYS
31#undef SLAT_GET_PDE2M_GCPHYS
32#undef SLAT_GET_PTE_GCPHYS
33#undef SLAT_PAGE_1G_OFFSET_MASK
34#undef SLAT_PAGE_2M_OFFSET_MASK
35#undef SLAT_PML4_SHIFT
36#undef SLAT_PML4_MASK
37#undef SLAT_PDPT_SHIFT
38#undef SLAT_PDPT_MASK
39#undef SLAT_PD_SHIFT
40#undef SLAT_PD_MASK
41#undef SLAT_PT_SHIFT
42#undef SLAT_PT_MASK
43#undef SLATPDE
44#undef PSLATPDE
45#undef SLATPTE
46#undef PSLATPTE
47#undef PSLATPTWALK
48
49#define SLAT_IS_PGENTRY_PRESENT(a_pVCpu, a_Pge) ((a_Pge.u) & EPT_PRESENT_MASK)
50#define SLAT_IS_PML4E_VALID(a_pVCpu, a_Pml4e) (!( (a_Pml4e).u & (a_pVCpu)->pgm.s.fGstEptMbzPml4eMask ))
51#define SLAT_IS_PDPE_VALID(a_pVCpu, a_Pdpte) (!( (a_Pdpte).u & (a_pVCpu)->pgm.s.fGstEptMbzPdpteMask ))
52#define SLAT_IS_BIG_PDPE_VALID(a_pVCpu, a_Pdpe) (!( (a_Pdpe).u & (a_pVCpu)->pgm.s.fGstEptMbzBigPdpteMask ))
53#define SLAT_IS_PDE_VALID(a_pVCpu, a_Pde) (!( (a_Pde).u & (a_pVCpu)->pgm.s.fGstEptMbzPdeMask ))
54#define SLAT_IS_BIG_PDE_VALID(a_pVCpu, a_Pde) (!( (a_Pde).u & (a_pVCpu)->pgm.s.fGstEptMbzBigPdeMask ))
55#define SLAT_IS_PTE_VALID(a_pVCpu, a_Pte) (!( (a_Pte).u & (a_pVCpu)->pgm.s.fGstEptMbzPteMask ))
56#define SLAT_GET_PDPE1G_GCPHYS(a_pVCpu, a_Pdpte) PGM_A20_APPLY(a_pVCpu, ((a_Pdpte).u & EPT_PDPTE1G_PG_MASK))
57#define SLAT_GET_PDE2M_GCPHYS(a_pVCpu, a_Pde) PGM_A20_APPLY(a_pVCpu, ((a_Pde).u & EPT_PDE2M_PG_MASK))
58#define SLAT_GET_PTE_GCPHYS(a_pVCpu, a_Pte) PGM_A20_APPLY(a_pVCpu, ((a_Pte).u & EPT_E_PG_MASK))
59#define SLAT_PAGE_1G_OFFSET_MASK X86_PAGE_1G_OFFSET_MASK
60#define SLAT_PAGE_2M_OFFSET_MASK X86_PAGE_2M_OFFSET_MASK
61#define SLAT_PML4_SHIFT EPT_PML4_SHIFT
62#define SLAT_PML4_MASK EPT_PML4_MASK
63#define SLAT_PDPT_SHIFT EPT_PDPT_SHIFT
64#define SLAT_PDPT_MASK EPT_PDPT_MASK
65#define SLAT_PD_SHIFT EPT_PD_SHIFT
66#define SLAT_PD_MASK EPT_PD_MASK
67#define SLAT_PT_SHIFT EPT_PT_SHIFT
68#define SLAT_PT_MASK EPT_PT_MASK
69#define SLATPDE EPTPDE
70#define PSLATPDE PEPTPDE
71#define SLATPTE EPTPTE
72#define PSLATPTE PEPTPTE
73#define PSLATPTWALK PPGMPTWALKGSTEPT
74
75#if 0
76# if PGM_SHW_TYPE != PGM_TYPE_EPT
77# error "Only SLAT type of EPT is supported "
78# endif
79# if PGM_GST_TYPE != PGM_TYPE_EPT
80# error "Guest type for SLAT EPT "
81# endif
82
83# define GST_ATOMIC_OR(a_pu, a_fFlags) ASMAtomicOrU64((a_pu), (a_fFlags))
84# define GSTPT EPTPT
85# define PGSTPT PEPTPT
86# define GSTPTE EPTPTE
87# define PGSTPTE PEPTPTE
88# define GSTPD EPTPD
89# define PGSTPD PEPTPD
90# define GSTPDE EPTPDE
91# define PGSTPDE PEPTPDE
92# define GST_GIGANT_PAGE_SIZE X86_PAGE_1G_SIZE
93# define GST_GIGANT_PAGE_OFFSET_MASK X86_PAGE_1G_OFFSET_MASK
94# define GST_PDPE_BIG_PG_MASK X86_PDPE1G_PG_MASK
95# define GST_BIG_PAGE_SIZE X86_PAGE_2M_SIZE
96# define GST_BIG_PAGE_OFFSET_MASK X86_PAGE_2M_OFFSET_MASK
97# define GST_PDE_PG_MASK EPT_PDE_PG_MASK
98# define GST_PDE_BIG_PG_MASK EPT_PDE2M_PG_MASK
99# define GST_PD_SHIFT EPT_PD_SHIFT
100# define GST_PD_MASK EPT_PD_MASK
101# define GSTPTWALK PGMPTWALKGSTEPT
102# define PGSTPTWALK PPGMPTWALKGSTEPT
103# define PCGSTPTWALK PCPGMPTWALKGSTEPT
104# define GST_PDPE_ENTRIES EPT_PG_ENTRIES
105# define GST_PDPT_SHIFT EPT_PDPT_SHIFT
106# define GST_PDPE_PG_MASK EPT_PDPTE_PG_MASK
107# define GST_PDPT_MASK EPT_PDPT_MASK
108# define GST_PTE_PG_MASK EPT_E_PG_MASK
109# define GST_CR3_PAGE_MASK X86_CR3_EPT_PAGE_MASK
110# define GST_PT_SHIFT EPT_PT_SHIFT
111# define GST_PT_MASK EPT_PT_MASK
112# define GST_GET_PTE_GCPHYS(Pte) PGM_A20_APPLY(a_pVCpu, ((Pte).u & GST_PTE_PG_MASK))
113# define GST_GET_PDE_GCPHYS(Pde) PGM_A20_APPLY(a_pVCpu, ((Pde).u & GST_PDE_PG_MASK))
114# define GST_GET_BIG_PDE_GCPHYS(pVM, Pde) PGM_A20_APPLY(a_pVCpu, ((Pde).u & GST_PDE_BIG_PG_MASK))
115# define GST_GET_BIG_PDPE_GCPHYS(pVM, Pde) PGM_A20_APPLY(a_pVCpu, ((Pde).u & GST_PDPE_BIG_PG_MASK))
116# define GST_GET_PTE_SHW_FLAGS(a_pVCpu, Pte) (true && This_should_perhaps_not_be_used_in_this_context)
117# define GST_GET_PDE_SHW_FLAGS(a_pVCpu, Pde) (true && This_should_perhaps_not_be_used_in_this_context)
118# define GST_GET_BIG_PDE_SHW_FLAGS(a_pVCpu, Pde) (true && This_should_perhaps_not_be_used_in_this_context)
119# define GST_GET_BIG_PDE_SHW_FLAGS_4_PTE(a_pVCpu, Pde) (true && This_should_perhaps_not_be_used_in_this_context)
120# define GST_IS_PTE_VALID(a_pVCpu, Pte) (!( (Pte).u & (a_pVCpu)->pgm.s.fGstEptMbzPteMask ))
121# define GST_IS_PDE_VALID(a_pVCpu, Pde) (!( (Pde).u & (a_pVCpu)->pgm.s.fGstEptMbzPdeMask ))
122# define GST_IS_BIG_PDE_VALID(a_pVCpu, Pde) (!( (Pde).u & (a_pVCpu)->pgm.s.fGstEptMbzBigPdeMask ))
123# define GST_IS_PDPE_VALID(a_pVCpu, Pdpe) (!( (Pdpe).u & (a_pVCpu)->pgm.s.fGstEptMbzPdpteMask ))
124# define GST_IS_BIG_PDPE_VALID(a_pVCpu, Pdpe) (!( (Pdpe).u & (a_pVCpu)->pgm.s.fGstEptMbzBigPdpteMask ))
125# define GST_IS_PML4E_VALID(a_pVCpu, Pml4e) (!( (Pml4e).u & (a_pVCpu)->pgm.s.fGstEptMbzPml4eMask ))
126# define GST_IS_PGENTRY_PRESENT(a_pVCpu, Pge) ((Pge).u & EPT_PRESENT_MASK)
127# define GST_IS_PSE_ACTIVE(a_pVCpu) (!((a_pVCpu)->pgm.s.fGstEptMbzBigPdeMask & EPT_E_BIT_LEAF))
128# define GST_IS_NX_ACTIVE(a_pVCpu) (pgmGstIsNoExecuteActive(a_pVCpu))
129# define BTH_IS_NP_ACTIVE(pVM) (false)
130#endif
131
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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