VirtualBox

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

Last change on this file since 46334 was 46300, checked in by vboxsync, 12 years ago

VMMDev: Fixed missing destructor call (not in function table, duh.) and integrated the testing output with RTTest.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.6 KB
Line 
1/* $Id: VMMDevState.h 46300 2013-05-28 15:31:18Z vboxsync $ */
2/** @file
3 * VMMDev - Guest <-> VMM/Host communication device, internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2013 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/vmm/pdmdev.h>
23#include <VBox/vmm/pdmifs.h>
24#ifndef VBOX_WITHOUT_TESTING_FEATURES
25# include <iprt/test.h>
26#endif
27
28#define VMMDEV_WITH_ALT_TIMESYNC
29
30typedef struct DISPLAYCHANGEINFO
31{
32 uint32_t xres;
33 uint32_t yres;
34 uint32_t bpp;
35 uint32_t display;
36 int32_t xOrigin;
37 int32_t yOrigin;
38 bool fEnabled;
39 bool fChangeOrigin;
40} DISPLAYCHANGEINFO;
41
42typedef struct DISPLAYCHANGEREQUEST
43{
44 bool fPending;
45 bool afAlignment[3];
46 DISPLAYCHANGEINFO displayChangeRequest;
47 DISPLAYCHANGEINFO lastReadDisplayChangeRequest;
48} DISPLAYCHANGEREQUEST;
49
50typedef struct DISPLAYCHANGEDATA
51{
52 /* Which monitor is being reported to the guest. */
53 int iCurrentMonitor;
54
55 /** true if the guest responded to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST at least once */
56 bool fGuestSentChangeEventAck;
57 bool afAlignment[3];
58
59 DISPLAYCHANGEREQUEST aRequests[64]; /// @todo maxMonitors
60} DISPLAYCHANGEDATA;
61
62
63/**
64 * Credentials for automatic guest logon and host configured logon (?).
65 *
66 * This is not stored in the same block as the instance data in order to make it
67 * harder to access.
68 */
69typedef struct VMMDEVCREDS
70{
71 /** credentials for guest logon purposes */
72 struct
73 {
74 char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
75 char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
76 char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
77 bool fAllowInteractiveLogon;
78 } Logon;
79
80 /** credentials for verification by guest */
81 struct
82 {
83 char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
84 char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
85 char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
86 } Judge;
87} VMMDEVCREDS;
88
89
90/**
91 * Facility status entry.
92 */
93typedef struct VMMDEVFACILITYSTATUSENTRY
94{
95 /** The facility, see VBoxGuestFacilityType. */
96 uint32_t uFacility;
97 /** The status, see VBoxGuestFacilityStatus. */
98 uint16_t uStatus;
99 /** Whether this entry is fixed and cannot be reused when inactive. */
100 bool fFixed;
101 /** Explicit alignment padding / reserved for future use. MBZ. */
102 bool fPadding;
103 /** The facility flags (yet to be defined). */
104 uint32_t fFlags;
105 /** Explicit alignment padding / reserved for future use. MBZ. */
106 uint32_t uPadding;
107 /** Last update timestamp. */
108 RTTIMESPEC TimeSpecTS;
109} VMMDEVFACILITYSTATUSENTRY;
110/** Pointer to a facility status entry. */
111typedef VMMDEVFACILITYSTATUSENTRY *PVMMDEVFACILITYSTATUSENTRY;
112
113
114/** device structure containing all state information */
115typedef struct VMMDevState
116{
117 /** The PCI device structure. */
118 PCIDevice PciDev;
119 /** The critical section for this device.
120 * @remarks We use this rather than the default one, it's simpler with all
121 * the driver interfaces where we have to waste time digging out the
122 * PDMDEVINS structure. */
123 PDMCRITSECT CritSect;
124
125 /** hypervisor address space size */
126 uint32_t hypervisorSize;
127
128 /** mouse capabilities of host and guest */
129 uint32_t mouseCapabilities;
130 /** absolute mouse position in pixels */
131 int32_t mouseXAbs;
132 int32_t mouseYAbs;
133 /** Does the guest currently want the host pointer to be shown? */
134 uint32_t fHostCursorRequested;
135
136 /** Alignment padding. */
137 uint32_t u32Alignment0;
138
139 /** Pointer to device instance. */
140 PPDMDEVINSR3 pDevIns;
141 /** LUN\#0 + Status: VMMDev port base interface. */
142 PDMIBASE IBase;
143 /** LUN\#0: VMMDev port interface. */
144 PDMIVMMDEVPORT IPort;
145#ifdef VBOX_WITH_HGCM
146 /** LUN\#0: HGCM port interface. */
147 PDMIHGCMPORT IHGCMPort;
148#endif
149 /** Pointer to base interface of the driver. */
150 R3PTRTYPE(PPDMIBASE) pDrvBase;
151 /** VMMDev connector interface */
152 R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
153#ifdef VBOX_WITH_HGCM
154 /** HGCM connector interface */
155 R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
156#endif
157 /** Alignment padding. */
158 RTR3PTR PtrR3Alignment1;
159 /** message buffer for backdoor logging. */
160 char szMsg[512];
161 /** message buffer index. */
162 uint32_t iMsg;
163 /** Alignment padding. */
164 uint32_t u32Alignment2;
165
166 /** IRQ number assigned to the device */
167 uint32_t irq;
168 /** Current host side event flags */
169 uint32_t u32HostEventFlags;
170 /** Mask of events guest is interested in.
171 * @note The HGCM events are enabled automatically by the VMMDev device when
172 * guest issues HGCM commands. */
173 uint32_t u32GuestFilterMask;
174 /** Delayed mask of guest events */
175 uint32_t u32NewGuestFilterMask;
176 /** Flag whether u32NewGuestFilterMask is valid */
177 bool fNewGuestFilterMask;
178 /** Alignment padding. */
179 bool afAlignment3[3];
180
181 /** GC physical address of VMMDev RAM area */
182 RTGCPHYS32 GCPhysVMMDevRAM;
183 /** R3 pointer to VMMDev RAM area */
184 R3PTRTYPE(VMMDevMemory *) pVMMDevRAMR3;
185
186 /** R3 pointer to VMMDev Heap RAM area
187 */
188 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
189 /** GC physical address of VMMDev Heap RAM area */
190 RTGCPHYS32 GCPhysVMMDevHeap;
191
192 /** Information reported by guest via VMMDevReportGuestInfo generic request.
193 * Until this information is reported the VMMDev refuses any other requests.
194 */
195 VBoxGuestInfo guestInfo;
196 /** Information report \#2, chewed a litte. */
197 struct
198 {
199 uint32_t uFullVersion; /**< non-zero if info is present. */
200 uint32_t uRevision;
201 uint32_t fFeatures;
202 char szName[128];
203 } guestInfo2;
204
205 /** Array of guest facility statuses. */
206 VMMDEVFACILITYSTATUSENTRY aFacilityStatuses[32];
207 /** The number of valid entries in the facility status array. */
208 uint32_t cFacilityStatuses;
209
210 /** Information reported by guest via VMMDevReportGuestCapabilities. */
211 uint32_t guestCaps;
212
213 /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
214 * if additions version is compatible. This flag is here to avoid repeated comparing
215 * of the version in guestInfo.
216 */
217 uint32_t fu32AdditionsOk;
218
219 /** Video acceleration status set by guest. */
220 uint32_t u32VideoAccelEnabled;
221
222 DISPLAYCHANGEDATA displayChangeData;
223
224 /** Pointer to the credentials. */
225 R3PTRTYPE(VMMDEVCREDS *) pCredentials;
226
227 bool afAlignment4[HC_ARCH_BITS == 32 ? 3 : 7];
228
229 /* memory balloon change request */
230 uint32_t cMbMemoryBalloon;
231 /** The last balloon size queried by the guest additions. */
232 uint32_t cMbMemoryBalloonLast;
233
234 /* guest ram size */
235 uint64_t cbGuestRAM;
236
237 /* unique session id; the id will be different after each start, reset or restore of the VM. */
238 uint64_t idSession;
239
240 /* statistics interval change request */
241 uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
242
243 /* seamless mode change request */
244 bool fLastSeamlessEnabled, fSeamlessEnabled;
245 bool afAlignment5[1];
246
247 bool fVRDPEnabled;
248 uint32_t uVRDPExperienceLevel;
249
250#ifdef VMMDEV_WITH_ALT_TIMESYNC
251 uint64_t hostTime;
252 bool fTimesyncBackdoorLo;
253 bool afAlignment6[3];
254#endif
255 /** Set if GetHostTime should fail.
256 * Loaded from the GetHostTimeDisabled configuration value. */
257 bool fGetHostTimeDisabled;
258
259 /** Set if backdoor logging should be disabled (output will be ignored then) */
260 bool fBackdoorLogDisabled;
261
262 /** Don't clear credentials */
263 bool fKeepCredentials;
264
265 /** Heap enabled. */
266 bool fHeapEnabled;
267
268 /** Guest Core Dumping enabled. */
269 bool fGuestCoreDumpEnabled;
270
271 /** Guest Core Dump location. */
272 char szGuestCoreDumpDir[RTPATH_MAX];
273
274 /** Number of additional cores to keep around. */
275 uint32_t cGuestCoreDumps;
276
277 bool afAlignment7[1];
278
279#ifdef VBOX_WITH_HGCM
280 /** List of pending HGCM requests, used for saving the HGCM state. */
281 R3PTRTYPE(PVBOXHGCMCMD) pHGCMCmdList;
282 /** Critical section to protect the list. */
283 RTCRITSECT critsectHGCMCmdList;
284 /** Whether the HGCM events are already automatically enabled. */
285 uint32_t u32HGCMEnabled;
286 /** Alignment padding. */
287 uint32_t u32Alignment7;
288#endif /* VBOX_WITH_HGCM */
289
290 /** Status LUN: Shared folders LED */
291 struct
292 {
293 /** The LED. */
294 PDMLED Led;
295 /** The LED ports. */
296 PDMILEDPORTS ILeds;
297 /** Partner of ILeds. */
298 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
299 } SharedFolders;
300
301 /** FLag whether CPU hotplug events are monitored */
302 bool fCpuHotPlugEventsEnabled;
303 /** Alignment padding. */
304 bool afPadding8[3];
305 /** CPU hotplug event */
306 VMMDevCpuEventType enmCpuHotPlugEvent;
307 /** Core id of the CPU to change */
308 uint32_t idCpuCore;
309 /** Package id of the CPU to change */
310 uint32_t idCpuPackage;
311
312 uint32_t StatMemBalloonChunks;
313
314 /** Set if RC/R0 is enabled. */
315 bool fRZEnabled;
316 /** Set if testing is enabled. */
317 bool fTestingEnabled;
318 /** Alignment padding. */
319 bool afPadding9[HC_ARCH_BITS == 32 ? 2 : 6];
320#ifndef VBOX_WITHOUT_TESTING_FEATURES
321 /** The high timestamp value. */
322 uint32_t u32TestingHighTimestamp;
323 /** The current testing command (VMMDEV_TESTING_CMD_XXX). */
324 uint32_t u32TestingCmd;
325 /** The testing data offset (command specific). */
326 uint32_t offTestingData;
327 /** For buffering the what comes in over the testing data port. */
328 union
329 {
330 char padding[1024];
331
332 /** VMMDEV_TESTING_CMD_INIT, VMMDEV_TESTING_CMD_SUB_NEW,
333 * VMMDEV_TESTING_CMD_FAILED. */
334 struct
335 {
336 char sz[1024];
337 } String, Init, SubNew, Failed;
338
339 /** VMMDEV_TESTING_CMD_TERM, VMMDEV_TESTING_CMD_SUB_DONE. */
340 struct
341 {
342 uint32_t c;
343 } Error, Term, SubDone;
344
345 /** VMMDEV_TESTING_CMD_VALUE. */
346 struct
347 {
348 RTUINT64U u64Value;
349 uint32_t u32Unit;
350 char szName[1024 - 8 - 4];
351 } Value;
352 } TestingData;
353 /** The XML output file name (can be a named pipe, doesn't matter to us). */
354 R3PTRTYPE(char *) pszTestingXmlOutput;
355 /** Testing instance for dealing with the output. */
356 RTTEST hTestingTest;
357#endif /* !VBOX_WITHOUT_TESTING_FEATURES */
358} VMMDevState;
359typedef VMMDevState VMMDEV;
360/** Pointer to the VMM device state. */
361typedef VMMDEV *PVMMDEV;
362AssertCompileMemberAlignment(VMMDEV, CritSect, 8);
363AssertCompileMemberAlignment(VMMDEV, cbGuestRAM, 8);
364AssertCompileMemberAlignment(VMMDEV, enmCpuHotPlugEvent, 4);
365AssertCompileMemberAlignment(VMMDEV, aFacilityStatuses, 8);
366#ifndef VBOX_WITHOUT_TESTING_FEATURES
367AssertCompileMemberAlignment(VMMDEV, TestingData.Value.u64Value, 8);
368#endif
369
370
371void VMMDevNotifyGuest(VMMDEV *pVMMDevState, uint32_t u32EventMask);
372void VMMDevCtlSetGuestFilterMask(VMMDEV *pVMMDevState, uint32_t u32OrMask, uint32_t u32NotMask);
373
374#endif /* !___VMMDev_VMMDevState_h */
375
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