VirtualBox

source: vbox/trunk/include/VBox/param.h@ 93554

Last change on this file since 93554 was 93554, checked in by vboxsync, 3 years ago

VMM: Changed PAGE_SIZE -> GUEST_PAGE_SIZE / HOST_PAGE_SIZE, PAGE_SHIFT -> GUEST_PAGE_SHIFT / HOST_PAGE_SHIFT, and PAGE_OFFSET_MASK -> GUEST_PAGE_OFFSET_MASK / HOST_PAGE_OFFSET_MASK. Also removed most usage of ASMMemIsZeroPage and ASMMemZeroPage since the host and guest page size doesn't need to be the same any more. Some work left to do in the page pool code. bugref:9898

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.1 KB
Line 
1/** @file
2 * VirtualBox Parameter Definitions. (VMM,+)
3 *
4 * param.mac is generated from this file by running 'kmk incs' in the root.
5 */
6
7/*
8 * Copyright (C) 2006-2022 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * The contents of this file may alternatively be used under the terms
19 * of the Common Development and Distribution License Version 1.0
20 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21 * VirtualBox OSE distribution, in which case the provisions of the
22 * CDDL are applicable instead of those of the GPL.
23 *
24 * You may elect to license modified versions of this file under the
25 * terms and conditions of either the GPL or the CDDL or both.
26 */
27
28#ifndef VBOX_INCLUDED_param_h
29#define VBOX_INCLUDED_param_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <iprt/param.h>
35#include <iprt/cdefs.h>
36
37
38/** @defgroup grp_vbox_param VBox Parameter Definition
39 * @{
40 */
41
42/** The guest page size (x86). */
43#define GUEST_PAGE_SIZE 0x1000
44/** The guest page offset mask (x86).
45 * @note If one-complementing this, always put a typecast after the operator! */
46#define GUEST_PAGE_OFFSET_MASK 0xfff
47/** The guest page shift (x86). */
48#define GUEST_PAGE_SHIFT 12
49
50/** Host page size. */
51#define HOST_PAGE_SIZE PAGE_SIZE
52/** Host page offset mask.
53 * @note If one-complementing this, always put a typecast after the operator! */
54#define HOST_PAGE_OFFSET_MASK PAGE_OFFSET_MASK
55/** Host page shift. */
56#define HOST_PAGE_SHIFT PAGE_SHIFT
57
58
59/** The maximum number of pages that can be allocated and mapped
60 * by various MM, PGM and SUP APIs. */
61#if ARCH_BITS == 64
62# define VBOX_MAX_ALLOC_PAGE_COUNT (_512M / PAGE_SIZE)
63#else
64# define VBOX_MAX_ALLOC_PAGE_COUNT (_256M / PAGE_SIZE)
65#endif
66
67/** @def VBOX_WITH_PAGE_SHARING
68 * Enables the page sharing code.
69 * @remarks This must match GMMR0Init; currently we only support page fusion on
70 * all 64-bit hosts except Mac OS X */
71#if ( HC_ARCH_BITS == 64 /* ASM-NOINC */ \
72 && (defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)) ) /* ASM-NOINC */ \
73 || defined(DOXYGEN_RUNNING) /* ASM-NOINC */
74# define VBOX_WITH_PAGE_SHARING /* ASM-NOINC */
75#endif /* ASM-NOINC */
76
77
78/** @defgroup grp_vbox_param_mm Memory Monitor Parameters
79 * @{
80 */
81/** Initial address of Hypervisor Memory Area.
82 * MUST BE PAGE TABLE ALIGNED! */
83#define MM_HYPER_AREA_ADDRESS UINT32_C(0xa0000000)
84
85/** The max size of the hypervisor memory area. */
86#define MM_HYPER_AREA_MAX_SIZE (40U * _1M) /**< @todo Readjust when floating RAMRANGEs have been implemented. Used to be 20 * _1MB */
87
88/** Maximum number of bytes we can dynamically map into the hypervisor region.
89 * This must be a power of 2 number of pages!
90 */
91#define MM_HYPER_DYNAMIC_SIZE (16U * PAGE_SIZE)
92
93/** The minimum guest RAM size in bytes. */
94#define MM_RAM_MIN UINT32_C(0x00400000)
95/** The maximum guest RAM size in bytes. */
96#if HC_ARCH_BITS == 64
97# define MM_RAM_MAX UINT64_C(0x20000000000)
98#else
99# define MM_RAM_MAX UINT64_C(0x000E0000000)
100#endif
101/** The minimum guest RAM size in MBs. */
102#define MM_RAM_MIN_IN_MB UINT32_C(4)
103/** The maximum guest RAM size in MBs. */
104#if HC_ARCH_BITS == 64
105# define MM_RAM_MAX_IN_MB UINT32_C(2097152)
106#else
107# define MM_RAM_MAX_IN_MB UINT32_C(3584)
108#endif
109/** The default size of the below 4GB RAM hole. */
110#define MM_RAM_HOLE_SIZE_DEFAULT (512U * _1M)
111/** The maximum 64-bit MMIO BAR size.
112 * @remarks There isn't really any limit here other than the size of the
113 * tracking structures we need (around 1/256 of the size). */
114#if HC_ARCH_BITS == 64
115# define MM_MMIO_64_MAX _1T
116#else
117# define MM_MMIO_64_MAX (_1G64 * 16)
118#endif
119/** The maximum 32-bit MMIO BAR size. */
120#define MM_MMIO_32_MAX _2G
121
122/** @} */
123
124
125/** @defgroup grp_vbox_param_pgm Page Manager Parameters
126 * @{
127 */
128/** The number of handy pages.
129 * This should be a power of two. */
130#define PGM_HANDY_PAGES 128
131/** The threshold at which allocation of more handy pages is flagged. */
132#define PGM_HANDY_PAGES_SET_FF 32
133/** The threshold at which we will allocate more when in ring-3.
134 * This is must be smaller than both PGM_HANDY_PAGES_SET_FF and
135 * PGM_HANDY_PAGES_MIN. */
136#define PGM_HANDY_PAGES_R3_ALLOC 8
137/** The threshold at which we will allocate more when in ring-0 or raw mode.
138 * The idea is that we should never go below this threshold while in ring-0 or
139 * raw mode because of PGM_HANDY_PAGES_RZ_TO_R3. However, should this happen and
140 * we are actually out of memory, we will have 8 page to get out of whatever
141 * code we're executing.
142 *
143 * This is must be smaller than both PGM_HANDY_PAGES_SET_FF and
144 * PGM_HANDY_PAGES_MIN. */
145#define PGM_HANDY_PAGES_RZ_ALLOC 8
146/** The threshold at which we force return to R3 ASAP.
147 * The idea is that this should be large enough to get out of any code and up to
148 * the main EM loop when we are out of memory.
149 * This must be less or equal to PGM_HANDY_PAGES_MIN. */
150#define PGM_HANDY_PAGES_RZ_TO_R3 24
151/** The minimum number of handy pages (after allocation).
152 * This must be greater or equal to PGM_HANDY_PAGES_SET_FF.
153 * Another name would be PGM_HANDY_PAGES_EXTRA_RESERVATION or _PARANOIA. :-) */
154#define PGM_HANDY_PAGES_MIN 32
155/** @} */
156
157
158/** @defgroup grp_vbox_param_vmm VMM Parameters
159 * @{
160 */
161/** VMM stack size. */
162#ifdef RT_OS_DARWIN
163# define VMM_STACK_SIZE 16384U
164#else
165# define VMM_STACK_SIZE 8192U
166#endif
167/** Min number of Virtual CPUs. */
168#define VMM_MIN_CPU_COUNT 1
169/** Max number of Virtual CPUs. */
170#define VMM_MAX_CPU_COUNT 64
171
172/** @} */
173
174
175/** @defgroup grp_vbox_pci PCI Identifiers
176 * @{ */
177/** VirtualBox PCI vendor ID. */
178#define VBOX_PCI_VENDORID (0x80ee)
179
180/** @name VirtualBox graphics card identifiers
181 * @{ */
182#define VBOX_VENDORID VBOX_PCI_VENDORID /**< @todo wonderful choice of name! Please squeeze a _VGA_ or something in there, please. */
183#define VBOX_DEVICEID (0xbeef) /**< @todo ditto. */
184#define VBOX_VESA_VENDORID VBOX_PCI_VENDORID
185#define VBOX_VESA_DEVICEID (0xbeef)
186/** @} */
187
188/** @name VMMDev PCI card identifiers
189 * @{ */
190#define VMMDEV_VENDORID VBOX_PCI_VENDORID
191#define VMMDEV_DEVICEID (0xcafe)
192/** @} */
193
194/** @} */
195
196
197/** @defgroup grp_vbox_param_misc Misc
198 * @{ */
199
200/** The maximum size of a generic segment offload (GSO) frame. This limit is
201 * imposed by the 16-bit frame size in internal networking header. */
202#define VBOX_MAX_GSO_SIZE 0xfff0
203
204/** @} */
205
206
207/** @} */
208
209#endif /* !VBOX_INCLUDED_param_h */
210
Note: See TracBrowser for help on using the repository browser.

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