VirtualBox

source: vbox/trunk/src/VBox/Devices/VMMDev/VMMDevState.h@ 30715

Last change on this file since 30715 was 30715, checked in by vboxsync, 14 years ago

VMMDev: Adding an optional (disabled by default) testing side to the device to assist simple guest benchmarks and tests. Started on a MMIO and IOPort benchmark (for comparison with network performance numbers).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.4 KB
Line 
1/* $Id: VMMDevState.h 30715 2010-07-07 16:22:33Z vboxsync $ */
2/** @file
3 * VMMDev - Guest <-> VMM/Host communication device, internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.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 ___VMMDev_VMMDevState_h
19#define ___VMMDev_VMMDevState_h
20
21#include <VBox/VMMDev.h>
22#include <VBox/pdmdev.h>
23#include <VBox/pdmifs.h>
24
25#define TIMESYNC_BACKDOOR
26
27typedef struct DISPLAYCHANGEINFO
28{
29 uint32_t xres;
30 uint32_t yres;
31 uint32_t bpp;
32 uint32_t display;
33} DISPLAYCHANGEINFO;
34
35typedef struct DISPLAYCHANGEREQUEST
36{
37 bool fPending;
38 DISPLAYCHANGEINFO displayChangeRequest;
39 DISPLAYCHANGEINFO lastReadDisplayChangeRequest;
40} DISPLAYCHANGEREQUEST;
41
42typedef struct DISPLAYCHANGEDATA
43{
44 /* Which monitor is being reported to the guest. */
45 int iCurrentMonitor;
46
47 /** true if the guest responded to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST at least once */
48 bool fGuestSentChangeEventAck;
49
50 DISPLAYCHANGEREQUEST aRequests[64]; // @todo maxMonitors
51} DISPLAYCHANGEDATA;
52
53
54/** device structure containing all state information */
55typedef struct VMMDevState
56{
57 /** The PCI device structure. */
58 PCIDevice dev;
59
60 /** The critical section for this device. */
61 PDMCRITSECT CritSect;
62
63 /** hypervisor address space size */
64 uint32_t hypervisorSize;
65
66 /** mouse capabilities of host and guest */
67 uint32_t mouseCapabilities;
68 /** absolute mouse position in pixels */
69 uint32_t mouseXAbs;
70 uint32_t mouseYAbs;
71 /** Does the guest currently want the host pointer to be shown? */
72 uint32_t fHostCursorRequested;
73
74 /** Pointer to device instance. */
75 PPDMDEVINSR3 pDevIns;
76 /** LUN\#0 + Status: VMMDev port base interface. */
77 PDMIBASE IBase;
78 /** LUN\#0: VMMDev port interface. */
79 PDMIVMMDEVPORT IPort;
80#ifdef VBOX_WITH_HGCM
81 /** LUN\#0: HGCM port interface. */
82 PDMIHGCMPORT IHGCMPort;
83#endif
84 /** Pointer to base interface of the driver. */
85 R3PTRTYPE(PPDMIBASE) pDrvBase;
86 /** VMMDev connector interface */
87 R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
88#ifdef VBOX_WITH_HGCM
89 /** HGCM connector interface */
90 R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
91#endif
92 /** message buffer for backdoor logging. */
93 char szMsg[512];
94 /** message buffer index. */
95 unsigned iMsg;
96 /** Base port in the assigned I/O space. */
97 RTIOPORT PortBase;
98
99 /** IRQ number assigned to the device */
100 uint32_t irq;
101 /** Current host side event flags */
102 uint32_t u32HostEventFlags;
103 /** Mask of events guest is interested in. Note that the HGCM events
104 * are enabled automatically by the VMMDev device when guest issues
105 * HGCM commands.
106 */
107 uint32_t u32GuestFilterMask;
108 /** Delayed mask of guest events */
109 uint32_t u32NewGuestFilterMask;
110 /** Flag whether u32NewGuestFilterMask is valid */
111 bool fNewGuestFilterMask;
112
113 /** R3 pointer to VMMDev RAM area */
114 R3PTRTYPE(VMMDevMemory *) pVMMDevRAMR3;
115 /** GC physical address of VMMDev RAM area */
116 RTGCPHYS32 GCPhysVMMDevRAM;
117
118 /** R3 pointer to VMMDev Heap RAM area
119 */
120 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
121 /** GC physical address of VMMDev Heap RAM area */
122 RTGCPHYS32 GCPhysVMMDevHeap;
123
124 /** Information reported by guest via VMMDevReportGuestInfo generic request.
125 * Until this information is reported the VMMDev refuses any other requests.
126 */
127 VBoxGuestInfo guestInfo;
128
129 /** Information reported by guest via VMMDevReportGuestCapabilities
130 */
131 uint32_t guestCaps;
132
133 /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
134 * if additions version is compatible. This flag is here to avoid repeated comparing
135 * of the version in guestInfo.
136 */
137 uint32_t fu32AdditionsOk;
138
139 /** Video acceleration status set by guest. */
140 uint32_t u32VideoAccelEnabled;
141
142 DISPLAYCHANGEDATA displayChangeData;
143
144 /** credentials for guest logon purposes */
145 struct
146 {
147 char szUserName[VMMDEV_CREDENTIALS_STRLEN];
148 char szPassword[VMMDEV_CREDENTIALS_STRLEN];
149 char szDomain[VMMDEV_CREDENTIALS_STRLEN];
150 bool fAllowInteractiveLogon;
151 } credentialsLogon;
152
153 /** credentials for verification by guest */
154 struct
155 {
156 char szUserName[VMMDEV_CREDENTIALS_STRLEN];
157 char szPassword[VMMDEV_CREDENTIALS_STRLEN];
158 char szDomain[VMMDEV_CREDENTIALS_STRLEN];
159 } credentialsJudge;
160
161 /* memory balloon change request */
162 uint32_t u32MemoryBalloonSize, u32LastMemoryBalloonSize;
163
164 /* guest ram size */
165 uint64_t cbGuestRAM;
166
167 /* unique session id; the id will be different after each start, reset or restore of the VM. */
168 uint64_t idSession;
169
170 /* statistics interval change request */
171 uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
172
173 /* seamless mode change request */
174 bool fLastSeamlessEnabled, fSeamlessEnabled;
175
176 bool fVRDPEnabled;
177 uint32_t u32VRDPExperienceLevel;
178
179#ifdef TIMESYNC_BACKDOOR
180 bool fTimesyncBackdoorLo;
181 uint64_t hostTime;
182#endif
183 /** Set if GetHostTime should fail.
184 * Loaded from the GetHostTimeDisabled configuration value. */
185 bool fGetHostTimeDisabled;
186
187 /** Set if backdoor logging should be disabled (output will be ignored then) */
188 bool fBackdoorLogDisabled;
189
190 /** Don't clear credentials */
191 bool fKeepCredentials;
192
193 /** Heap enabled. */
194 bool fHeapEnabled;
195
196#ifdef VBOX_WITH_HGCM
197 /** List of pending HGCM requests, used for saving the HGCM state. */
198 R3PTRTYPE(PVBOXHGCMCMD) pHGCMCmdList;
199 /** Critical section to protect the list. */
200 RTCRITSECT critsectHGCMCmdList;
201 /** Whether the HGCM events are already automatically enabled. */
202 uint32_t u32HGCMEnabled;
203#endif /* VBOX_WITH_HGCM */
204
205 /** Status LUN: Shared folders LED */
206 struct
207 {
208 /** The LED. */
209 PDMLED Led;
210 /** The LED ports. */
211 PDMILEDPORTS ILeds;
212 /** Partner of ILeds. */
213 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
214 } SharedFolders;
215
216 /** FLag whether CPU hotplug events are monitored */
217 bool fCpuHotPlugEventsEnabled;
218 /** CPU hotplug event */
219 VMMDevCpuEventType enmCpuHotPlugEvent;
220 /** Core id of the CPU to change */
221 uint32_t idCpuCore;
222 /** Package id of the CPU to changhe */
223 uint32_t idCpuPackage;
224
225 uint32_t StatMemBalloonChunks;
226
227 /** Set if RC/R0 is enabled. */
228 bool fRZEnabled;
229 /** Set if testing is enabled. */
230 bool fTestingEnabled;
231 /** The high timestamp value. */
232 uint32_t u32TestingHighTimestamp;
233
234} VMMDevState;
235AssertCompileMemberAlignment(VMMDevState, CritSect, 8);
236
237void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask);
238void VMMDevCtlSetGuestFilterMask (VMMDevState *pVMMDevState,
239 uint32_t u32OrMask,
240 uint32_t u32NotMask);
241
242#endif /* !___VMMDev_VMMDevState_h */
243
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