VirtualBox

Changeset 107893 in vbox for trunk/include


Ignore:
Timestamp:
Jan 22, 2025 3:31:45 PM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167114
Message:

VMM,VBox/types.h,VBox/err.h: Added VM target platform arch members to the VM structures (mostly for ring-0). Also added the structure sizes and svn revision to VMMR0_DO_GVMM_CREATE_VM. jiraref:VBP-1470

Location:
trunk/include/VBox
Files:
7 edited

Legend:

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

    r106978 r107893  
    21352135/** RTThreadYield was called during a GVMMR0SchedPoll call. */
    21362136#define VINF_GVM_YIELDED                            3903
     2137/** Mismatching VM structure size between VMMR0 and VBoxVMM. */
     2138#define VINF_GVM_MISMATCH_VM_SIZE                   (-3904)
     2139/** Mismatching VMCPU structure size between VMMR0 and VBoxVMM. */
     2140#define VINF_GVM_MISMATCH_VMCPU_SIZE                (-3905)
     2141/** Mismatching VM structure version between VMMR0 and VBoxVMM. */
     2142#define VINF_GVM_MISMATCH_VM_STRUCT_VER             (-3906)
     2143/** Mismatching SVN revision number between VMMR0 and VBoxVMM. */
     2144#define VINF_GVM_MISMATCH_SVN_REV                   (-3907)
    21372145/** @} */
    21382146
  • trunk/include/VBox/types.h

    r107200 r107893  
    267267    VMSTATE_MAKE_32BIT_HACK = 0x7fffffff
    268268} VMSTATE;
     269
     270
     271/** The VM target platform architecture. */
     272typedef enum VMTARGET
     273{
     274    VMTARGET_INVALID = 0,
     275    VMTARGET_X86     = 0x8086,
     276    VMTARGET_ARMV8   = 0xaa64
     277} VMTARGET;
     278
     279/** @def VMTARGET_DEFAULT
     280 * The default target according to the VBOX_VMM_TARGET_X86 /
     281 * VBOX_VMM_TARGET_ARMV8 defines. */
     282#if defined(VBOX_VMM_TARGET_X86) || defined(DOXYGEN_RUNNING)
     283# define VMTARGET_DEFAULT   VMTARGET_X86
     284#elif defined(VBOX_VMM_TARGET_ARMV8)
     285# define VMTARGET_DEFAULT   VMTARGET_ARMV8
     286#endif
     287
    269288
    270289/** We need RTERR_STRICT_RC.  */
  • trunk/include/VBox/vmm/gvm.h

    r107113 r107893  
    6868    /** VCPU id (0 - (pVM->cCpus - 1). */
    6969    VMCPUID             idCpu;
    70     /** Padding. */
    71     uint32_t            uPadding0;
     70    /** The VM target platform architecture.
     71     * Same as GVM::enmTarget, VMCPU::enmTarget and VM::enmTarget.  */
     72    VMTARGET            enmTarget;
    7273
    7374    /** Handle to the EMT thread. */
     
    210211    PSUPDRVSESSION  pSession;
    211212    /** Number of Virtual CPUs, i.e. how many entries there are in aCpus.
    212      * Same same as VM::cCpus. */
     213     * Same as VM::cCpus. */
    213214    uint32_t        cCpus;
     215    /** The VM target platform architecture.
     216     * Same as VM::enmTarget. */
     217    VMTARGET        enmTarget;
    214218    /** Padding so gvmm starts on a 64 byte boundrary.   */
    215     uint8_t         abPadding[HC_ARCH_BITS == 32 ? 12 + 28 : 28];
     219    uint8_t         abPadding[HC_ARCH_BITS == 32 ? 12 + 24 : 24];
    216220
    217221    /** The GVMM per vm data. */
  • trunk/include/VBox/vmm/gvm.mac

    r107113 r107893  
    4343
    4444        .idCpu              resd 1
     45        .enmTarget          resd 1
    4546
    4647        alignb 8
     
    7980        .pSession           RTR0PTR_RES 1
    8081        .cCpus              resd 1
     82        .enmTarget          resd 1
    8183
    8284        alignb 64
  • trunk/include/VBox/vmm/gvmm.h

    r106061 r107893  
    219219GVMMR0DECL(int)     GVMMR0QueryConfig(PSUPDRVSESSION pSession, const char *pszName, uint64_t *pu64Value);
    220220
    221 GVMMR0DECL(int)     GVMMR0CreateVM(PSUPDRVSESSION pSession, uint32_t cCpus, PVMCC *ppVM);
     221GVMMR0DECL(int)     GVMMR0CreateVM(PSUPDRVSESSION pSession, VMTARGET enmTarget, uint32_t cCpus, PVMCC *ppVM);
    222222GVMMR0DECL(int)     GVMMR0InitVM(PGVM pGVM);
    223223GVMMR0DECL(void)    GVMMR0DoneInitVM(PGVM pGVM);
     
    262262    /** The support driver session. (IN) */
    263263    PSUPDRVSESSION  pSession;
     264    /** The VM's target arch.   */
     265    VMTARGET        enmTarget;
    264266    /** Number of virtual CPUs for the new VM. (IN) */
    265267    uint32_t        cCpus;
     268    /** Size of the VM structure. (IN) */
     269    uint32_t        cbVM;
     270    /** Size of the VMCPU structure. (IN) */
     271    uint32_t        cbVCpu;
     272    /** Structure version number (TBD). (IN) */
     273    uint32_t        uStructVersion;
     274    /** SVN revision. (IN) */
     275    uint32_t        uSvnRevision;
    266276    /** Pointer to the ring-3 mapping of the shared VM structure on return. (OUT) */
    267277    PVMR3           pVMR3;
     
    348358
    349359#ifdef IN_RING3
    350 VMMR3_INT_DECL(int)  GVMMR3CreateVM(PUVM pUVM, uint32_t cCpus, PSUPDRVSESSION pSession, PVM *ppVM, PRTR0PTR ppVMR0);
     360VMMR3_INT_DECL(int)  GVMMR3CreateVM(PUVM pUVM, VMTARGET enmTarget, uint32_t cCpus, PSUPDRVSESSION pSession,
     361                                    PVM *ppVM, PRTR0PTR ppVMR0);
    351362VMMR3_INT_DECL(int)  GVMMR3DestroyVM(PUVM pUVM, PVM pVM);
    352363VMMR3_INT_DECL(int)  GVMMR3RegisterVCpu(PVM pVM, VMCPUID idCpu);
  • trunk/include/VBox/vmm/vm.h

    r107650 r107893  
    201201    VMCPUID                 idCpu;
    202202#endif
    203 
     203    /** The VM target platform architecture.
     204     * Same as VM::enmTarget, GVM::enmTarget and GVMCPU::enmTarget. */
     205#ifdef IN_RING0
     206    VMTARGET                enmTargetUnsafe;
     207#else
     208    VMTARGET                enmTarget;
     209#endif
     210
     211#if HC_ARCH_BITS != 64
    204212    /** Align the structures below bit on a 64-byte boundary and make sure it starts
    205213     * at the same offset in both 64-bit and 32-bit builds.
     
    210218     *          following it (to grow into and align the struct size).
    211219     */
    212     uint8_t                 abAlignment1[64 - 6 * (HC_ARCH_BITS == 32 ? 4 : 8) - 8 - 4];
     220    uint8_t                 abAlignment1[64 - 6 * (HC_ARCH_BITS == 32 ? 4 : 8) - 8 - 4 - 4];
     221#endif
    213222    /** @} */
    214223
     
    13101319    uint32_t                    cCpus;
    13111320#endif
     1321    /** The VM target platform architecture. */
     1322#ifdef IN_RING0
     1323    VMTARGET                    enmTargetUnsafe;
     1324#else
     1325    VMTARGET                    enmTarget;
     1326#endif
    13121327    /** CPU excution cap (1-100) */
    13131328    uint32_t                    uCpuExecutionCap;
     
    13341349
    13351350    /** Alignment padding. */
    1336     uint8_t                     uPadding1[6];
     1351    uint8_t                     uPadding1[2];
    13371352
    13381353    /** @name Debugging
  • trunk/include/VBox/vmm/vm.mac

    r107113 r107893  
    6868    .hNativeThreadR0        RTR0PTR_RES 1
    6969    .hThread                RTR3PTR_RES 1
     70%ifdef IN_RING0
     71    .idCpuUnsafe            resd 1
     72    .enmTargetUnsafe        resd 1
     73%else
    7074    .idCpu                  resd 1
     75    .enmTarget              resd 1
     76%endif
    7177
    7278    alignb 64
     
    126132    .hSelfUnsafe            resd 1
    127133    .cCpusUnsafe            resd 1
     134    .enmTargetUnsafe        resd 1
    128135%else
    129136    .hSelf                  resd 1
    130137    .cCpus                  resd 1
     138    .enmTarget              resd 1
    131139%endif
    132140    .uCpuExecutionCap       resd 1
     
    137145    .fHMEnabled             resb 1
    138146
    139     .uPadding1              resb 6
    140 
     147    alignb 8
    141148    .hTraceBufR3            RTR3PTR_RES 1
    142149    .hTraceBufR0            RTR0PTR_RES 1
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