VirtualBox

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

Last change on this file was 109030, checked in by vboxsync, 13 days ago

VBoxCpuReport,VMM/CPUM,iprt/armv8.h: Deal with core variations on arm CPUs when generating reports for them. Fixes. jiraref:VBP-1598

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
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
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;
61extern const char *g_pszCpuNameOverride;
62#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
63extern bool g_fNoMsrs;
64#endif
65
66extern void vbCpuRepDebug(const char *pszMsg, ...);
67extern void vbCpuRepFileHdr(const char *pszName, const char *pszNameC);
68extern void vbCpuRepPrintf(const char *pszMsg, ...);
69extern const char *vbCpuVendorToString(CPUMCPUVENDOR enmCpuVendor);
70extern const char *vbGetCoreTypeToString(CPUMCORETYPE enmCoreType);
71
72extern int produceCpuReport(void); /* arch specific */
73
74#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
75extern int probeMsrs(bool fHacking, const char *pszNameC, const char *pszCpuDesc, char *pszMsrMask, size_t cbMsrMask);
76extern int VbCpuRepMsrProberInitSupDrv(PVBCPUREPMSRACCESSORS pMsrAccessors);
77extern int VbCpuRepMsrProberInitPlatform(PVBCPUREPMSRACCESSORS pMsrAccessors);
78#endif
79
80RT_C_DECLS_END
81
82#endif /* !VMM_INCLUDED_SRC_tools_VBoxCpuReport_h */
83
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