VirtualBox

source: vbox/trunk/include/VBox/vmm/csam.h@ 79342

Last change on this file since 79342 was 76585, checked in by vboxsync, 6 years ago

*: scm --fix-header-guard-endif

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/** @file
2 * CSAM - Guest OS Code Scanning and Analyis Manager.
3 */
4
5/*
6 * Copyright (C) 2006-2019 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_vmm_csam_h
27#define VBOX_INCLUDED_vmm_csam_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/types.h>
33
34#if defined(VBOX_WITH_RAW_MODE) || defined(DOXYGEN_RUNNING)
35
36/** @defgroup grp_csam The Code Scanning and Analysis API
37 * @ingroup grp_vmm
38 * @{
39 */
40
41/**
42 * CSAM monitoring tag.
43 * For use with CSAMR3MonitorPage
44 */
45typedef enum CSAMTAG
46{
47 CSAM_TAG_INVALID = 0,
48 CSAM_TAG_REM,
49 CSAM_TAG_PATM,
50 CSAM_TAG_CSAM,
51 CSAM_TAG_32BIT_HACK = 0x7fffffff
52} CSAMTAG;
53
54
55RT_C_DECLS_BEGIN
56
57
58/**
59 * Query CSAM state (enabled/disabled)
60 *
61 * @returns true / false.
62 * @param a_pVM The shared VM handle.
63 * @internal
64 */
65#define CSAMIsEnabled(a_pVM) ((a_pVM)->fCSAMEnabled && EMIsRawRing0Enabled(a_pVM))
66
67VMM_INT_DECL(bool) CSAMDoesPageNeedScanning(PVM pVM, RTRCUINTPTR GCPtr);
68VMM_INT_DECL(bool) CSAMIsPageScanned(PVM pVM, RTRCPTR pPage);
69VMM_INT_DECL(int) CSAMMarkPage(PVM pVM, RTRCUINTPTR pPage, bool fScanned);
70VMM_INT_DECL(void) CSAMMarkPossibleCodePage(PVM pVM, RTRCPTR GCPtr);
71VMM_INT_DECL(int) CSAMEnableScanning(PVM pVM);
72VMM_INT_DECL(int) CSAMDisableScanning(PVM pVM);
73VMM_INT_DECL(int) CSAMExecFault(PVM pVM, RTRCPTR pvFault);
74VMM_INT_DECL(bool) CSAMIsKnownDangerousInstr(PVM pVM, RTRCUINTPTR GCPtr);
75
76
77#ifdef IN_RING3
78/** @defgroup grp_csam_r3 The CSAM ring-3 Context API
79 * @{
80 */
81
82VMMR3DECL(bool) CSAMR3IsEnabled(PUVM pUVM);
83VMMR3DECL(int) CSAMR3SetScanningEnabled(PUVM pUVM, bool fEnabled);
84
85VMMR3_INT_DECL(int) CSAMR3Init(PVM pVM);
86VMMR3_INT_DECL(void) CSAMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
87VMMR3_INT_DECL(int) CSAMR3Term(PVM pVM);
88VMMR3_INT_DECL(int) CSAMR3Reset(PVM pVM);
89
90VMMR3_INT_DECL(int) CSAMR3FlushPage(PVM pVM, RTRCPTR addr);
91VMMR3_INT_DECL(int) CSAMR3RemovePage(PVM pVM, RTRCPTR addr);
92VMMR3_INT_DECL(int) CSAMR3CheckCode(PVM pVM, RTRCPTR pInstrGC);
93VMMR3_INT_DECL(int) CSAMR3CheckCodeEx(PVM pVM, PCPUMCTX pCtx, RTRCPTR pInstrGC);
94VMMR3_INT_DECL(int) CSAMR3MarkCode(PVM pVM, RTRCPTR pInstr, uint32_t cbInstr, bool fScanned);
95VMMR3_INT_DECL(int) CSAMR3DoPendingAction(PVM pVM, PVMCPU pVCpu);
96VMMR3_INT_DECL(int) CSAMR3CheckGates(PVM pVM, uint32_t iGate, uint32_t cGates);
97
98VMMR3DECL(int) CSAMR3MonitorPage(PVM pVM, RTRCPTR pPageAddrGC, CSAMTAG enmTag);
99VMMR3DECL(int) CSAMR3UnmonitorPage(PVM pVM, RTRCPTR pPageAddrGC, CSAMTAG enmTag);
100VMMR3DECL(int) CSAMR3RecordCallAddress(PVM pVM, RTRCPTR GCPtrCall);
101
102/** @} */
103#endif
104
105
106/** @} */
107RT_C_DECLS_END
108
109#endif /* VBOX_WITH_RAW_MODE */
110
111#endif /* !VBOX_INCLUDED_vmm_csam_h */
112
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