VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h@ 78039

Last change on this file since 78039 was 76568, checked in by vboxsync, 6 years ago

HostDrivers: Use VBOX_INCLUDED_SRC_ as header guard prefix with scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 57.0 KB
Line 
1/* $Id: SUPDrvIOC.h 76568 2019-01-01 04:34:11Z vboxsync $ */
2/** @file
3 * VirtualBox Support Driver - IOCtl definitions.
4 */
5
6/*
7 * Copyright (C) 2006-2019 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 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef VBOX_INCLUDED_SRC_Support_SUPDrvIOC_h
28#define VBOX_INCLUDED_SRC_Support_SUPDrvIOC_h
29#ifndef RT_WITHOUT_PRAGMA_ONCE
30# pragma once
31#endif
32
33#include <iprt/types.h>
34#include <VBox/sup.h>
35
36/*
37 * IOCtl numbers.
38 * We're using the Win32 type of numbers here, thus the macros below.
39 * The SUP_IOCTL_FLAG macro is used to separate requests from 32-bit
40 * and 64-bit processes.
41 */
42#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_SPARC64)
43# define SUP_IOCTL_FLAG 128
44#elif defined(RT_ARCH_X86) || defined(RT_ARCH_SPARC)
45# define SUP_IOCTL_FLAG 0
46#else
47# error "dunno which arch this is!"
48#endif
49
50#ifdef RT_OS_WINDOWS
51# ifndef CTL_CODE
52# include <iprt/win/windows.h>
53# endif
54 /* Automatic buffering, size not encoded. */
55# define SUP_CTL_CODE_SIZE(Function, Size) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_BUFFERED, FILE_WRITE_ACCESS)
56# define SUP_CTL_CODE_BIG(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_BUFFERED, FILE_WRITE_ACCESS)
57# define SUP_CTL_CODE_FAST(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_NEITHER, FILE_WRITE_ACCESS)
58# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
59
60# define SUP_NT_STATUS_BASE UINT32_C(0xe9860000) /**< STATUS_SEVERITY_ERROR + C-bit + facility 0x986. */
61# define SUP_NT_STATUS_IS_VBOX(a_rcNt) ( ((uint32_t)(a_rcNt) & 0xffff0000) == SUP_NT_STATUS_BASE )
62# define SUP_NT_STATUS_TO_VBOX(a_rcNt) ( (int)((uint32_t)(a_rcNt) | UINT32_C(0xffff0000)) )
63
64/** NT device name for system access. */
65# define SUPDRV_NT_DEVICE_NAME_SYS L"\\Device\\VBoxDrv"
66/** NT device name for user access. */
67# define SUPDRV_NT_DEVICE_NAME_USR L"\\Device\\VBoxDrvU"
68# ifdef VBOX_WITH_HARDENING
69/** NT device name for hardened stub access. */
70# define SUPDRV_NT_DEVICE_NAME_STUB L"\\Device\\VBoxDrvStub"
71/** NT device name for getting error information for failed VBoxDrv or
72 * VBoxDrvStub open. */
73# define SUPDRV_NT_DEVICE_NAME_ERROR_INFO L"\\Device\\VBoxDrvErrorInfo"
74# endif
75
76
77#elif defined(RT_OS_SOLARIS)
78 /* No automatic buffering, size limited to 255 bytes. */
79# include <sys/ioccom.h>
80# define SUP_CTL_CODE_SIZE(Function, Size) _IOWRN('V', (Function) | SUP_IOCTL_FLAG, sizeof(SUPREQHDR))
81# define SUP_CTL_CODE_BIG(Function) _IOWRN('V', (Function) | SUP_IOCTL_FLAG, sizeof(SUPREQHDR))
82# define SUP_CTL_CODE_FAST(Function) _IO( 'V', (Function) | SUP_IOCTL_FLAG)
83# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
84
85#elif defined(RT_OS_OS2)
86 /* No automatic buffering, size not encoded. */
87# define SUP_CTL_CATEGORY 0xc0
88# define SUP_CTL_CODE_SIZE(Function, Size) ((unsigned char)(Function))
89# define SUP_CTL_CODE_BIG(Function) ((unsigned char)(Function))
90# define SUP_CTL_CATEGORY_FAST 0xc1
91# define SUP_CTL_CODE_FAST(Function) ((unsigned char)(Function))
92# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
93
94#elif defined(RT_OS_LINUX)
95 /* No automatic buffering, size limited to 16KB. */
96# include <linux/ioctl.h>
97# define SUP_CTL_CODE_SIZE(Function, Size) _IOC(_IOC_READ | _IOC_WRITE, 'V', (Function) | SUP_IOCTL_FLAG, (Size))
98# define SUP_CTL_CODE_BIG(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
99# define SUP_CTL_CODE_FAST(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
100# define SUP_CTL_CODE_NO_SIZE(uIOCtl) ((uIOCtl) & ~IOCSIZE_MASK)
101
102#elif defined(RT_OS_L4)
103 /* Implemented in suplib, no worries. */
104# define SUP_CTL_CODE_SIZE(Function, Size) (Function)
105# define SUP_CTL_CODE_BIG(Function) (Function)
106# define SUP_CTL_CODE_FAST(Function) (Function)
107# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
108
109#else /* BSD Like */
110 /* Automatic buffering, size limited to 4KB on *BSD and 8KB on Darwin - commands the limit, 4KB. */
111# include <sys/ioccom.h>
112# define SUP_CTL_CODE_SIZE(Function, Size) _IOC(IOC_INOUT, 'V', (Function) | SUP_IOCTL_FLAG, (Size))
113# define SUP_CTL_CODE_BIG(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
114# define SUP_CTL_CODE_FAST(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
115# define SUP_CTL_CODE_NO_SIZE(uIOCtl) ( (uIOCtl) & ~_IOC(0,0,0,IOCPARM_MASK) )
116#endif
117
118/** @name Fast path I/O control codes.
119 * @note These must run parallel to SUP_VMMR0_DO_XXX
120 * @note Implementations ASSUMES up to 32 I/O controls codes in the fast range.
121 * @{ */
122/** Fast path IOCtl: VMMR0_DO_RAW_RUN */
123#define SUP_IOCTL_FAST_DO_RAW_RUN SUP_CTL_CODE_FAST(64)
124/** Fast path IOCtl: VMMR0_DO_HM_RUN */
125#define SUP_IOCTL_FAST_DO_HM_RUN SUP_CTL_CODE_FAST(65)
126/** Just a NOP call for profiling the latency of a fast ioctl call to VMMR0. */
127#define SUP_IOCTL_FAST_DO_NOP SUP_CTL_CODE_FAST(66)
128/** Fast path IOCtl: VMMR0_DO_NEM_RUN */
129#define SUP_IOCTL_FAST_DO_NEM_RUN SUP_CTL_CODE_FAST(67)
130/** First fast path IOCtl number. */
131#define SUP_IOCTL_FAST_DO_FIRST SUP_IOCTL_FAST_DO_RAW_RUN
132/** @} */
133
134
135#ifdef RT_OS_DARWIN
136/** Cookie used to fend off some unwanted clients to the IOService. */
137# define SUP_DARWIN_IOSERVICE_COOKIE 0x64726962 /* 'bird' */
138#endif
139
140
141/*******************************************************************************
142* Structures and Typedefs *
143*******************************************************************************/
144#ifdef RT_ARCH_AMD64
145# pragma pack(8) /* paranoia. */
146#else
147# pragma pack(4) /* paranoia. */
148#endif
149
150
151/**
152 * Common In/Out header.
153 */
154typedef struct SUPREQHDR
155{
156 /** Cookie. */
157 uint32_t u32Cookie;
158 /** Session cookie. */
159 uint32_t u32SessionCookie;
160 /** The size of the input. */
161 uint32_t cbIn;
162 /** The size of the output. */
163 uint32_t cbOut;
164 /** Flags. See SUPREQHDR_FLAGS_* for details and values. */
165 uint32_t fFlags;
166 /** The VBox status code of the operation, out direction only. */
167 int32_t rc;
168} SUPREQHDR;
169/** Pointer to a IOC header. */
170typedef SUPREQHDR *PSUPREQHDR;
171
172/** @name SUPREQHDR::fFlags values
173 * @{ */
174/** Masks out the magic value. */
175#define SUPREQHDR_FLAGS_MAGIC_MASK UINT32_C(0xff0000ff)
176/** The generic mask. */
177#define SUPREQHDR_FLAGS_GEN_MASK UINT32_C(0x0000ff00)
178/** The request specific mask. */
179#define SUPREQHDR_FLAGS_REQ_MASK UINT32_C(0x00ff0000)
180
181/** There is extra input that needs copying on some platforms. */
182#define SUPREQHDR_FLAGS_EXTRA_IN UINT32_C(0x00000100)
183/** There is extra output that needs copying on some platforms. */
184#define SUPREQHDR_FLAGS_EXTRA_OUT UINT32_C(0x00000200)
185
186/** The magic value. */
187#define SUPREQHDR_FLAGS_MAGIC UINT32_C(0x42000042)
188/** The default value. Use this when no special stuff is requested. */
189#define SUPREQHDR_FLAGS_DEFAULT SUPREQHDR_FLAGS_MAGIC
190/** @} */
191
192
193/** @name SUP_IOCTL_COOKIE
194 * @{
195 */
196/** Negotiate cookie. */
197#define SUP_IOCTL_COOKIE SUP_CTL_CODE_SIZE(1, SUP_IOCTL_COOKIE_SIZE)
198/** The request size. */
199#define SUP_IOCTL_COOKIE_SIZE sizeof(SUPCOOKIE)
200/** The SUPREQHDR::cbIn value. */
201#define SUP_IOCTL_COOKIE_SIZE_IN sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPCOOKIE, u.In)
202/** The SUPREQHDR::cbOut value. */
203#define SUP_IOCTL_COOKIE_SIZE_OUT sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPCOOKIE, u.Out)
204/** SUPCOOKIE_IN magic word. */
205#define SUPCOOKIE_MAGIC "The Magic Word!"
206/** The initial cookie. */
207#define SUPCOOKIE_INITIAL_COOKIE 0x69726f74 /* 'tori' */
208
209/** Current interface version.
210 * The upper 16-bit is the major version, the lower the minor version.
211 * When incompatible changes are made, the upper major number has to be changed.
212 *
213 * Update rules:
214 * -# Only update the major number when incompatible changes have been made to
215 * the IOC interface or the ABI provided via the functions returned by
216 * SUPQUERYFUNCS.
217 * -# When adding new features (new IOC number, new flags, new exports, ++)
218 * only update the minor number and change SUPLib.cpp to require the
219 * new IOC version.
220 * -# When incrementing the major number, clear the minor part and reset
221 * any IOC version requirements in SUPLib.cpp.
222 * -# When increment the major number, execute all pending work.
223 *
224 * @todo Pending work on next major version change:
225 * - Move SUP_IOCTL_FAST_DO_NOP and SUP_VMMR0_DO_NEM_RUN after NEM.
226 *
227 * @remarks 0x002a0000 is used by 5.1. The next version number must be 0x002b0000.
228 */
229#define SUPDRV_IOC_VERSION 0x00290008
230
231/** SUP_IOCTL_COOKIE. */
232typedef struct SUPCOOKIE
233{
234 /** The header.
235 * u32Cookie must be set to SUPCOOKIE_INITIAL_COOKIE.
236 * u32SessionCookie should be set to some random value. */
237 SUPREQHDR Hdr;
238 union
239 {
240 struct
241 {
242 /** Magic word. */
243 char szMagic[16];
244 /** The requested interface version number. */
245 uint32_t u32ReqVersion;
246 /** The minimum interface version number. */
247 uint32_t u32MinVersion;
248 } In;
249 struct
250 {
251 /** Cookie. */
252 uint32_t u32Cookie;
253 /** Session cookie. */
254 uint32_t u32SessionCookie;
255 /** Interface version for this session. */
256 uint32_t u32SessionVersion;
257 /** The actual interface version in the driver. */
258 uint32_t u32DriverVersion;
259 /** Number of functions available for the SUP_IOCTL_QUERY_FUNCS request. */
260 uint32_t cFunctions;
261 /** Session handle. */
262 R0PTRTYPE(PSUPDRVSESSION) pSession;
263 } Out;
264 } u;
265} SUPCOOKIE, *PSUPCOOKIE;
266/** @} */
267
268
269/** @name SUP_IOCTL_QUERY_FUNCS
270 * Query SUPR0 functions.
271 * @{
272 */
273#define SUP_IOCTL_QUERY_FUNCS(cFuncs) SUP_CTL_CODE_BIG(2)
274#define SUP_IOCTL_QUERY_FUNCS_SIZE(cFuncs) RT_UOFFSETOF_DYN(SUPQUERYFUNCS, u.Out.aFunctions[(cFuncs)])
275#define SUP_IOCTL_QUERY_FUNCS_SIZE_IN sizeof(SUPREQHDR)
276#define SUP_IOCTL_QUERY_FUNCS_SIZE_OUT(cFuncs) SUP_IOCTL_QUERY_FUNCS_SIZE(cFuncs)
277
278/** A function. */
279typedef struct SUPFUNC
280{
281 /** Name - mangled. */
282 char szName[32];
283 /** Address. */
284 RTR0PTR pfn;
285} SUPFUNC, *PSUPFUNC;
286
287typedef struct SUPQUERYFUNCS
288{
289 /** The header. */
290 SUPREQHDR Hdr;
291 union
292 {
293 struct
294 {
295 /** Number of functions returned. */
296 uint32_t cFunctions;
297 /** Array of functions. */
298 SUPFUNC aFunctions[1];
299 } Out;
300 } u;
301} SUPQUERYFUNCS, *PSUPQUERYFUNCS;
302/** @} */
303
304
305/** @name SUP_IOCTL_LDR_OPEN
306 * Open an image.
307 * @{
308 */
309#define SUP_IOCTL_LDR_OPEN SUP_CTL_CODE_SIZE(3, SUP_IOCTL_LDR_OPEN_SIZE)
310#define SUP_IOCTL_LDR_OPEN_SIZE sizeof(SUPLDROPEN)
311#define SUP_IOCTL_LDR_OPEN_SIZE_IN sizeof(SUPLDROPEN)
312#define SUP_IOCTL_LDR_OPEN_SIZE_OUT (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPLDROPEN, u.Out))
313typedef struct SUPLDROPEN
314{
315 /** The header. */
316 SUPREQHDR Hdr;
317 union
318 {
319 struct
320 {
321 /** Size of the image we'll be loading (including tables). */
322 uint32_t cbImageWithTabs;
323 /** The size of the image bits. (Less or equal to cbImageWithTabs.) */
324 uint32_t cbImageBits;
325 /** Image name.
326 * This is the NAME of the image, not the file name. It is used
327 * to share code with other processes. (Max len is 32 chars!) */
328 char szName[32];
329 /** Image file name.
330 * This can be used to load the image using a native loader. */
331 char szFilename[260];
332 } In;
333 struct
334 {
335 /** The base address of the image. */
336 RTR0PTR pvImageBase;
337 /** Indicate whether or not the image requires loading. */
338 bool fNeedsLoading;
339 /** Indicates that we're using the native ring-0 loader. */
340 bool fNativeLoader;
341 } Out;
342 } u;
343} SUPLDROPEN, *PSUPLDROPEN;
344/** @} */
345
346
347/** @name SUP_IOCTL_LDR_LOAD
348 * Upload the image bits.
349 * @{
350 */
351#define SUP_IOCTL_LDR_LOAD SUP_CTL_CODE_BIG(4)
352#define SUP_IOCTL_LDR_LOAD_SIZE(cbImage) RT_MAX(RT_UOFFSETOF_DYN(SUPLDRLOAD, u.In.abImage[cbImage]), SUP_IOCTL_LDR_LOAD_SIZE_OUT)
353#define SUP_IOCTL_LDR_LOAD_SIZE_IN(cbImage) RT_UOFFSETOF_DYN(SUPLDRLOAD, u.In.abImage[cbImage])
354#define SUP_IOCTL_LDR_LOAD_SIZE_OUT (RT_UOFFSETOF(SUPLDRLOAD, u.Out.szError) + RT_SIZEOFMEMB(SUPLDRLOAD, u.Out.szError))
355
356/**
357 * Module initialization callback function.
358 * This is called once after the module has been loaded.
359 *
360 * @returns 0 on success.
361 * @returns Appropriate error code on failure.
362 * @param hMod Image handle for use in APIs.
363 */
364typedef DECLCALLBACK(int) FNR0MODULEINIT(void *hMod);
365/** Pointer to a FNR0MODULEINIT(). */
366typedef R0PTRTYPE(FNR0MODULEINIT *) PFNR0MODULEINIT;
367
368/**
369 * Module termination callback function.
370 * This is called once right before the module is being unloaded.
371 *
372 * @param hMod Image handle for use in APIs.
373 */
374typedef DECLCALLBACK(void) FNR0MODULETERM(void *hMod);
375/** Pointer to a FNR0MODULETERM(). */
376typedef R0PTRTYPE(FNR0MODULETERM *) PFNR0MODULETERM;
377
378/**
379 * Symbol table entry.
380 */
381typedef struct SUPLDRSYM
382{
383 /** Offset into of the string table. */
384 uint32_t offName;
385 /** Offset of the symbol relative to the image load address.
386 * @remarks When used inside the SUPDrv to calculate real addresses, it
387 * must be cast to int32_t for the sake of native loader support
388 * on Solaris. (The loader puts the and data in different
389 * memory areans, and the text one is generally higher.) */
390 uint32_t offSymbol;
391} SUPLDRSYM;
392/** Pointer to a symbol table entry. */
393typedef SUPLDRSYM *PSUPLDRSYM;
394/** Pointer to a const symbol table entry. */
395typedef SUPLDRSYM const *PCSUPLDRSYM;
396
397/**
398 * SUPLDRLOAD::u::In::EP type.
399 */
400typedef enum SUPLDRLOADEP
401{
402 SUPLDRLOADEP_NOTHING = 0,
403 SUPLDRLOADEP_VMMR0,
404 SUPLDRLOADEP_SERVICE,
405 SUPLDRLOADEP_32BIT_HACK = 0x7fffffff
406} SUPLDRLOADEP;
407
408typedef struct SUPLDRLOAD
409{
410 /** The header. */
411 SUPREQHDR Hdr;
412 union
413 {
414 struct
415 {
416 /** The address of module initialization function. Similar to _DLL_InitTerm(hmod, 0). */
417 RTR0PTR pfnModuleInit;
418 /** The address of module termination function. Similar to _DLL_InitTerm(hmod, 1). */
419 RTR0PTR pfnModuleTerm;
420 /** Special entry points. */
421 union
422 {
423 /** SUPLDRLOADEP_VMMR0. */
424 struct
425 {
426 /** The module handle (i.e. address). */
427 RTR0PTR pvVMMR0;
428 /** Address of VMMR0EntryFast function. */
429 RTR0PTR pvVMMR0EntryFast;
430 /** Address of VMMR0EntryEx function. */
431 RTR0PTR pvVMMR0EntryEx;
432 } VMMR0;
433 /** SUPLDRLOADEP_SERVICE. */
434 struct
435 {
436 /** The service request handler.
437 * (PFNR0SERVICEREQHANDLER isn't defined yet.) */
438 RTR0PTR pfnServiceReq;
439 /** Reserved, must be NIL. */
440 RTR0PTR apvReserved[3];
441 } Service;
442 } EP;
443 /** Address. */
444 RTR0PTR pvImageBase;
445 /** Entry point type. */
446 SUPLDRLOADEP eEPType;
447 /** The size of the image bits (starting at offset 0 and
448 * approaching offSymbols). */
449 uint32_t cbImageBits;
450 /** The offset of the symbol table. */
451 uint32_t offSymbols;
452 /** The number of entries in the symbol table. */
453 uint32_t cSymbols;
454 /** The offset of the string table. */
455 uint32_t offStrTab;
456 /** Size of the string table. */
457 uint32_t cbStrTab;
458 /** Size of image data in achImage. */
459 uint32_t cbImageWithTabs;
460 /** The image data. */
461 uint8_t abImage[1];
462 } In;
463 struct
464 {
465 /** Magic value indicating whether extended error information is
466 * present or not (SUPLDRLOAD_ERROR_MAGIC). */
467 uint64_t uErrorMagic;
468 /** Extended error information. */
469 char szError[2048];
470 } Out;
471 } u;
472} SUPLDRLOAD, *PSUPLDRLOAD;
473/** Magic value that indicates that there is a valid error information string
474 * present on SUP_IOCTL_LDR_LOAD failure.
475 * @remarks The value is choosen to be an unlikely init and term address. */
476#define SUPLDRLOAD_ERROR_MAGIC UINT64_C(0xabcdefef0feddcb9)
477/** @} */
478
479
480/** @name SUP_IOCTL_LDR_FREE
481 * Free an image.
482 * @{
483 */
484#define SUP_IOCTL_LDR_FREE SUP_CTL_CODE_SIZE(5, SUP_IOCTL_LDR_FREE_SIZE)
485#define SUP_IOCTL_LDR_FREE_SIZE sizeof(SUPLDRFREE)
486#define SUP_IOCTL_LDR_FREE_SIZE_IN sizeof(SUPLDRFREE)
487#define SUP_IOCTL_LDR_FREE_SIZE_OUT sizeof(SUPREQHDR)
488typedef struct SUPLDRFREE
489{
490 /** The header. */
491 SUPREQHDR Hdr;
492 union
493 {
494 struct
495 {
496 /** Address. */
497 RTR0PTR pvImageBase;
498 } In;
499 } u;
500} SUPLDRFREE, *PSUPLDRFREE;
501/** @} */
502
503
504/** @name SUP_IOCTL_LDR_LOCK_DOWN
505 * Lock down the image loader interface.
506 * @{
507 */
508#define SUP_IOCTL_LDR_LOCK_DOWN SUP_CTL_CODE_SIZE(38, SUP_IOCTL_LDR_LOCK_DOWN_SIZE)
509#define SUP_IOCTL_LDR_LOCK_DOWN_SIZE sizeof(SUPREQHDR)
510#define SUP_IOCTL_LDR_LOCK_DOWN_SIZE_IN sizeof(SUPREQHDR)
511#define SUP_IOCTL_LDR_LOCK_DOWN_SIZE_OUT sizeof(SUPREQHDR)
512/** @} */
513
514
515/** @name SUP_IOCTL_LDR_GET_SYMBOL
516 * Get address of a symbol within an image.
517 * @{
518 */
519#define SUP_IOCTL_LDR_GET_SYMBOL SUP_CTL_CODE_SIZE(6, SUP_IOCTL_LDR_GET_SYMBOL_SIZE)
520#define SUP_IOCTL_LDR_GET_SYMBOL_SIZE sizeof(SUPLDRGETSYMBOL)
521#define SUP_IOCTL_LDR_GET_SYMBOL_SIZE_IN sizeof(SUPLDRGETSYMBOL)
522#define SUP_IOCTL_LDR_GET_SYMBOL_SIZE_OUT (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPLDRGETSYMBOL, u.Out))
523typedef struct SUPLDRGETSYMBOL
524{
525 /** The header. */
526 SUPREQHDR Hdr;
527 union
528 {
529 struct
530 {
531 /** Address. */
532 RTR0PTR pvImageBase;
533 /** The symbol name. */
534 char szSymbol[64];
535 } In;
536 struct
537 {
538 /** The symbol address. */
539 RTR0PTR pvSymbol;
540 } Out;
541 } u;
542} SUPLDRGETSYMBOL, *PSUPLDRGETSYMBOL;
543/** @} */
544
545
546/** @name SUP_IOCTL_CALL_VMMR0
547 * Call the R0 VMM Entry point.
548 * @{
549 */
550#define SUP_IOCTL_CALL_VMMR0(cbReq) SUP_CTL_CODE_SIZE(7, SUP_IOCTL_CALL_VMMR0_SIZE(cbReq))
551#define SUP_IOCTL_CALL_VMMR0_NO_SIZE() SUP_CTL_CODE_SIZE(7, 0)
552#define SUP_IOCTL_CALL_VMMR0_SIZE(cbReq) RT_UOFFSETOF_DYN(SUPCALLVMMR0, abReqPkt[cbReq])
553#define SUP_IOCTL_CALL_VMMR0_SIZE_IN(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
554#define SUP_IOCTL_CALL_VMMR0_SIZE_OUT(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
555typedef struct SUPCALLVMMR0
556{
557 /** The header. */
558 SUPREQHDR Hdr;
559 union
560 {
561 struct
562 {
563 /** The VM handle. */
564 PVMR0 pVMR0;
565 /** VCPU id. */
566 uint32_t idCpu;
567 /** Which operation to execute. */
568 uint32_t uOperation;
569 /** Argument to use when no request packet is supplied. */
570 uint64_t u64Arg;
571 } In;
572 } u;
573 /** The VMMR0Entry request packet. */
574 uint8_t abReqPkt[1];
575} SUPCALLVMMR0, *PSUPCALLVMMR0;
576/** @} */
577
578
579/** @name SUP_IOCTL_CALL_VMMR0_BIG
580 * Version of SUP_IOCTL_CALL_VMMR0 for dealing with large requests.
581 * @{
582 */
583#define SUP_IOCTL_CALL_VMMR0_BIG SUP_CTL_CODE_BIG(27)
584#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE(cbReq) RT_UOFFSETOF_DYN(SUPCALLVMMR0, abReqPkt[cbReq])
585#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE_IN(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
586#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE_OUT(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
587/** @} */
588
589
590/** @name SUP_IOCTL_LOW_ALLOC
591 * Allocate memory below 4GB (physically).
592 * @{
593 */
594#define SUP_IOCTL_LOW_ALLOC SUP_CTL_CODE_BIG(8)
595#define SUP_IOCTL_LOW_ALLOC_SIZE(cPages) ((uint32_t)RT_UOFFSETOF_DYN(SUPLOWALLOC, u.Out.aPages[cPages]))
596#define SUP_IOCTL_LOW_ALLOC_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPLOWALLOC, u.In))
597#define SUP_IOCTL_LOW_ALLOC_SIZE_OUT(cPages) SUP_IOCTL_LOW_ALLOC_SIZE(cPages)
598typedef struct SUPLOWALLOC
599{
600 /** The header. */
601 SUPREQHDR Hdr;
602 union
603 {
604 struct
605 {
606 /** Number of pages to allocate. */
607 uint32_t cPages;
608 } In;
609 struct
610 {
611 /** The ring-3 address of the allocated memory. */
612 RTR3PTR pvR3;
613 /** The ring-0 address of the allocated memory. */
614 RTR0PTR pvR0;
615 /** Array of pages. */
616 RTHCPHYS aPages[1];
617 } Out;
618 } u;
619} SUPLOWALLOC, *PSUPLOWALLOC;
620/** @} */
621
622
623/** @name SUP_IOCTL_LOW_FREE
624 * Free low memory.
625 * @{
626 */
627#define SUP_IOCTL_LOW_FREE SUP_CTL_CODE_SIZE(9, SUP_IOCTL_LOW_FREE_SIZE)
628#define SUP_IOCTL_LOW_FREE_SIZE sizeof(SUPLOWFREE)
629#define SUP_IOCTL_LOW_FREE_SIZE_IN sizeof(SUPLOWFREE)
630#define SUP_IOCTL_LOW_FREE_SIZE_OUT sizeof(SUPREQHDR)
631typedef struct SUPLOWFREE
632{
633 /** The header. */
634 SUPREQHDR Hdr;
635 union
636 {
637 struct
638 {
639 /** The ring-3 address of the memory to free. */
640 RTR3PTR pvR3;
641 } In;
642 } u;
643} SUPLOWFREE, *PSUPLOWFREE;
644/** @} */
645
646
647/** @name SUP_IOCTL_PAGE_ALLOC_EX
648 * Allocate memory and map it into kernel and/or user space. The memory is of
649 * course locked. The result should be freed using SUP_IOCTL_PAGE_FREE.
650 *
651 * @remarks Allocations without a kernel mapping may fail with
652 * VERR_NOT_SUPPORTED on some platforms.
653 *
654 * @{
655 */
656#define SUP_IOCTL_PAGE_ALLOC_EX SUP_CTL_CODE_BIG(10)
657#define SUP_IOCTL_PAGE_ALLOC_EX_SIZE(cPages) RT_UOFFSETOF_DYN(SUPPAGEALLOCEX, u.Out.aPages[cPages])
658#define SUP_IOCTL_PAGE_ALLOC_EX_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPPAGEALLOCEX, u.In))
659#define SUP_IOCTL_PAGE_ALLOC_EX_SIZE_OUT(cPages) SUP_IOCTL_PAGE_ALLOC_EX_SIZE(cPages)
660typedef struct SUPPAGEALLOCEX
661{
662 /** The header. */
663 SUPREQHDR Hdr;
664 union
665 {
666 struct
667 {
668 /** Number of pages to allocate */
669 uint32_t cPages;
670 /** Whether it should have kernel mapping. */
671 bool fKernelMapping;
672 /** Whether it should have a user mapping. */
673 bool fUserMapping;
674 /** Reserved. Must be false. */
675 bool fReserved0;
676 /** Reserved. Must be false. */
677 bool fReserved1;
678 } In;
679 struct
680 {
681 /** Returned ring-3 address. */
682 RTR3PTR pvR3;
683 /** Returned ring-0 address. */
684 RTR0PTR pvR0;
685 /** The physical addresses of the allocated pages. */
686 RTHCPHYS aPages[1];
687 } Out;
688 } u;
689} SUPPAGEALLOCEX, *PSUPPAGEALLOCEX;
690/** @} */
691
692
693/** @name SUP_IOCTL_PAGE_MAP_KERNEL
694 * Maps a portion of memory allocated by SUP_IOCTL_PAGE_ALLOC_EX /
695 * SUPR0PageAllocEx into kernel space for use by a device or similar.
696 *
697 * The mapping will be freed together with the ring-3 mapping when
698 * SUP_IOCTL_PAGE_FREE or SUPR0PageFree is called.
699 *
700 * @remarks Not necessarily supported on all platforms.
701 *
702 * @{
703 */
704#define SUP_IOCTL_PAGE_MAP_KERNEL SUP_CTL_CODE_SIZE(11, SUP_IOCTL_PAGE_MAP_KERNEL_SIZE)
705#define SUP_IOCTL_PAGE_MAP_KERNEL_SIZE sizeof(SUPPAGEMAPKERNEL)
706#define SUP_IOCTL_PAGE_MAP_KERNEL_SIZE_IN sizeof(SUPPAGEMAPKERNEL)
707#define SUP_IOCTL_PAGE_MAP_KERNEL_SIZE_OUT sizeof(SUPPAGEMAPKERNEL)
708typedef struct SUPPAGEMAPKERNEL
709{
710 /** The header. */
711 SUPREQHDR Hdr;
712 union
713 {
714 struct
715 {
716 /** The pointer of to the previously allocated memory. */
717 RTR3PTR pvR3;
718 /** The offset to start mapping from. */
719 uint32_t offSub;
720 /** Size of the section to map. */
721 uint32_t cbSub;
722 /** Flags reserved for future fun. */
723 uint32_t fFlags;
724 } In;
725 struct
726 {
727 /** The ring-0 address corresponding to pvR3 + offSub. */
728 RTR0PTR pvR0;
729 } Out;
730 } u;
731} SUPPAGEMAPKERNEL, *PSUPPAGEMAPKERNEL;
732/** @} */
733
734
735/** @name SUP_IOCTL_PAGE_PROTECT
736 * Changes the page level protection of the user and/or kernel mappings of
737 * memory previously allocated by SUPR0PageAllocEx.
738 *
739 * @remarks Not necessarily supported on all platforms.
740 *
741 * @{
742 */
743#define SUP_IOCTL_PAGE_PROTECT SUP_CTL_CODE_SIZE(12, SUP_IOCTL_PAGE_PROTECT_SIZE)
744#define SUP_IOCTL_PAGE_PROTECT_SIZE sizeof(SUPPAGEPROTECT)
745#define SUP_IOCTL_PAGE_PROTECT_SIZE_IN sizeof(SUPPAGEPROTECT)
746#define SUP_IOCTL_PAGE_PROTECT_SIZE_OUT sizeof(SUPPAGEPROTECT)
747typedef struct SUPPAGEPROTECT
748{
749 /** The header. */
750 SUPREQHDR Hdr;
751 union
752 {
753 struct
754 {
755 /** The pointer of to the previously allocated memory.
756 * Pass NIL_RTR3PTR if the ring-0 mapping should remain unaffected. */
757 RTR3PTR pvR3;
758 /** The pointer of to the previously allocated memory.
759 * Pass NIL_RTR0PTR if the ring-0 mapping should remain unaffected. */
760 RTR0PTR pvR0;
761 /** The offset to start changing protection at. */
762 uint32_t offSub;
763 /** Size of the portion that should be changed. */
764 uint32_t cbSub;
765 /** Protection flags, RTMEM_PROT_*. */
766 uint32_t fProt;
767 } In;
768 } u;
769} SUPPAGEPROTECT, *PSUPPAGEPROTECT;
770/** @} */
771
772
773/** @name SUP_IOCTL_PAGE_FREE
774 * Free memory allocated with SUP_IOCTL_PAGE_ALLOC_EX.
775 * @{
776 */
777#define SUP_IOCTL_PAGE_FREE SUP_CTL_CODE_SIZE(13, SUP_IOCTL_PAGE_FREE_SIZE_IN)
778#define SUP_IOCTL_PAGE_FREE_SIZE sizeof(SUPPAGEFREE)
779#define SUP_IOCTL_PAGE_FREE_SIZE_IN sizeof(SUPPAGEFREE)
780#define SUP_IOCTL_PAGE_FREE_SIZE_OUT sizeof(SUPREQHDR)
781typedef struct SUPPAGEFREE
782{
783 /** The header. */
784 SUPREQHDR Hdr;
785 union
786 {
787 struct
788 {
789 /** Address of memory range to free. */
790 RTR3PTR pvR3;
791 } In;
792 } u;
793} SUPPAGEFREE, *PSUPPAGEFREE;
794/** @} */
795
796
797
798
799/** @name SUP_IOCTL_PAGE_LOCK
800 * Pin down physical pages.
801 * @{
802 */
803#define SUP_IOCTL_PAGE_LOCK SUP_CTL_CODE_BIG(14)
804#define SUP_IOCTL_PAGE_LOCK_SIZE(cPages) (RT_MAX((size_t)SUP_IOCTL_PAGE_LOCK_SIZE_IN, (size_t)SUP_IOCTL_PAGE_LOCK_SIZE_OUT(cPages)))
805#define SUP_IOCTL_PAGE_LOCK_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPPAGELOCK, u.In))
806#define SUP_IOCTL_PAGE_LOCK_SIZE_OUT(cPages) RT_UOFFSETOF_DYN(SUPPAGELOCK, u.Out.aPages[cPages])
807typedef struct SUPPAGELOCK
808{
809 /** The header. */
810 SUPREQHDR Hdr;
811 union
812 {
813 struct
814 {
815 /** Start of page range. Must be PAGE aligned. */
816 RTR3PTR pvR3;
817 /** The range size given as a page count. */
818 uint32_t cPages;
819 } In;
820
821 struct
822 {
823 /** Array of pages. */
824 RTHCPHYS aPages[1];
825 } Out;
826 } u;
827} SUPPAGELOCK, *PSUPPAGELOCK;
828/** @} */
829
830
831/** @name SUP_IOCTL_PAGE_UNLOCK
832 * Unpin physical pages.
833 * @{ */
834#define SUP_IOCTL_PAGE_UNLOCK SUP_CTL_CODE_SIZE(15, SUP_IOCTL_PAGE_UNLOCK_SIZE)
835#define SUP_IOCTL_PAGE_UNLOCK_SIZE sizeof(SUPPAGEUNLOCK)
836#define SUP_IOCTL_PAGE_UNLOCK_SIZE_IN sizeof(SUPPAGEUNLOCK)
837#define SUP_IOCTL_PAGE_UNLOCK_SIZE_OUT sizeof(SUPREQHDR)
838typedef struct SUPPAGEUNLOCK
839{
840 /** The header. */
841 SUPREQHDR Hdr;
842 union
843 {
844 struct
845 {
846 /** Start of page range of a range previously pinned. */
847 RTR3PTR pvR3;
848 } In;
849 } u;
850} SUPPAGEUNLOCK, *PSUPPAGEUNLOCK;
851/** @} */
852
853
854/** @name SUP_IOCTL_CONT_ALLOC
855 * Allocate continuous memory.
856 * @{
857 */
858#define SUP_IOCTL_CONT_ALLOC SUP_CTL_CODE_SIZE(16, SUP_IOCTL_CONT_ALLOC_SIZE)
859#define SUP_IOCTL_CONT_ALLOC_SIZE sizeof(SUPCONTALLOC)
860#define SUP_IOCTL_CONT_ALLOC_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPCONTALLOC, u.In))
861#define SUP_IOCTL_CONT_ALLOC_SIZE_OUT sizeof(SUPCONTALLOC)
862typedef struct SUPCONTALLOC
863{
864 /** The header. */
865 SUPREQHDR Hdr;
866 union
867 {
868 struct
869 {
870 /** The allocation size given as a page count. */
871 uint32_t cPages;
872 } In;
873
874 struct
875 {
876 /** The address of the ring-0 mapping of the allocated memory. */
877 RTR0PTR pvR0;
878 /** The address of the ring-3 mapping of the allocated memory. */
879 RTR3PTR pvR3;
880 /** The physical address of the allocation. */
881 RTHCPHYS HCPhys;
882 } Out;
883 } u;
884} SUPCONTALLOC, *PSUPCONTALLOC;
885/** @} */
886
887
888/** @name SUP_IOCTL_CONT_FREE Input.
889 * @{
890 */
891/** Free continuous memory. */
892#define SUP_IOCTL_CONT_FREE SUP_CTL_CODE_SIZE(17, SUP_IOCTL_CONT_FREE_SIZE)
893#define SUP_IOCTL_CONT_FREE_SIZE sizeof(SUPCONTFREE)
894#define SUP_IOCTL_CONT_FREE_SIZE_IN sizeof(SUPCONTFREE)
895#define SUP_IOCTL_CONT_FREE_SIZE_OUT sizeof(SUPREQHDR)
896typedef struct SUPCONTFREE
897{
898 /** The header. */
899 SUPREQHDR Hdr;
900 union
901 {
902 struct
903 {
904 /** The ring-3 address of the memory to free. */
905 RTR3PTR pvR3;
906 } In;
907 } u;
908} SUPCONTFREE, *PSUPCONTFREE;
909/** @} */
910
911
912/** @name SUP_IOCTL_GET_PAGING_MODE
913 * Get the host paging mode.
914 * @{
915 */
916#define SUP_IOCTL_GET_PAGING_MODE SUP_CTL_CODE_SIZE(18, SUP_IOCTL_GET_PAGING_MODE_SIZE)
917#define SUP_IOCTL_GET_PAGING_MODE_SIZE sizeof(SUPGETPAGINGMODE)
918#define SUP_IOCTL_GET_PAGING_MODE_SIZE_IN sizeof(SUPREQHDR)
919#define SUP_IOCTL_GET_PAGING_MODE_SIZE_OUT sizeof(SUPGETPAGINGMODE)
920typedef struct SUPGETPAGINGMODE
921{
922 /** The header. */
923 SUPREQHDR Hdr;
924 union
925 {
926 struct
927 {
928 /** The paging mode. */
929 SUPPAGINGMODE enmMode;
930 } Out;
931 } u;
932} SUPGETPAGINGMODE, *PSUPGETPAGINGMODE;
933/** @} */
934
935
936/** @name SUP_IOCTL_SET_VM_FOR_FAST
937 * Set the VM handle for doing fast call ioctl calls.
938 * @{
939 */
940#define SUP_IOCTL_SET_VM_FOR_FAST SUP_CTL_CODE_SIZE(19, SUP_IOCTL_SET_VM_FOR_FAST_SIZE)
941#define SUP_IOCTL_SET_VM_FOR_FAST_SIZE sizeof(SUPSETVMFORFAST)
942#define SUP_IOCTL_SET_VM_FOR_FAST_SIZE_IN sizeof(SUPSETVMFORFAST)
943#define SUP_IOCTL_SET_VM_FOR_FAST_SIZE_OUT sizeof(SUPREQHDR)
944typedef struct SUPSETVMFORFAST
945{
946 /** The header. */
947 SUPREQHDR Hdr;
948 union
949 {
950 struct
951 {
952 /** The ring-0 VM handle (pointer). */
953 PVMR0 pVMR0;
954 } In;
955 } u;
956} SUPSETVMFORFAST, *PSUPSETVMFORFAST;
957/** @} */
958
959
960/** @name SUP_IOCTL_GIP_MAP
961 * Map the GIP into user space.
962 * @{
963 */
964#define SUP_IOCTL_GIP_MAP SUP_CTL_CODE_SIZE(20, SUP_IOCTL_GIP_MAP_SIZE)
965#define SUP_IOCTL_GIP_MAP_SIZE sizeof(SUPGIPMAP)
966#define SUP_IOCTL_GIP_MAP_SIZE_IN sizeof(SUPREQHDR)
967#define SUP_IOCTL_GIP_MAP_SIZE_OUT sizeof(SUPGIPMAP)
968typedef struct SUPGIPMAP
969{
970 /** The header. */
971 SUPREQHDR Hdr;
972 union
973 {
974 struct
975 {
976 /** The physical address of the GIP. */
977 RTHCPHYS HCPhysGip;
978 /** Pointer to the read-only usermode GIP mapping for this session. */
979 R3PTRTYPE(PSUPGLOBALINFOPAGE) pGipR3;
980 /** Pointer to the supervisor mode GIP mapping. */
981 R0PTRTYPE(PSUPGLOBALINFOPAGE) pGipR0;
982 } Out;
983 } u;
984} SUPGIPMAP, *PSUPGIPMAP;
985/** @} */
986
987
988/** @name SUP_IOCTL_GIP_UNMAP
989 * Unmap the GIP.
990 * @{
991 */
992#define SUP_IOCTL_GIP_UNMAP SUP_CTL_CODE_SIZE(21, SUP_IOCTL_GIP_UNMAP_SIZE)
993#define SUP_IOCTL_GIP_UNMAP_SIZE sizeof(SUPGIPUNMAP)
994#define SUP_IOCTL_GIP_UNMAP_SIZE_IN sizeof(SUPGIPUNMAP)
995#define SUP_IOCTL_GIP_UNMAP_SIZE_OUT sizeof(SUPGIPUNMAP)
996typedef struct SUPGIPUNMAP
997{
998 /** The header. */
999 SUPREQHDR Hdr;
1000} SUPGIPUNMAP, *PSUPGIPUNMAP;
1001/** @} */
1002
1003
1004/** @name SUP_IOCTL_CALL_SERVICE
1005 * Call the a ring-0 service.
1006 *
1007 * @todo Might have to convert this to a big request, just like
1008 * SUP_IOCTL_CALL_VMMR0
1009 * @{
1010 */
1011#define SUP_IOCTL_CALL_SERVICE(cbReq) SUP_CTL_CODE_SIZE(22, SUP_IOCTL_CALL_SERVICE_SIZE(cbReq))
1012#define SUP_IOCTL_CALL_SERVICE_NO_SIZE() SUP_CTL_CODE_SIZE(22, 0)
1013#define SUP_IOCTL_CALL_SERVICE_SIZE(cbReq) RT_UOFFSETOF_DYN(SUPCALLSERVICE, abReqPkt[cbReq])
1014#define SUP_IOCTL_CALL_SERVICE_SIZE_IN(cbReq) SUP_IOCTL_CALL_SERVICE_SIZE(cbReq)
1015#define SUP_IOCTL_CALL_SERVICE_SIZE_OUT(cbReq) SUP_IOCTL_CALL_SERVICE_SIZE(cbReq)
1016typedef struct SUPCALLSERVICE
1017{
1018 /** The header. */
1019 SUPREQHDR Hdr;
1020 union
1021 {
1022 struct
1023 {
1024 /** The service name. */
1025 char szName[28];
1026 /** Which operation to execute. */
1027 uint32_t uOperation;
1028 /** Argument to use when no request packet is supplied. */
1029 uint64_t u64Arg;
1030 } In;
1031 } u;
1032 /** The request packet passed to SUP. */
1033 uint8_t abReqPkt[1];
1034} SUPCALLSERVICE, *PSUPCALLSERVICE;
1035/** @} */
1036
1037
1038/** @name SUP_IOCTL_LOGGER_SETTINGS
1039 * Changes the ring-0 release or debug logger settings.
1040 * @{
1041 */
1042#define SUP_IOCTL_LOGGER_SETTINGS(cbStrTab) SUP_CTL_CODE_SIZE(23, SUP_IOCTL_LOGGER_SETTINGS_SIZE(cbStrTab))
1043#define SUP_IOCTL_LOGGER_SETTINGS_NO_SIZE() SUP_CTL_CODE_SIZE(23, 0)
1044#define SUP_IOCTL_LOGGER_SETTINGS_SIZE(cbStrTab) RT_UOFFSETOF_DYN(SUPLOGGERSETTINGS, u.In.szStrings[cbStrTab])
1045#define SUP_IOCTL_LOGGER_SETTINGS_SIZE_IN(cbStrTab) RT_UOFFSETOF_DYN(SUPLOGGERSETTINGS, u.In.szStrings[cbStrTab])
1046#define SUP_IOCTL_LOGGER_SETTINGS_SIZE_OUT sizeof(SUPREQHDR)
1047typedef struct SUPLOGGERSETTINGS
1048{
1049 /** The header. */
1050 SUPREQHDR Hdr;
1051 union
1052 {
1053 struct
1054 {
1055 /** Which logger. */
1056 uint32_t fWhich;
1057 /** What to do with it. */
1058 uint32_t fWhat;
1059 /** Offset of the flags setting string. */
1060 uint32_t offFlags;
1061 /** Offset of the groups setting string. */
1062 uint32_t offGroups;
1063 /** Offset of the destination setting string. */
1064 uint32_t offDestination;
1065 /** The string table. */
1066 char szStrings[1];
1067 } In;
1068 } u;
1069} SUPLOGGERSETTINGS, *PSUPLOGGERSETTINGS;
1070
1071/** Debug logger. */
1072#define SUPLOGGERSETTINGS_WHICH_DEBUG 0
1073/** Release logger. */
1074#define SUPLOGGERSETTINGS_WHICH_RELEASE 1
1075
1076/** Change the settings. */
1077#define SUPLOGGERSETTINGS_WHAT_SETTINGS 0
1078/** Create the logger instance. */
1079#define SUPLOGGERSETTINGS_WHAT_CREATE 1
1080/** Destroy the logger instance. */
1081#define SUPLOGGERSETTINGS_WHAT_DESTROY 2
1082
1083/** @} */
1084
1085
1086/** @name Semaphore Types
1087 * @{ */
1088#define SUP_SEM_TYPE_EVENT 0
1089#define SUP_SEM_TYPE_EVENT_MULTI 1
1090/** @} */
1091
1092
1093/** @name SUP_IOCTL_SEM_OP2
1094 * Semaphore operations.
1095 * @remarks This replaces the old SUP_IOCTL_SEM_OP interface.
1096 * @{
1097 */
1098#define SUP_IOCTL_SEM_OP2 SUP_CTL_CODE_SIZE(24, SUP_IOCTL_SEM_OP2_SIZE)
1099#define SUP_IOCTL_SEM_OP2_SIZE sizeof(SUPSEMOP2)
1100#define SUP_IOCTL_SEM_OP2_SIZE_IN sizeof(SUPSEMOP2)
1101#define SUP_IOCTL_SEM_OP2_SIZE_OUT sizeof(SUPREQHDR)
1102typedef struct SUPSEMOP2
1103{
1104 /** The header. */
1105 SUPREQHDR Hdr;
1106 union
1107 {
1108 struct
1109 {
1110 /** The semaphore type. */
1111 uint32_t uType;
1112 /** The semaphore handle. */
1113 uint32_t hSem;
1114 /** The operation. */
1115 uint32_t uOp;
1116 /** Reserved, must be zero. */
1117 uint32_t uReserved;
1118 /** The number of milliseconds to wait if it's a wait operation. */
1119 union
1120 {
1121 /** Absolute timeout (RTTime[System]NanoTS).
1122 * Used by SUPSEMOP2_WAIT_NS_ABS. */
1123 uint64_t uAbsNsTimeout;
1124 /** Relative nanosecond timeout.
1125 * Used by SUPSEMOP2_WAIT_NS_REL. */
1126 uint64_t cRelNsTimeout;
1127 /** Relative millisecond timeout.
1128 * Used by SUPSEMOP2_WAIT_MS_REL. */
1129 uint32_t cRelMsTimeout;
1130 /** Generic 64-bit accessor.
1131 * ASSUMES little endian! */
1132 uint64_t u64;
1133 } uArg;
1134 } In;
1135 } u;
1136} SUPSEMOP2, *PSUPSEMOP2;
1137
1138/** Wait for a number of milliseconds. */
1139#define SUPSEMOP2_WAIT_MS_REL 0
1140/** Wait until the specified deadline is reached. */
1141#define SUPSEMOP2_WAIT_NS_ABS 1
1142/** Wait for a number of nanoseconds. */
1143#define SUPSEMOP2_WAIT_NS_REL 2
1144/** Signal the semaphore. */
1145#define SUPSEMOP2_SIGNAL 3
1146/** Reset the semaphore (only applicable to SUP_SEM_TYPE_EVENT_MULTI). */
1147#define SUPSEMOP2_RESET 4
1148/** Close the semaphore handle. */
1149#define SUPSEMOP2_CLOSE 5
1150/** @} */
1151
1152
1153/** @name SUP_IOCTL_SEM_OP3
1154 * Semaphore operations.
1155 * @{
1156 */
1157#define SUP_IOCTL_SEM_OP3 SUP_CTL_CODE_SIZE(25, SUP_IOCTL_SEM_OP3_SIZE)
1158#define SUP_IOCTL_SEM_OP3_SIZE sizeof(SUPSEMOP3)
1159#define SUP_IOCTL_SEM_OP3_SIZE_IN sizeof(SUPSEMOP3)
1160#define SUP_IOCTL_SEM_OP3_SIZE_OUT sizeof(SUPSEMOP3)
1161typedef struct SUPSEMOP3
1162{
1163 /** The header. */
1164 SUPREQHDR Hdr;
1165 union
1166 {
1167 struct
1168 {
1169 /** The semaphore type. */
1170 uint32_t uType;
1171 /** The semaphore handle. */
1172 uint32_t hSem;
1173 /** The operation. */
1174 uint32_t uOp;
1175 /** Reserved, must be zero. */
1176 uint32_t u32Reserved;
1177 /** Reserved for future use. */
1178 uint64_t u64Reserved;
1179 } In;
1180 union
1181 {
1182 /** The handle of the created semaphore.
1183 * Used by SUPSEMOP3_CREATE. */
1184 uint32_t hSem;
1185 /** The semaphore resolution in nano seconds.
1186 * Used by SUPSEMOP3_GET_RESOLUTION. */
1187 uint32_t cNsResolution;
1188 /** The 32-bit view. */
1189 uint32_t u32;
1190 /** Reserved some space for later expansion. */
1191 uint64_t u64Reserved;
1192 } Out;
1193 } u;
1194} SUPSEMOP3, *PSUPSEMOP3;
1195
1196/** Get the wait resolution. */
1197#define SUPSEMOP3_CREATE 0
1198/** Get the wait resolution. */
1199#define SUPSEMOP3_GET_RESOLUTION 1
1200/** @} */
1201
1202
1203/** @name SUP_IOCTL_VT_CAPS
1204 * Get the VT-x/AMD-V capabilities.
1205 *
1206 * @todo Intended for main, which means we need to relax the privilege requires
1207 * when accessing certain vboxdrv functions.
1208 *
1209 * @{
1210 */
1211#define SUP_IOCTL_VT_CAPS SUP_CTL_CODE_SIZE(26, SUP_IOCTL_VT_CAPS_SIZE)
1212#define SUP_IOCTL_VT_CAPS_SIZE sizeof(SUPVTCAPS)
1213#define SUP_IOCTL_VT_CAPS_SIZE_IN sizeof(SUPREQHDR)
1214#define SUP_IOCTL_VT_CAPS_SIZE_OUT sizeof(SUPVTCAPS)
1215typedef struct SUPVTCAPS
1216{
1217 /** The header. */
1218 SUPREQHDR Hdr;
1219 union
1220 {
1221 struct
1222 {
1223 /** The VT capability dword. */
1224 uint32_t fCaps;
1225 } Out;
1226 } u;
1227} SUPVTCAPS, *PSUPVTCAPS;
1228/** @} */
1229
1230
1231/** @name SUP_IOCTL_TRACER_OPEN
1232 * Open the tracer.
1233 *
1234 * Should be matched by an SUP_IOCTL_TRACER_CLOSE call.
1235 *
1236 * @{
1237 */
1238#define SUP_IOCTL_TRACER_OPEN SUP_CTL_CODE_SIZE(28, SUP_IOCTL_TRACER_OPEN_SIZE)
1239#define SUP_IOCTL_TRACER_OPEN_SIZE sizeof(SUPTRACEROPEN)
1240#define SUP_IOCTL_TRACER_OPEN_SIZE_IN sizeof(SUPTRACEROPEN)
1241#define SUP_IOCTL_TRACER_OPEN_SIZE_OUT sizeof(SUPREQHDR)
1242typedef struct SUPTRACEROPEN
1243{
1244 /** The header. */
1245 SUPREQHDR Hdr;
1246 union
1247 {
1248 struct
1249 {
1250 /** Tracer cookie. Used to make sure we only open a matching tracer. */
1251 uint32_t uCookie;
1252 /** Tracer specific argument. */
1253 RTHCUINTPTR uArg;
1254 } In;
1255 } u;
1256} SUPTRACEROPEN, *PSUPTRACEROPEN;
1257/** @} */
1258
1259
1260/** @name SUP_IOCTL_TRACER_CLOSE
1261 * Close the tracer.
1262 *
1263 * Must match a SUP_IOCTL_TRACER_OPEN call.
1264 *
1265 * @{
1266 */
1267#define SUP_IOCTL_TRACER_CLOSE SUP_CTL_CODE_SIZE(29, SUP_IOCTL_TRACER_CLOSE_SIZE)
1268#define SUP_IOCTL_TRACER_CLOSE_SIZE sizeof(SUPREQHDR)
1269#define SUP_IOCTL_TRACER_CLOSE_SIZE_IN sizeof(SUPREQHDR)
1270#define SUP_IOCTL_TRACER_CLOSE_SIZE_OUT sizeof(SUPREQHDR)
1271/** @} */
1272
1273
1274/** @name SUP_IOCTL_TRACER_IOCTL
1275 * Speak UNIX ioctl() with the tracer.
1276 *
1277 * The session must have opened the tracer prior to issuing this request.
1278 *
1279 * @{
1280 */
1281#define SUP_IOCTL_TRACER_IOCTL SUP_CTL_CODE_SIZE(30, SUP_IOCTL_TRACER_IOCTL_SIZE)
1282#define SUP_IOCTL_TRACER_IOCTL_SIZE sizeof(SUPTRACERIOCTL)
1283#define SUP_IOCTL_TRACER_IOCTL_SIZE_IN sizeof(SUPTRACERIOCTL)
1284#define SUP_IOCTL_TRACER_IOCTL_SIZE_OUT (RT_UOFFSETOF(SUPTRACERIOCTL, u.Out.iRetVal) + sizeof(int32_t))
1285typedef struct SUPTRACERIOCTL
1286{
1287 /** The header. */
1288 SUPREQHDR Hdr;
1289 union
1290 {
1291 struct
1292 {
1293 /** The command. */
1294 RTHCUINTPTR uCmd;
1295 /** Argument to the command. */
1296 RTHCUINTPTR uArg;
1297 } In;
1298
1299 struct
1300 {
1301 /** The return value. */
1302 int32_t iRetVal;
1303 } Out;
1304 } u;
1305} SUPTRACERIOCTL, *PSUPTRACERIOCTL;
1306/** @} */
1307
1308
1309/** @name SUP_IOCTL_TRACER_UMOD_REG
1310 * Registers tracepoints in a user mode module.
1311 *
1312 * @{
1313 */
1314#define SUP_IOCTL_TRACER_UMOD_REG SUP_CTL_CODE_SIZE(31, SUP_IOCTL_TRACER_UMOD_REG_SIZE)
1315#define SUP_IOCTL_TRACER_UMOD_REG_SIZE sizeof(SUPTRACERUMODREG)
1316#define SUP_IOCTL_TRACER_UMOD_REG_SIZE_IN sizeof(SUPTRACERUMODREG)
1317#define SUP_IOCTL_TRACER_UMOD_REG_SIZE_OUT sizeof(SUPREQHDR)
1318typedef struct SUPTRACERUMODREG
1319{
1320 /** The header. */
1321 SUPREQHDR Hdr;
1322 union
1323 {
1324 struct
1325 {
1326 /** The address at which the VTG header actually resides.
1327 * This will differ from R3PtrVtgHdr for raw-mode context
1328 * modules. */
1329 RTUINTPTR uVtgHdrAddr;
1330 /** The ring-3 pointer of the VTG header. */
1331 RTR3PTR R3PtrVtgHdr;
1332 /** The ring-3 pointer of the probe location string table. */
1333 RTR3PTR R3PtrStrTab;
1334 /** The size of the string table. */
1335 uint32_t cbStrTab;
1336 /** Future flags, MBZ. */
1337 uint32_t fFlags;
1338 /** The module name. */
1339 char szName[64];
1340 } In;
1341 } u;
1342} SUPTRACERUMODREG, *PSUPTRACERUMODREG;
1343/** @} */
1344
1345
1346/** @name SUP_IOCTL_TRACER_UMOD_DEREG
1347 * Deregisters tracepoints in a user mode module.
1348 *
1349 * @{
1350 */
1351#define SUP_IOCTL_TRACER_UMOD_DEREG SUP_CTL_CODE_SIZE(32, SUP_IOCTL_TRACER_UMOD_DEREG_SIZE)
1352#define SUP_IOCTL_TRACER_UMOD_DEREG_SIZE sizeof(SUPTRACERUMODDEREG)
1353#define SUP_IOCTL_TRACER_UMOD_DEREG_SIZE_IN sizeof(SUPTRACERUMODDEREG)
1354#define SUP_IOCTL_TRACER_UMOD_DEREG_SIZE_OUT sizeof(SUPREQHDR)
1355typedef struct SUPTRACERUMODDEREG
1356{
1357 /** The header. */
1358 SUPREQHDR Hdr;
1359 union
1360 {
1361 struct
1362 {
1363 /** Pointer to the VTG header. */
1364 RTR3PTR pVtgHdr;
1365 } In;
1366 } u;
1367} SUPTRACERUMODDEREG, *PSUPTRACERUMODDEREG;
1368/** @} */
1369
1370
1371/** @name SUP_IOCTL_TRACER_UMOD_FIRE_PROBE
1372 * Fire a probe in a user tracepoint module.
1373 *
1374 * @{
1375 */
1376#define SUP_IOCTL_TRACER_UMOD_FIRE_PROBE SUP_CTL_CODE_SIZE(33, SUP_IOCTL_TRACER_UMOD_FIRE_PROBE_SIZE)
1377#define SUP_IOCTL_TRACER_UMOD_FIRE_PROBE_SIZE sizeof(SUPTRACERUMODFIREPROBE)
1378#define SUP_IOCTL_TRACER_UMOD_FIRE_PROBE_SIZE_IN sizeof(SUPTRACERUMODFIREPROBE)
1379#define SUP_IOCTL_TRACER_UMOD_FIRE_PROBE_SIZE_OUT sizeof(SUPREQHDR)
1380typedef struct SUPTRACERUMODFIREPROBE
1381{
1382 /** The header. */
1383 SUPREQHDR Hdr;
1384 union
1385 {
1386 SUPDRVTRACERUSRCTX In;
1387 } u;
1388} SUPTRACERUMODFIREPROBE, *PSUPTRACERUMODFIREPROBE;
1389/** @} */
1390
1391
1392/** @name SUP_IOCTL_MSR_PROBER
1393 * MSR probing interface, not available in normal builds.
1394 *
1395 * @{
1396 */
1397#define SUP_IOCTL_MSR_PROBER SUP_CTL_CODE_SIZE(34, SUP_IOCTL_MSR_PROBER_SIZE)
1398#define SUP_IOCTL_MSR_PROBER_SIZE sizeof(SUPMSRPROBER)
1399#define SUP_IOCTL_MSR_PROBER_SIZE_IN sizeof(SUPMSRPROBER)
1400#define SUP_IOCTL_MSR_PROBER_SIZE_OUT sizeof(SUPMSRPROBER)
1401
1402typedef enum SUPMSRPROBEROP
1403{
1404 SUPMSRPROBEROP_INVALID = 0, /**< The customary invalid zero value. */
1405 SUPMSRPROBEROP_READ, /**< Read an MSR. */
1406 SUPMSRPROBEROP_WRITE, /**< Write a value to an MSR (use with care!). */
1407 SUPMSRPROBEROP_MODIFY, /**< Read-modify-restore-flushall. */
1408 SUPMSRPROBEROP_MODIFY_FASTER, /**< Read-modify-restore, skip the flushing. */
1409 SUPMSRPROBEROP_END, /**< End of valid values. */
1410 SUPMSRPROBEROP_32BIT_HACK = 0x7fffffff /**< The customary 32-bit type hack. */
1411} SUPMSRPROBEROP;
1412
1413typedef struct SUPMSRPROBER
1414{
1415 /** The header. */
1416 SUPREQHDR Hdr;
1417
1418 /** Input/output union. */
1419 union
1420 {
1421 /** Inputs. */
1422 struct
1423 {
1424 /** The operation. */
1425 SUPMSRPROBEROP enmOp;
1426 /** The MSR to test. */
1427 uint32_t uMsr;
1428 /** The CPU to perform the operation on.
1429 * Use UINT32_MAX to indicate that any CPU will do. */
1430 uint32_t idCpu;
1431 /** Alignment padding. */
1432 uint32_t u32Padding;
1433 /** Operation specific arguments. */
1434 union
1435 {
1436 /* SUPMSRPROBEROP_READ takes no extra arguments. */
1437
1438 /** For SUPMSRPROBEROP_WRITE. */
1439 struct
1440 {
1441 /** The value to write. */
1442 uint64_t uToWrite;
1443 } Write;
1444
1445 /** For SUPMSRPROBEROP_MODIFY and SUPMSRPROBEROP_MODIFY_FASTER. */
1446 struct
1447 {
1448 /** The value to AND the current MSR value with to construct the value to
1449 * write. This applied first. */
1450 uint64_t fAndMask;
1451 /** The value to OR the result of the above mentioned AND operation with
1452 * attempting to modify the MSR. */
1453 uint64_t fOrMask;
1454 } Modify;
1455
1456 /** Reserve space for the future. */
1457 uint64_t auPadding[3];
1458 } uArgs;
1459 } In;
1460
1461 /** Outputs. */
1462 struct
1463 {
1464 /** Operation specific results. */
1465 union
1466 {
1467 /** For SUPMSRPROBEROP_READ. */
1468 struct
1469 {
1470 /** The value we've read. */
1471 uint64_t uValue;
1472 /** Set if we GPed while reading it. */
1473 bool fGp;
1474 } Read;
1475
1476 /** For SUPMSRPROBEROP_WRITE. */
1477 struct
1478 {
1479 /** Set if we GPed while writing it. */
1480 bool fGp;
1481 } Write;
1482
1483 /** For SUPMSRPROBEROP_MODIFY and SUPMSRPROBEROP_MODIFY_FASTER. */
1484 SUPMSRPROBERMODIFYRESULT Modify;
1485
1486 /** Size padding/aligning. */
1487 uint64_t auPadding[5];
1488 } uResults;
1489 } Out;
1490 } u;
1491} SUPMSRPROBER, *PSUPMSRPROBER;
1492AssertCompileMemberAlignment(SUPMSRPROBER, u, 8);
1493AssertCompileMemberAlignment(SUPMSRPROBER, u.In.uArgs, 8);
1494AssertCompileMembersSameSizeAndOffset(SUPMSRPROBER, u.In, SUPMSRPROBER, u.Out);
1495/** @} */
1496
1497/** @name SUP_IOCTL_RESUME_SUSPENDED_KBDS
1498 * Resume suspended keyboard devices if any found in the system.
1499 *
1500 * @{
1501 */
1502#define SUP_IOCTL_RESUME_SUSPENDED_KBDS SUP_CTL_CODE_SIZE(35, SUP_IOCTL_RESUME_SUSPENDED_KBDS_SIZE)
1503#define SUP_IOCTL_RESUME_SUSPENDED_KBDS_SIZE sizeof(SUPREQHDR)
1504#define SUP_IOCTL_RESUME_SUSPENDED_KBDS_SIZE_IN sizeof(SUPREQHDR)
1505#define SUP_IOCTL_RESUME_SUSPENDED_KBDS_SIZE_OUT sizeof(SUPREQHDR)
1506/** @} */
1507
1508
1509/** @name SUP_IOCTL_TSC_DELTA_MEASURE
1510 * Measure the TSC-delta between the specified CPU and the master TSC.
1511 *
1512 * To call this I/O control, the client must first have mapped the GIP.
1513 *
1514 * @{
1515 */
1516#define SUP_IOCTL_TSC_DELTA_MEASURE SUP_CTL_CODE_SIZE(36, SUP_IOCTL_TSC_DELTA_MEASURE_SIZE)
1517#define SUP_IOCTL_TSC_DELTA_MEASURE_SIZE sizeof(SUPTSCDELTAMEASURE)
1518#define SUP_IOCTL_TSC_DELTA_MEASURE_SIZE_IN sizeof(SUPTSCDELTAMEASURE)
1519#define SUP_IOCTL_TSC_DELTA_MEASURE_SIZE_OUT sizeof(SUPREQHDR)
1520typedef struct SUPTSCDELTAMEASURE
1521{
1522 /** The header. */
1523 SUPREQHDR Hdr;
1524
1525 /** Input/output union. */
1526 union
1527 {
1528 struct
1529 {
1530 /** Which CPU to take the TSC-delta measurement for. */
1531 RTCPUID idCpu;
1532 /** Number of times to retry on failure (specify 0 for default). */
1533 uint8_t cRetries;
1534 /** Number of milliseconds to wait before each retry. */
1535 uint8_t cMsWaitRetry;
1536 /** Whether to force taking a measurement if one exists already. */
1537 bool fForce;
1538 /** Whether to do the measurement asynchronously (if possible). */
1539 bool fAsync;
1540 } In;
1541 } u;
1542} SUPTSCDELTAMEASURE, *PSUPTSCDELTAMEASURE;
1543AssertCompileMemberAlignment(SUPTSCDELTAMEASURE, u, 8);
1544AssertCompileSize(SUPTSCDELTAMEASURE, 6*4 + 4+1+1+1+1);
1545/** @} */
1546
1547
1548/** @name SUP_IOCTL_TSC_READ
1549 * Reads the TSC and apply TSC-delta if applicable, determining the delta if
1550 * necessary (i64TSCDelta = INT64_MAX).
1551 *
1552 * This latter function is the primary use case of this I/O control. To call
1553 * this I/O control, the client must first have mapped the GIP.
1554 *
1555 * @{
1556 */
1557#define SUP_IOCTL_TSC_READ SUP_CTL_CODE_SIZE(37, SUP_IOCTL_TSC_READ_SIZE)
1558#define SUP_IOCTL_TSC_READ_SIZE sizeof(SUPTSCREAD)
1559#define SUP_IOCTL_TSC_READ_SIZE_IN sizeof(SUPREQHDR)
1560#define SUP_IOCTL_TSC_READ_SIZE_OUT sizeof(SUPTSCREAD)
1561typedef struct SUPTSCREAD
1562{
1563 /** The header. */
1564 SUPREQHDR Hdr;
1565
1566 /** Input/output union. */
1567 union
1568 {
1569 struct
1570 {
1571 /** The TSC after applying the relevant delta. */
1572 uint64_t u64AdjustedTsc;
1573 /** The APIC Id of the CPU where the TSC was read. */
1574 uint16_t idApic;
1575 /** Explicit alignment padding. */
1576 uint16_t auPadding[3];
1577 } Out;
1578 } u;
1579} SUPTSCREAD, *PSUPTSCREAD;
1580AssertCompileMemberAlignment(SUPTSCREAD, u, 8);
1581AssertCompileSize(SUPTSCREAD, 6*4 + 2*8);
1582/** @} */
1583
1584
1585/** @name SUP_IOCTL_GIP_SET_FLAGS
1586 * Set GIP flags.
1587 *
1588 * @{
1589 */
1590#define SUP_IOCTL_GIP_SET_FLAGS SUP_CTL_CODE_SIZE(39, SUP_IOCTL_GIP_SET_FLAGS_SIZE)
1591#define SUP_IOCTL_GIP_SET_FLAGS_SIZE sizeof(SUPGIPSETFLAGS)
1592#define SUP_IOCTL_GIP_SET_FLAGS_SIZE_IN sizeof(SUPGIPSETFLAGS)
1593#define SUP_IOCTL_GIP_SET_FLAGS_SIZE_OUT sizeof(SUPREQHDR)
1594typedef struct SUPGIPSETFLAGS
1595{
1596 /** The header. */
1597 SUPREQHDR Hdr;
1598 union
1599 {
1600 struct
1601 {
1602 /** The AND flags mask, see SUPGIP_FLAGS_XXX. */
1603 uint32_t fAndMask;
1604 /** The OR flags mask, see SUPGIP_FLAGS_XXX. */
1605 uint32_t fOrMask;
1606 } In;
1607 } u;
1608} SUPGIPSETFLAGS, *PSUPGIPSETFLAGS;
1609/** @} */
1610
1611
1612/** @name SUP_IOCTL_UCODE_REV
1613 * Get the CPU microcode revision.
1614 *
1615 * @{
1616 */
1617#define SUP_IOCTL_UCODE_REV SUP_CTL_CODE_SIZE(40, SUP_IOCTL_UCODE_REV_SIZE)
1618#define SUP_IOCTL_UCODE_REV_SIZE sizeof(SUPUCODEREV)
1619#define SUP_IOCTL_UCODE_REV_SIZE_IN sizeof(SUPREQHDR)
1620#define SUP_IOCTL_UCODE_REV_SIZE_OUT sizeof(SUPUCODEREV)
1621typedef struct SUPUCODEREV
1622{
1623 /** The header. */
1624 SUPREQHDR Hdr;
1625 union
1626 {
1627 struct
1628 {
1629 /** The microcode revision dword. */
1630 uint32_t MicrocodeRev;
1631 } Out;
1632 } u;
1633} SUPUCODEREV, *PSUPUCODEREV;
1634/** @} */
1635
1636
1637/** @name SUP_IOCTL_HWVIRT_MSRS
1638 * Get hardware-virtualization MSRs.
1639 *
1640 * This queries a lot more information than merely VT-x/AMD-V basic capabilities
1641 * provided by SUP_IOCTL_VT_CAPS.
1642 */
1643#define SUP_IOCTL_GET_HWVIRT_MSRS SUP_CTL_CODE_SIZE(41, SUP_IOCTL_GET_HWVIRT_MSRS_SIZE)
1644#define SUP_IOCTL_GET_HWVIRT_MSRS_SIZE sizeof(SUPGETHWVIRTMSRS)
1645#define SUP_IOCTL_GET_HWVIRT_MSRS_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPGETHWVIRTMSRS, u.In))
1646#define SUP_IOCTL_GET_HWVIRT_MSRS_SIZE_OUT sizeof(SUPGETHWVIRTMSRS)
1647
1648typedef struct SUPGETHWVIRTMSRS
1649{
1650 /** The header. */
1651 SUPREQHDR Hdr;
1652 union
1653 {
1654 struct
1655 {
1656 /** Whether to force re-querying of MSRs. */
1657 bool fForce;
1658 /** Reserved. Must be false. */
1659 bool fReserved0;
1660 /** Reserved. Must be false. */
1661 bool fReserved1;
1662 /** Reserved. Must be false. */
1663 bool fReserved2;
1664 } In;
1665
1666 struct
1667 {
1668 /** Hardware-virtualization MSRs. */
1669 SUPHWVIRTMSRS HwvirtMsrs;
1670 } Out;
1671 } u;
1672} SUPGETHWVIRTMSRS, *PSUPGETHWVIRTMSRS;
1673/** @} */
1674
1675
1676#pragma pack() /* paranoia */
1677
1678#endif /* !VBOX_INCLUDED_SRC_Support_SUPDrvIOC_h */
1679
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