VirtualBox

source: vbox/trunk/src/VBox/VMM/tools/VBoxCpuReport.h@ 109010

Last change on this file since 109010 was 109008, checked in by vboxsync, 5 weeks ago

VMM,Main: Working on ARM CPU profile support, which is neede/useful for getting info about the host CPU as well. The CPUDBENTRY typedef is used externally by Main, so we can't have two definitions of it, so left the bits that are common to both x86 and ARM in CPUDBENTRY and created sub-structures for each of the two targets/platforms. Also started reworking the VBoxCpuReport tool so we can use it on arm as well (much left to do there, though). jiraref:VBP-1598

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/* $Id: VBoxCpuReport.h 109008 2025-04-16 20:59:36Z 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
38RT_C_DECLS_BEGIN
39
40typedef 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;
55typedef VBCPUREPMSRACCESSORS *PVBCPUREPMSRACCESSORS;
56
57extern PRTSTREAM g_pReportOut;
58extern PRTSTREAM g_pDebugOut;
59extern CPUMCPUVENDOR g_enmVendor;
60extern CPUMMICROARCH g_enmMicroarch;
61#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
62extern bool g_fNoMsrs;
63#endif
64
65extern void vbCpuRepDebug(const char *pszMsg, ...);
66extern void vbCpuRepPrintf(const char *pszMsg, ...);
67extern const char *vbCpuVendorToString(CPUMCPUVENDOR enmCpuVendor);
68
69extern int produceCpuReport(void); /* arch specific */
70
71#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
72extern int probeMsrs(bool fHacking, const char *pszNameC, const char *pszCpuDesc, char *pszMsrMask, size_t cbMsrMask);
73extern int VbCpuRepMsrProberInitSupDrv(PVBCPUREPMSRACCESSORS pMsrAccessors);
74extern int VbCpuRepMsrProberInitPlatform(PVBCPUREPMSRACCESSORS pMsrAccessors);
75#endif
76
77RT_C_DECLS_END
78
79#endif /* !VMM_INCLUDED_SRC_tools_VBoxCpuReport_h */
80
Note: See TracBrowser for help on using the repository browser.

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