VirtualBox

Changeset 108968 in vbox for trunk/include


Ignore:
Timestamp:
Apr 14, 2025 8:45:36 PM (3 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168488
Message:

VMM,Main,Devices: Respect VBOX_VMM_TARGET_ARMV8 correctly on amd64 hosts (for IEM debugging purposes). jiraref:VBP-1598

Location:
trunk/include/VBox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/err.h

    r107893 r108968  
    12941294/** Cannot block in ring-0. */
    12951295#define VERR_VMM_CANNOT_BLOCK               (-2720)
     1296/** The ring-0 function is not supported for this VM target.   */
     1297#define VERR_VMM_FN_NOT_SUPPORTED_FOR_VMTARGET      (-2721)
    12961298/** @} */
    12971299
     
    21362138#define VINF_GVM_YIELDED                            3903
    21372139/** Mismatching VM structure size between VMMR0 and VBoxVMM. */
    2138 #define VINF_GVM_MISMATCH_VM_SIZE                   (-3904)
     2140#define VERR_GVM_MISMATCH_VM_SIZE                   (-3904)
    21392141/** Mismatching VMCPU structure size between VMMR0 and VBoxVMM. */
    2140 #define VINF_GVM_MISMATCH_VMCPU_SIZE                (-3905)
     2142#define VERR_GVM_MISMATCH_VMCPU_SIZE                (-3905)
    21412143/** Mismatching VM structure version between VMMR0 and VBoxVMM. */
    2142 #define VINF_GVM_MISMATCH_VM_STRUCT_VER             (-3906)
     2144#define VERR_GVM_MISMATCH_VM_STRUCT_VER             (-3906)
    21432145/** Mismatching SVN revision number between VMMR0 and VBoxVMM. */
    2144 #define VINF_GVM_MISMATCH_SVN_REV                   (-3907)
     2146#define VERR_GVM_MISMATCH_SVN_REV                   (-3907)
    21452147/** @} */
    21462148
  • trunk/include/VBox/param.h

    r108736 r108968  
    139139     && defined(RT_ARCH_AMD64)      /* ASM-NOINC */ \
    140140     && (defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)) ) /* ASM-NOINC */ \
     141     && (defined(VBOX_VMM_TARGET_X86) || defined(VBOX_VMM_TARGET_AGNOSTIC)) /* quick hack */ \
    141142 || defined(DOXYGEN_RUNNING)        /* ASM-NOINC */
    142143# define VBOX_WITH_PAGE_SHARING     /* ASM-NOINC */
  • trunk/include/VBox/types.h

    r107893 r108968  
    284284#elif defined(VBOX_VMM_TARGET_ARMV8)
    285285# define VMTARGET_DEFAULT   VMTARGET_ARMV8
     286#endif
     287
     288/** @def VMTARGET_NATIVE
     289 * The native target according to the RT_ARCH_XXX defines. */
     290#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(DOXYGEN_RUNNING)
     291# define VMTARGET_NATIVE    VMTARGET_X86
     292#elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
     293# define VMTARGET_NATIVE    VMTARGET_ARMV8
    286294#endif
    287295
  • trunk/include/VBox/vmm/cpum-x86-amd64.h

    r107650 r108968  
    8787} CPUMCPUIDFEATURE;
    8888
    89 
    90 /**
    91  * CPUID leaf.
    92  *
    93  * @remarks This structure is used by the patch manager and is therefore
    94  *          more or less set in stone.
    95  */
    96 typedef struct CPUMCPUIDLEAF
    97 {
    98     /** The leaf number. */
    99     uint32_t    uLeaf;
    100     /** The sub-leaf number. */
    101     uint32_t    uSubLeaf;
    102     /** Sub-leaf mask.  This is 0 when sub-leaves aren't used. */
    103     uint32_t    fSubLeafMask;
    104 
    105     /** The EAX value. */
    106     uint32_t    uEax;
    107     /** The EBX value. */
    108     uint32_t    uEbx;
    109     /** The ECX value. */
    110     uint32_t    uEcx;
    111     /** The EDX value. */
    112     uint32_t    uEdx;
    113 
    114     /** Flags. */
    115     uint32_t    fFlags;
    116 } CPUMCPUIDLEAF;
    117 #ifndef VBOX_FOR_DTRACE_LIB
    118 AssertCompileSize(CPUMCPUIDLEAF, 32);
    119 #endif
    120 /** Pointer to a CPUID leaf. */
    121 typedef CPUMCPUIDLEAF *PCPUMCPUIDLEAF;
    122 /** Pointer to a const CPUID leaf. */
    123 typedef CPUMCPUIDLEAF const *PCCPUMCPUIDLEAF;
    124 
    125 /** @name CPUMCPUIDLEAF::fFlags
    126  * @{ */
    127 /** Indicates working intel leaf 0xb where the lower 8 ECX bits are not modified
    128  * and EDX containing the extended APIC ID. */
    129 #define CPUMCPUIDLEAF_F_INTEL_TOPOLOGY_SUBLEAVES    RT_BIT_32(0)
    130 /** The leaf contains an APIC ID that needs changing to that of the current CPU. */
    131 #define CPUMCPUIDLEAF_F_CONTAINS_APIC_ID            RT_BIT_32(1)
    132 /** The leaf contains an OSXSAVE which needs individual handling on each CPU. */
    133 #define CPUMCPUIDLEAF_F_CONTAINS_OSXSAVE            RT_BIT_32(2)
    134 /** The leaf contains an APIC feature bit which is tied to APICBASE.EN. */
    135 #define CPUMCPUIDLEAF_F_CONTAINS_APIC               RT_BIT_32(3)
    136 /** Mask of the valid flags. */
    137 #define CPUMCPUIDLEAF_F_VALID_MASK                  UINT32_C(0xf)
    138 /** @} */
    13989
    14090/**
  • trunk/include/VBox/vmm/cpum.h

    r107854 r108968  
    15201520
    15211521
     1522/**
     1523 * CPUID leaf on x86.
     1524 * @note Used by both x86 hosts and guest.
     1525 * @todo s/CPUMCPUIDLEAF/CPUMX86CPUIDLEAF/
     1526 */
     1527typedef struct CPUMCPUIDLEAF
     1528{
     1529    /** The leaf number. */
     1530    uint32_t    uLeaf;
     1531    /** The sub-leaf number. */
     1532    uint32_t    uSubLeaf;
     1533    /** Sub-leaf mask.  This is 0 when sub-leaves aren't used. */
     1534    uint32_t    fSubLeafMask;
     1535
     1536    /** The EAX value. */
     1537    uint32_t    uEax;
     1538    /** The EBX value. */
     1539    uint32_t    uEbx;
     1540    /** The ECX value. */
     1541    uint32_t    uEcx;
     1542    /** The EDX value. */
     1543    uint32_t    uEdx;
     1544
     1545    /** Flags. */
     1546    uint32_t    fFlags;
     1547} CPUMCPUIDLEAF;
     1548#ifndef VBOX_FOR_DTRACE_LIB
     1549AssertCompileSize(CPUMCPUIDLEAF, 32);
     1550#endif
     1551/** Pointer to a CPUID leaf. */
     1552typedef CPUMCPUIDLEAF *PCPUMCPUIDLEAF;
     1553/** Pointer to a const CPUID leaf. */
     1554typedef CPUMCPUIDLEAF const *PCCPUMCPUIDLEAF;
     1555
     1556/** @name CPUMCPUIDLEAF::fFlags
     1557 * @{ */
     1558/** Indicates working intel leaf 0xb where the lower 8 ECX bits are not modified
     1559 * and EDX containing the extended APIC ID. */
     1560#define CPUMCPUIDLEAF_F_INTEL_TOPOLOGY_SUBLEAVES    RT_BIT_32(0)
     1561/** The leaf contains an APIC ID that needs changing to that of the current CPU. */
     1562#define CPUMCPUIDLEAF_F_CONTAINS_APIC_ID            RT_BIT_32(1)
     1563/** The leaf contains an OSXSAVE which needs individual handling on each CPU. */
     1564#define CPUMCPUIDLEAF_F_CONTAINS_OSXSAVE            RT_BIT_32(2)
     1565/** The leaf contains an APIC feature bit which is tied to APICBASE.EN. */
     1566#define CPUMCPUIDLEAF_F_CONTAINS_APIC               RT_BIT_32(3)
     1567/** Mask of the valid flags. */
     1568#define CPUMCPUIDLEAF_F_VALID_MASK                  UINT32_C(0xf)
     1569/** @} */
     1570
     1571
    15221572
    15231573/**
  • trunk/include/VBox/vmm/cpumctx-x86-amd64.h

    r106061 r108968  
    106106 * @deprecated  */
    107107typedef CPUMSELREG CPUMSELREGHID;
    108 
    109 /**
    110  * The sysenter register set.
    111  */
    112 typedef struct CPUMSYSENTER
    113 {
    114     /** Ring 0 cs.
    115      * This value +  8 is the Ring 0 ss.
    116      * This value + 16 is the Ring 3 cs.
    117      * This value + 24 is the Ring 3 ss.
    118      */
    119     uint64_t    cs;
    120     /** Ring 0 eip. */
    121     uint64_t    eip;
    122     /** Ring 0 esp. */
    123     uint64_t    esp;
    124 } CPUMSYSENTER;
    125108
    126109/** A general register (union). */
  • trunk/include/VBox/vmm/cpumctx.h

    r106061 r108968  
    6969#define CPUM_UNION_STRUCT_NM(a_UnionNm, a_StructNm) CPUM_UNION_NM(a_UnionNm .) CPUM_STRUCT_NM(a_StructNm)
    7070
     71
     72/**
     73 * The x86 sysenter register set.
     74 *
     75 * @note Used by both x86 hosts and guest context structures.
     76 * @todo s/CPUMSYSENTER/CPUMX86SYSENTER/
     77 */
     78typedef struct CPUMSYSENTER
     79{
     80    /** Ring 0 cs.
     81     * This value +  8 is the Ring 0 ss.
     82     * This value + 16 is the Ring 3 cs.
     83     * This value + 24 is the Ring 3 ss.
     84     */
     85    uint64_t    cs;
     86    /** Ring 0 eip. */
     87    uint64_t    eip;
     88    /** Ring 0 esp. */
     89    uint64_t    esp;
     90} CPUMSYSENTER;
     91
     92
    7193#ifdef VBOX_VMM_TARGET_ARMV8
    7294# include <VBox/vmm/cpumctx-armv8.h>
  • trunk/include/VBox/vmm/vm.h

    r108708 r108968  
    12521252                                     | VM_STRUCT_VERSION_F_29 \
    12531253                                     | VM_STRUCT_VERSION_F_28 )
    1254 #endif
    1255 
    1256 
     1254
     1255# if (defined(RT_ARCH_AMD64) && defined(VBOX_WITH_VIRT_ARMV8) && defined(IN_RING0)) || defined(DOXYGEN_RUNNING)
     1256/** @def VM_STRUCT_VERSION_NON_NATIVE_TARGETS
     1257 * The current VM structure version for the other architecture (hack).
     1258 *
     1259 * Currently the VBoxVMMArm.dll/so/dylib on x86 differs from VM_STRUCT_VERSION
     1260 * in that it will have VBOX_WITH_ONLY_PGM_NEM_MODE & VBOX_WITH_MINIMAL_R0
     1261 * defined but not VBOX_WITH_HWVIRT.  This is to get the stuff off the ground
     1262 * quickly by emulating how it's built on win.arm64 hosts. */
     1263#  define VM_STRUCT_VERSION_NON_NATIVE_TARGETS \
     1264        (  (  VM_STRUCT_VERSION \
     1265            | RT_BIT_32(31) /*VBOX_WITH_MINIMAL_R0*/ \
     1266            | RT_BIT_32(30) /*VBOX_WITH_ONLY_PGM_NEM_MODE*/ ) \
     1267         & ~RT_BIT_32(28) /*VBOX_WITH_HWVIRT*/ )
     1268# endif
     1269
     1270/** @def VM_IS_NON_NATIVE_WITH_LIMITED_R0
     1271 * Whether the is a non-default targeted VM and should have the limited ring-0
     1272 * presence hack applied.
     1273 *
     1274 * This is typically used in ring-0 code to skip VM init and termination code.
     1275 *
     1276 * @param g_GVM  The ring-0 VM structure. */
     1277# ifdef VM_STRUCT_VERSION_NON_NATIVE_TARGETS
     1278#  define VM_IS_NON_NATIVE_WITH_LIMITED_R0(g_GVM)   (pGVM->enmTarget != VMTARGET_NATIVE)
     1279# else
     1280#  define VM_IS_NON_NATIVE_WITH_LIMITED_R0(g_GVM)   (false)
     1281# endif
     1282
     1283#endif
    12571284#endif /* !VBOX_FOR_DTRACE_LIB */
    12581285
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