VirtualBox

Changeset 95315 in vbox


Ignore:
Timestamp:
Jun 21, 2022 4:44:40 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151905
Message:

VMM: Nested VMX: bugref:10092 Added CPUMIsGuestVmxApicAccessPageAddr for use by PGM while syncing PTEs.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r95256 r95315  
    16471647VMM_INT_DECL(bool)      CPUMIsGuestVmxEptPaePagingEnabled(PCVMCPUCC pVCpu);
    16481648VMM_INT_DECL(uint64_t)  CPUMGetGuestVmxApicAccessPageAddr(PCVMCPUCC pVCpu);
     1649VMM_INT_DECL(bool)      CPUMIsGuestVmxApicAccessPageAddr(PCVMCPUCC pVCpu, RTGCPHYS GCPhysPage);
    16491650/** @} */
    16501651
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r95248 r95315  
    30873087}
    30883088
     3089
     3090/**
     3091 * Returns whether the given page is the active APIC-access page.
     3092 *
     3093 * @returns @c true if the page is the active APIC-access page, @c false otherwises.
     3094 * @param   pVCpu       The cross context virtual CPU structure.
     3095 * @param   GCPhysPage  The guest-physical address to check.
     3096 *
     3097 * @remarks This function does not assume the guest is not executing in VMX non-root
     3098 *          mode or even in VMX root-mode. However, it does assert that the VMCS has
     3099 *          been initialized and the virtual-APIC access VM-execution control was
     3100 *          enabled.
     3101 * @note    This is meant to be used by PGM while syncing the page-table entry for
     3102 *          the APIC-access page. All other queries for the APIC-access page address
     3103 *          should almost certainly use CPUMGetGuestVmxApicAccessPageAddr() instead!
     3104 */
     3105VMM_INT_DECL(bool) CPUMIsGuestVmxApicAccessPageAddr(PCVMCPUCC pVCpu, RTGCPHYS GCPhysPage)
     3106{
     3107    PCVMXVVMCS pVmcs = &pVCpu->cpum.s.Guest.hwvirt.vmx.Vmcs;
     3108    if (   pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures.fVmx                  /* VMX CPU feature is enabled for the guest. */
     3109        && (pVmcs->u32ProcCtls2 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS))         /* Virtual-APIC access VM-execution control is set. */
     3110    {
     3111        Assert(pVmcs->fVmcsState & (  VMX_V_VMCS_LAUNCH_STATE_LAUNCHED
     3112                                    | VMX_V_VMCS_LAUNCH_STATE_CURRENT
     3113                                    | VMX_V_VMCS_LAUNCH_STATE_ACTIVE));     /* VMCS has been initialized. */
     3114        Assert(!(pVmcs->u64AddrApicAccess.u & X86_PAGE_4K_OFFSET_MASK));    /* Intel spec. mandates that this is 4K aligned. */
     3115        Assert(!(GCPhysPage & GUEST_PAGE_OFFSET_MASK));                     /* Caller must be passing us an aligned page. */
     3116        return pVmcs->u64AddrApicAccess.u == GCPhysPage;
     3117    }
     3118    return false;
     3119}
     3120
Note: See TracChangeset for help on using the changeset viewer.

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