1 | /* $Id: VBoxCpuReport.h 109030 2025-04-20 22:07:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxCpuReport internal header file.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef VMM_INCLUDED_SRC_tools_VBoxCpuReport_h
|
---|
29 | #define VMM_INCLUDED_SRC_tools_VBoxCpuReport_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include <VBox/sup.h>
|
---|
35 | #include <VBox/vmm/cpum.h>
|
---|
36 | #include <iprt/stream.h>
|
---|
37 |
|
---|
38 | RT_C_DECLS_BEGIN
|
---|
39 |
|
---|
40 | typedef struct VBCPUREPMSRACCESSORS
|
---|
41 | {
|
---|
42 | /** Wheter MSR prober can read/modify/restore MSRs more or less
|
---|
43 | * atomically, without allowing other code to be executed. */
|
---|
44 | bool fAtomic;
|
---|
45 | /** @copydoc SUPR3MsrProberRead */
|
---|
46 | DECLCALLBACKMEMBER(int, pfnMsrProberRead,(uint32_t uMsr, RTCPUID idCpu, uint64_t *puValue, bool *pfGp));
|
---|
47 | /** @copydoc SUPR3MsrProberWrite */
|
---|
48 | DECLCALLBACKMEMBER(int, pfnMsrProberWrite,(uint32_t uMsr, RTCPUID idCpu, uint64_t uValue, bool *pfGp));
|
---|
49 | /** @copydoc SUPR3MsrProberModify */
|
---|
50 | DECLCALLBACKMEMBER(int, pfnMsrProberModify,(uint32_t uMsr, RTCPUID idCpu, uint64_t fAndMask, uint64_t fOrMask,
|
---|
51 | PSUPMSRPROBERMODIFYRESULT pResult));
|
---|
52 | /** Termination callback, optional. */
|
---|
53 | DECLCALLBACKMEMBER(void, pfnTerm,(void));
|
---|
54 | } VBCPUREPMSRACCESSORS;
|
---|
55 | typedef VBCPUREPMSRACCESSORS *PVBCPUREPMSRACCESSORS;
|
---|
56 |
|
---|
57 | extern PRTSTREAM g_pReportOut;
|
---|
58 | extern PRTSTREAM g_pDebugOut;
|
---|
59 | extern CPUMCPUVENDOR g_enmVendor;
|
---|
60 | extern CPUMMICROARCH g_enmMicroarch;
|
---|
61 | extern const char *g_pszCpuNameOverride;
|
---|
62 | #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
|
---|
63 | extern bool g_fNoMsrs;
|
---|
64 | #endif
|
---|
65 |
|
---|
66 | extern void vbCpuRepDebug(const char *pszMsg, ...);
|
---|
67 | extern void vbCpuRepFileHdr(const char *pszName, const char *pszNameC);
|
---|
68 | extern void vbCpuRepPrintf(const char *pszMsg, ...);
|
---|
69 | extern const char *vbCpuVendorToString(CPUMCPUVENDOR enmCpuVendor);
|
---|
70 | extern const char *vbGetCoreTypeToString(CPUMCORETYPE enmCoreType);
|
---|
71 |
|
---|
72 | extern int produceCpuReport(void); /* arch specific */
|
---|
73 |
|
---|
74 | #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
|
---|
75 | extern int probeMsrs(bool fHacking, const char *pszNameC, const char *pszCpuDesc, char *pszMsrMask, size_t cbMsrMask);
|
---|
76 | extern int VbCpuRepMsrProberInitSupDrv(PVBCPUREPMSRACCESSORS pMsrAccessors);
|
---|
77 | extern int VbCpuRepMsrProberInitPlatform(PVBCPUREPMSRACCESSORS pMsrAccessors);
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | RT_C_DECLS_END
|
---|
81 |
|
---|
82 | #endif /* !VMM_INCLUDED_SRC_tools_VBoxCpuReport_h */
|
---|
83 |
|
---|