VirtualBox

Changeset 44373 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Jan 25, 2013 12:19:29 PM (12 years ago)
Author:
vboxsync
Message:

HM,++: pVM -> pUVM for main, mark as many as possible interfaces module internal.

Location:
trunk/src/VBox/VMM/VMMR3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CSAM.cpp

    r44362 r44373  
    3636#include <VBox/vmm/trpm.h>
    3737#include <VBox/vmm/cfgm.h>
     38#include <VBox/vmm/ssm.h>
    3839#include <VBox/param.h>
    3940#include <iprt/avl.h>
     
    4243#include "CSAMInternal.h"
    4344#include <VBox/vmm/vm.h>
     45#include <VBox/vmm/uvm.h>
    4446#include <VBox/dbg.h>
    4547#include <VBox/err.h>
    46 #include <VBox/vmm/ssm.h>
    4748#include <VBox/log.h>
    4849#include <iprt/assert.h>
     
    26852686 * Query CSAM state (enabled/disabled)
    26862687 *
    2687  * @returns 0 - disabled, 1 - enabled
    2688  * @param   pVM         Pointer to the VM.
    2689  */
    2690 VMMR3DECL(int) CSAMR3IsEnabled(PVM pVM)
    2691 {
    2692     return pVM->fCSAMEnabled;
     2688 * @returns true if enabled, false otherwise.
     2689 * @param   pUVM        The user mode VM handle.
     2690 */
     2691VMMR3DECL(bool) CSAMR3IsEnabled(PUVM pUVM)
     2692{
     2693    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     2694    PVM pVM = pUVM->pVM;
     2695    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     2696    return CSAMIsEnabled(pVM);
    26932697}
    26942698
  • trunk/src/VBox/VMM/VMMR3/DBGF.cpp

    r43387 r44373  
    8080#include "DBGFInternal.h"
    8181#include <VBox/vmm/vm.h>
     82#include <VBox/vmm/uvm.h>
    8283#include <VBox/err.h>
    8384
     
    11161117}
    11171118
     1119
     1120/**
     1121 * Inject an NMI into a running VM (only VCPU 0!)
     1122 *
     1123 * @returns VBox status code.
     1124 * @param   pVM         Pointer to the VM.
     1125 */
     1126VMMR3DECL(int) DBGFR3InjectNMI(PUVM pUVM, VMCPUID idCpu)
     1127{
     1128    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1129    PVM pVM = pUVM->pVM;
     1130    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     1131    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     1132
     1133    /** @todo Implement generic NMI injection. */
     1134    if (!HMIsEnabled(pVM))
     1135        return VERR_NOT_SUP_IN_RAW_MODE;
     1136
     1137    VMCPU_FF_SET(&pVM->aCpus[idCpu], VMCPU_FF_INTERRUPT_NMI);
     1138    return VINF_SUCCESS;
     1139}
     1140
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r44362 r44373  
    6363#include "EMInternal.h"
    6464#include <VBox/vmm/vm.h>
     65#include <VBox/vmm/uvm.h>
    6566#include <VBox/vmm/cpumdis.h>
    6667#include <VBox/dis.h>
     
    666667
    667668/**
     669 * Checks if raw ring-3 execute mode is enabled.
     670 *
     671 * @returns true if enabled, false if disabled.
     672 * @param   pUVM            The user mode VM handle.
     673 */
     674VMMR3DECL(bool) EMR3IsRawRing3Enabled(PUVM pUVM)
     675{
     676    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     677    PVM pVM = pUVM->pVM;
     678    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     679    return EMIsRawRing3Enabled(pVM);
     680}
     681
     682
     683/**
     684 * Checks if raw ring-0 execute mode is enabled.
     685 *
     686 * @returns true if enabled, false if disabled.
     687 * @param   pUVM            The user mode VM handle.
     688 */
     689VMMR3DECL(bool) EMR3IsRawRing0Enabled(PUVM pUVM)
     690{
     691    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     692    PVM pVM = pUVM->pVM;
     693    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     694    return EMIsRawRing0Enabled(pVM);
     695}
     696
     697
     698/**
    668699 * Raise a fatal error.
    669700 *
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r44362 r44373  
    3939#include "HMInternal.h"
    4040#include <VBox/vmm/vm.h>
     41#include <VBox/vmm/uvm.h>
    4142#include <VBox/err.h>
    4243#include <VBox/param.h>
     
    284285 * @param   pVM         Pointer to the VM.
    285286 */
    286 VMMR3DECL(int) HMR3Init(PVM pVM)
     287VMMR3_INT_DECL(int) HMR3Init(PVM pVM)
    287288{
    288289    LogFlow(("HMR3Init\n"));
     
    14841485 * @param   pVM     The VM.
    14851486 */
    1486 VMMR3DECL(void) HMR3Relocate(PVM pVM)
     1487VMMR3_INT_DECL(void) HMR3Relocate(PVM pVM)
    14871488{
    14881489    Log(("HMR3Relocate to %RGv\n", MMHyperGetArea(pVM, 0)));
     
    15471548 * @param   pVM         Pointer to the VM.
    15481549 */
    1549 VMMR3DECL(bool) HMR3IsAllowed(PVM pVM)
     1550VMMR3_INT_DECL(bool) HMR3IsAllowed(PVM pVM)
    15501551{
    15511552    return pVM->hm.s.fAllowed;
     
    15641565 * @param   enmGuestMode   New guest paging mode.
    15651566 */
    1566 VMMR3DECL(void) HMR3PagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode)
     1567VMMR3_INT_DECL(void) HMR3PagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode)
    15671568{
    15681569    /* Ignore page mode changes during state loading. */
     
    16191620 * @param   pVM         Pointer to the VM.
    16201621 */
    1621 VMMR3DECL(int) HMR3Term(PVM pVM)
     1622VMMR3_INT_DECL(int) HMR3Term(PVM pVM)
    16221623{
    16231624    if (pVM->hm.s.vmx.pRealModeTSS)
     
    16751676 * @param   pVCpu   The CPU to reset.
    16761677 */
    1677 VMMR3DECL(void) HMR3ResetCpu(PVMCPU pVCpu)
     1678VMMR3_INT_DECL(void) HMR3ResetCpu(PVMCPU pVCpu)
    16781679{
    16791680    /* On first entry we'll sync everything. */
     
    17121713 * @param   pVM     Pointer to the VM.
    17131714 */
    1714 VMMR3DECL(void) HMR3Reset(PVM pVM)
     1715VMMR3_INT_DECL(void) HMR3Reset(PVM pVM)
    17151716{
    17161717    LogFlow(("HMR3Reset:\n"));
     
    18311832 * @param   cbPatchMem  Size of the memory range.
    18321833 */
    1833 VMMR3DECL(int)  HMR3EnablePatching(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem)
     1834VMMR3_INT_DECL(int)  HMR3EnablePatching(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem)
    18341835{
    18351836    VM_ASSERT_EMT(pVM);
     
    18551856 * @param   cbPatchMem  Size of the memory range.
    18561857 */
    1857 VMMR3DECL(int)  HMR3DisablePatching(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem)
     1858VMMR3_INT_DECL(int)  HMR3DisablePatching(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem)
    18581859{
    18591860    Log(("HMR3DisablePatching %RGv size %x\n", pPatchMem, cbPatchMem));
     
    22892290 * @param   pCtx        Pointer to the guest CPU context.
    22902291 */
    2291 VMMR3DECL(int) HMR3PatchTprInstr(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
     2292VMMR3_INT_DECL(int) HMR3PatchTprInstr(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    22922293{
    22932294    NOREF(pCtx);
     
    23072308 * @param   pCtx        Partial VM execution context.
    23082309 */
    2309 VMMR3DECL(int) HMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx)
     2310VMMR3_INT_DECL(int) HMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx)
    23102311{
    23112312    PVMCPU pVCpu = VMMGetCpu(pVM);
     
    25232524 * @param   pCtx        VM execution context.
    25242525 */
    2525 VMMR3DECL(bool) HMR3IsRescheduleRequired(PVM pVM, PCPUMCTX pCtx)
     2526VMMR3_INT_DECL(bool) HMR3IsRescheduleRequired(PVM pVM, PCPUMCTX pCtx)
    25262527{
    25272528    /*
     
    25462547 * @param   pVCpu       Pointer to the current VMCPU.
    25472548 */
    2548 VMMR3DECL(void) HMR3NotifyScheduled(PVMCPU pVCpu)
     2549VMMR3_INT_DECL(void) HMR3NotifyScheduled(PVMCPU pVCpu)
    25492550{
    25502551    pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_ALL_GUEST;
     
    25572558 * @param   pVCpu       Pointer to the VMCPU.
    25582559 */
    2559 VMMR3DECL(void) HMR3NotifyEmulated(PVMCPU pVCpu)
     2560VMMR3_INT_DECL(void) HMR3NotifyEmulated(PVMCPU pVCpu)
    25602561{
    25612562    pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_ALL_GUEST;
     
    25692570 * @param   pVCpu        Pointer to the VMCPU.
    25702571 */
    2571 VMMR3DECL(bool) HMR3IsActive(PVMCPU pVCpu)
     2572VMMR3_INT_DECL(bool) HMR3IsActive(PVMCPU pVCpu)
    25722573{
    25732574    return pVCpu->hm.s.fActive;
     
    25792580 *
    25802581 * @returns true if nested paging is being used, otherwise false.
    2581  * @param   pVM         Pointer to the VM.
    2582  */
    2583 VMMR3DECL(bool) HMR3IsNestedPagingActive(PVM pVM)
    2584 {
     2582 * @param   pUVM        The user mode VM handle.
     2583 */
     2584VMMR3DECL(bool) HMR3IsEnabled(PUVM pUVM)
     2585{
     2586    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     2587    PVM pVM = pUVM->pVM;
     2588    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     2589    return HMIsEnabled(pVM);
     2590}
     2591
     2592
     2593/**
     2594 * Checks if we are currently using nested paging.
     2595 *
     2596 * @returns true if nested paging is being used, otherwise false.
     2597 * @param   pUVM        The user mode VM handle.
     2598 */
     2599VMMR3DECL(bool) HMR3IsNestedPagingActive(PUVM pUVM)
     2600{
     2601    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     2602    PVM pVM = pUVM->pVM;
     2603    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    25852604    return pVM->hm.s.fNestedPaging;
    25862605}
     
    25912610 *
    25922611 * @returns true if VPID is being used, otherwise false.
    2593  * @param   pVM         Pointer to the VM.
    2594  */
    2595 VMMR3DECL(bool) HMR3IsVPIDActive(PVM pVM)
    2596 {
     2612 * @param   pUVM        The user mode VM handle.
     2613 */
     2614VMMR3DECL(bool) HMR3IsVpidActive(PUVM pUVM)
     2615{
     2616    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     2617    PVM pVM = pUVM->pVM;
     2618    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    25972619    return pVM->hm.s.vmx.fVpid;
    25982620}
     
    26052627 * @param   pVM         Pointer to the VM.
    26062628 */
    2607 VMMR3DECL(bool) HMR3IsEventPending(PVMCPU pVCpu)
     2629VMMR3_INT_DECL(bool) HMR3IsEventPending(PVMCPU pVCpu)
    26082630{
    26092631    return HMIsEnabled(pVCpu->pVMR3) && pVCpu->hm.s.Event.fPending;
     
    26172639 * @param   pVM         Pointer to the VM.
    26182640 */
    2619 VMMR3DECL(bool) HMR3IsVmxPreemptionTimerUsed(PVM pVM)
     2641VMMR3_INT_DECL(bool) HMR3IsVmxPreemptionTimerUsed(PVM pVM)
    26202642{
    26212643    return HMIsEnabled(pVM)
     
    26392661 * @param   pCtx        Pointer to the guest CPU context.
    26402662 */
    2641 VMMR3DECL(VBOXSTRICTRC) HMR3RestartPendingIOInstr(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
     2663VMMR3_INT_DECL(VBOXSTRICTRC) HMR3RestartPendingIOInstr(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    26422664{
    26432665    HMPENDINGIO enmType = pVCpu->hm.s.PendingIO.enmType;
     
    26862708
    26872709/**
    2688  * Inject an NMI into a running VM (only VCPU 0!)
    2689  *
    2690  * @returns VBox status code.
    2691  * @param   pVM         Pointer to the VM.
    2692  */
    2693 VMMR3DECL(int)  HMR3InjectNMI(PVM pVM)
    2694 {
    2695     VMCPU_FF_SET(&pVM->aCpus[0], VMCPU_FF_INTERRUPT_NMI);
    2696     return VINF_SUCCESS;
    2697 }
    2698 
    2699 
    2700 /**
    27012710 * Check fatal VT-x/AMD-V error and produce some meaningful
    27022711 * log release message.
     
    27052714 * @param   iStatusCode VBox status code.
    27062715 */
    2707 VMMR3DECL(void) HMR3CheckError(PVM pVM, int iStatusCode)
     2716VMMR3_INT_DECL(void) HMR3CheckError(PVM pVM, int iStatusCode)
    27082717{
    27092718    for (VMCPUID i = 0; i < pVM->cCpus; i++)
Note: See TracChangeset for help on using the changeset viewer.

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