VirtualBox

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

Last change on this file since 90346 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 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-2020 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 maximum number of pages that can be allocated and mapped
43 * by various MM, PGM and SUP APIs. */
44#if ARCH_BITS == 64
45# define VBOX_MAX_ALLOC_PAGE_COUNT (_512M / PAGE_SIZE)
46#else
47# define VBOX_MAX_ALLOC_PAGE_COUNT (_256M / PAGE_SIZE)
48#endif
49
50/** @def VBOX_WITH_PAGE_SHARING
51 * Enables the page sharing code.
52 * @remarks This must match GMMR0Init; currently we only support page fusion on
53 * all 64-bit hosts except Mac OS X */
54#if ( HC_ARCH_BITS == 64 /* ASM-NOINC */ \
55 && (defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)) ) /* ASM-NOINC */ \
56 || defined(DOXYGEN_RUNNING) /* ASM-NOINC */
57# define VBOX_WITH_PAGE_SHARING /* ASM-NOINC */
58#endif /* ASM-NOINC */
59
60
61/** @defgroup grp_vbox_param_mm Memory Monitor Parameters
62 * @{
63 */
64/** Initial address of Hypervisor Memory Area.
65 * MUST BE PAGE TABLE ALIGNED! */
66#define MM_HYPER_AREA_ADDRESS UINT32_C(0xa0000000)
67
68/** The max size of the hypervisor memory area. */
69#define MM_HYPER_AREA_MAX_SIZE (40U * _1M) /**< @todo Readjust when floating RAMRANGEs have been implemented. Used to be 20 * _1MB */
70
71/** Maximum number of bytes we can dynamically map into the hypervisor region.
72 * This must be a power of 2 number of pages!
73 */
74#define MM_HYPER_DYNAMIC_SIZE (16U * PAGE_SIZE)
75
76/** The minimum guest RAM size in bytes. */
77#define MM_RAM_MIN UINT32_C(0x00400000)
78/** The maximum guest RAM size in bytes. */
79#if HC_ARCH_BITS == 64
80# define MM_RAM_MAX UINT64_C(0x20000000000)
81#else
82# define MM_RAM_MAX UINT64_C(0x000E0000000)
83#endif
84/** The minimum guest RAM size in MBs. */
85#define MM_RAM_MIN_IN_MB UINT32_C(4)
86/** The maximum guest RAM size in MBs. */
87#if HC_ARCH_BITS == 64
88# define MM_RAM_MAX_IN_MB UINT32_C(2097152)
89#else
90# define MM_RAM_MAX_IN_MB UINT32_C(3584)
91#endif
92/** The default size of the below 4GB RAM hole. */
93#define MM_RAM_HOLE_SIZE_DEFAULT (512U * _1M)
94/** The maximum 64-bit MMIO BAR size.
95 * @remarks There isn't really any limit here other than the size of the
96 * tracking structures we need (around 1/256 of the size). */
97#if HC_ARCH_BITS == 64
98# define MM_MMIO_64_MAX _1T
99#else
100# define MM_MMIO_64_MAX (_1G64 * 16)
101#endif
102/** The maximum 32-bit MMIO BAR size. */
103#define MM_MMIO_32_MAX _2G
104
105/** @} */
106
107
108/** @defgroup grp_vbox_param_pgm Page Manager Parameters
109 * @{
110 */
111/** The number of handy pages.
112 * This should be a power of two. */
113#define PGM_HANDY_PAGES 128
114/** The threshold at which allocation of more handy pages is flagged. */
115#define PGM_HANDY_PAGES_SET_FF 32
116/** The threshold at which we will allocate more when in ring-3.
117 * This is must be smaller than both PGM_HANDY_PAGES_SET_FF and
118 * PGM_HANDY_PAGES_MIN. */
119#define PGM_HANDY_PAGES_R3_ALLOC 8
120/** The threshold at which we will allocate more when in ring-0 or raw mode.
121 * The idea is that we should never go below this threshold while in ring-0 or
122 * raw mode because of PGM_HANDY_PAGES_RZ_TO_R3. However, should this happen and
123 * we are actually out of memory, we will have 8 page to get out of whatever
124 * code we're executing.
125 *
126 * This is must be smaller than both PGM_HANDY_PAGES_SET_FF and
127 * PGM_HANDY_PAGES_MIN. */
128#define PGM_HANDY_PAGES_RZ_ALLOC 8
129/** The threshold at which we force return to R3 ASAP.
130 * The idea is that this should be large enough to get out of any code and up to
131 * the main EM loop when we are out of memory.
132 * This must be less or equal to PGM_HANDY_PAGES_MIN. */
133#define PGM_HANDY_PAGES_RZ_TO_R3 24
134/** The minimum number of handy pages (after allocation).
135 * This must be greater or equal to PGM_HANDY_PAGES_SET_FF.
136 * Another name would be PGM_HANDY_PAGES_EXTRA_RESERVATION or _PARANOIA. :-) */
137#define PGM_HANDY_PAGES_MIN 32
138/** @} */
139
140
141/** @defgroup grp_vbox_param_vmm VMM Parameters
142 * @{
143 */
144/** VMM stack size. */
145#ifdef RT_OS_DARWIN
146# define VMM_STACK_SIZE 16384U
147#else
148# define VMM_STACK_SIZE 8192U
149#endif
150/** Min number of Virtual CPUs. */
151#define VMM_MIN_CPU_COUNT 1
152/** Max number of Virtual CPUs. */
153#define VMM_MAX_CPU_COUNT 64
154
155/** @} */
156
157
158/** @defgroup grp_vbox_pci PCI Identifiers
159 * @{ */
160/** VirtualBox PCI vendor ID. */
161#define VBOX_PCI_VENDORID (0x80ee)
162
163/** @name VirtualBox graphics card identifiers
164 * @{ */
165#define VBOX_VENDORID VBOX_PCI_VENDORID /**< @todo wonderful choice of name! Please squeeze a _VGA_ or something in there, please. */
166#define VBOX_DEVICEID (0xbeef) /**< @todo ditto. */
167#define VBOX_VESA_VENDORID VBOX_PCI_VENDORID
168#define VBOX_VESA_DEVICEID (0xbeef)
169/** @} */
170
171/** @name VMMDev PCI card identifiers
172 * @{ */
173#define VMMDEV_VENDORID VBOX_PCI_VENDORID
174#define VMMDEV_DEVICEID (0xcafe)
175/** @} */
176
177/** @} */
178
179
180/** @defgroup grp_vbox_param_misc Misc
181 * @{ */
182
183/** The maximum size of a generic segment offload (GSO) frame. This limit is
184 * imposed by the 16-bit frame size in internal networking header. */
185#define VBOX_MAX_GSO_SIZE 0xfff0
186
187/** @} */
188
189
190/** @} */
191
192#endif /* !VBOX_INCLUDED_param_h */
193
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