VirtualBox

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

Last change on this file since 104384 was 98103, checked in by vboxsync, 22 months ago

Copyright year updates by scm.

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