VirtualBox

source: vbox/trunk/include/VBox/vmm/cpuidcall.h@ 96811

最後變更 在這個檔案從96811是 96811,由 vboxsync 提交於 2 年 前

VMM,IPRT,VBoxGuest,SUPDrv: Added a more efficient interface for guest logging using the CPUID instruction. This is mainly intended for development use and not enabled by default. Require updating host drivers.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 3.9 KB
 
1/** @file
2 * VM - The Virtual Machine, CPU Host Call Interface (AMD64 & x86 only).
3 */
4
5/*
6 * Copyright (C) 2022 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.alldomusa.eu.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef VBOX_INCLUDED_vmm_cpuidcall_h
37#define VBOX_INCLUDED_vmm_cpuidcall_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <VBox/types.h>
43
44
45/** @defgroup grp_cpuidcall VBox CPUID Host Call Interface (AMD64 & x86)
46 *
47 * This describes an interface using CPUID for calling the host from within the
48 * VM. This is chiefly intended for nested VM debugging at present and is
49 * therefore disabled by default.
50 *
51 * @{ */
52
53/** Fixed EAX value for all requests (big-endian 'VBox'). */
54#define VBOX_CPUID_REQ_EAX_FIXED UINT32_C(0x56426f78)
55/** Fixed portion of ECX for all requests. */
56#define VBOX_CPUID_REQ_ECX_FIXED UINT32_C(0xc0de0000)
57/** Fixed portion of ECX for all requests. */
58#define VBOX_CPUID_REQ_ECX_FIXED_MASK UINT32_C(0xffff0000)
59/** Function part of ECX for requests. */
60#define VBOX_CPUID_REQ_ECX_FN_MASK UINT32_C(0x0000ffff)
61
62/** Generic ECX return value. */
63#define VBOX_CPUID_RESP_GEN_ECX UINT32_C(0x19410612)
64/** Generic EDX return value. */
65#define VBOX_CPUID_RESP_GEN_EDX UINT32_C(0x19400412)
66/** Generic EBX return value. */
67#define VBOX_CPUID_RESP_GEN_EBX UINT32_C(0x19450508)
68
69/** @name Function \#1: Interface ID check and max function.
70 *
71 * Input: EDX & EBX content is unused and ignored. Best set to zero.
72 *
73 * Result: EAX:EDX:EBX forms the little endian string "VBox RuleZ!\0".
74 * ECX contains the max function number acccepted.
75 * @{ */
76#define VBOX_CPUID_FN_ID UINT32_C(0x0001)
77#define VBOX_CPUID_RESP_ID_EAX UINT32_C(0x786f4256)
78#define VBOX_CPUID_RESP_ID_EDX UINT32_C(0x6c755220)
79#define VBOX_CPUID_RESP_ID_EBX UINT32_C(0x00215A65)
80#define VBOX_CPUID_RESP_ID_ECX UINT32_C(0x00000002)
81/** @} */
82
83/** Function \#2: Write string to host Log.
84 *
85 * Input: EDX gives the number of bytes to log (max 2MB).
86 * EBX indicates the log to write to: 0 for debug, 1 for release.
87 * RSI is the FLAT pointer to the UTF-8 string to log.
88 *
89 * Output: EAX contains IPRT status code. ECX, EDX and EBX are set to the
90 * generic their response values (VBOX_CPUID_RESP_GEN_XXX). RSI is
91 * advanced EDX bytes on success.
92 *
93 * Except: May raise \#PF when reading the string. RSI and EDX is then be
94 * updated to the point where the page fault triggered, allowing paging
95 * in of logging buffer and such like.
96 *
97 * @note Buffer is not accessed if the target logger isn't enabled.
98 */
99#define VBOX_CPUID_FN_LOG UINT32_C(0x0002)
100
101
102/** @} */
103
104#endif /* !VBOX_INCLUDED_vmm_cpuidcall_h */
105
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette