VirtualBox

Changeset 107227 in vbox for trunk/include/VBox/vmm/vm.h


Ignore:
Timestamp:
Dec 4, 2024 3:20:14 PM (6 weeks ago)
Author:
vboxsync
Message:

VMM: Cleaning up ARMv8 / x86 split. jiraref:VBP-1470

File:
1 edited

Legend:

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

    r107113 r107227  
    5656# pragma D depends_on library CPUMInternal.d
    5757# define VMM_INCLUDED_SRC_include_CPUMInternal_h
     58# define VBOX_VMM_TARGET_AGNOSTIC
     59#endif
     60
     61#if !defined(VBOX_VMM_TARGET_AGNOSTIC) \
     62 && !defined(VBOX_VMM_TARGET_X86) \
     63 && !defined(VBOX_VMM_TARGET_ARMV8)
     64# error "VMM target not defined"
    5865#endif
    5966
     
    130137    VMCPUSTATE volatile     enmState;
    131138
    132 #if defined(VBOX_VMM_TARGET_ARMV8)
     139#ifdef VBOX_VMM_TARGET_ARMV8
    133140    uint32_t                u32Alignment0;
    134141    /** The number of nano seconds when the vTimer of the associated vCPU is supposed to activate
     
    288295    } gim;
    289296
    290 #if defined(VBOX_VMM_TARGET_ARMV8)
    291     /** GIC part. */
    292     union VMCPUUNIONGIC
    293     {
     297    /* Interrupt controller, target specific. */
     298    RT_GCC_EXTENSION
     299    union
     300    {
     301#if defined(VBOX_VMM_TARGET_ARMV8) || defined(VBOX_VMM_TARGET_AGNOSTIC)
     302        /** GIC part. */
     303        union
     304        {
    294305# ifdef VMM_INCLUDED_SRC_include_GICInternal_h
    295         struct GICCPU       s;
     306            struct GICCPU       s;
    296307# endif
    297         uint8_t             padding[3840];      /* multiple of 64 */
    298     } gic;
    299 #else
    300     /** APIC part. */
    301     union VMCPUUNIONAPIC
    302     {
     308            uint8_t             padding[3840];      /* multiple of 64 */
     309        } gic;
     310#endif
     311#if defined(VBOX_VMM_TARGET_X86) || defined(VBOX_VMM_TARGET_AGNOSTIC)
     312        /** APIC part. */
     313        union
     314        {
    303315# ifdef VMM_INCLUDED_SRC_include_APICInternal_h
    304         struct APICCPU      s;
     316            struct APICCPU      s;
    305317# endif
    306         uint8_t             padding[3840];      /* multiple of 64 */
    307     } apic;
    308 #endif
     318            uint8_t             padding[3840];      /* multiple of 64 */
     319        } apic;
     320#endif
     321    };
    309322
    310323    /*
     
    483496
    484497
    485 #if defined(VBOX_VMM_TARGET_ARMV8)
     498#if defined(VBOX_VMM_TARGET_ARMV8) || defined(VBOX_VMM_TARGET_AGNOSTIC)
    486499/** This action forces the VM to inject an IRQ into the guest. */
    487500# define VMCPU_FF_INTERRUPT_IRQ             RT_BIT_64(VMCPU_FF_INTERRUPT_IRQ_BIT)
     
    490503# define VMCPU_FF_INTERRUPT_FIQ             RT_BIT_64(VMCPU_FF_INTERRUPT_FIQ_BIT)
    491504# define VMCPU_FF_INTERRUPT_FIQ_BIT         1
    492 #else
     505#endif
     506#if defined(VBOX_VMM_TARGET_X86) || defined(VBOX_VMM_TARGET_AGNOSTIC)
    493507/** This action forces the VM to check any pending interrupts on the APIC. */
    494508# define VMCPU_FF_INTERRUPT_APIC            RT_BIT_64(VMCPU_FF_INTERRUPT_APIC_BIT)
     
    541555#define VMCPU_FF_HM_UPDATE_CR3              RT_BIT_64(VMCPU_FF_HM_UPDATE_CR3_BIT)
    542556#define VMCPU_FF_HM_UPDATE_CR3_BIT          12
    543 #if defined(VBOX_VMM_TARGET_ARMV8)
     557#if defined(VBOX_VMM_TARGET_ARMV8) || defined(VBOX_VMM_TARGET_AGNOSTIC)
    544558# define VMCPU_FF_VTIMER_ACTIVATED          RT_BIT_64(VMCPU_FF_VTIMER_ACTIVATED_BIT)
    545559# define VMCPU_FF_VTIMER_ACTIVATED_BIT      13
    546 #else
     560#endif
     561#if defined(VBOX_VMM_TARGET_X86) || defined(VBOX_VMM_TARGET_AGNOSTIC)
    547562/* Bit 13 used to be VMCPU_FF_HM_UPDATE_PAE_PDPES. */
    548563#endif
     
    618633#define VM_FF_EXTERNAL_HALTED_MASK              (  VM_FF_CHECK_VM_STATE | VM_FF_DBGF    | VM_FF_REQUEST \
    619634                                                 | VM_FF_PDM_QUEUES     | VM_FF_PDM_DMA | VM_FF_EMT_RENDEZVOUS )
     635
     636#ifndef VBOX_VMM_TARGET_AGNOSTIC
    620637/** Externally forced VMCPU actions. Used to quit the idle/wait loop. */
    621 #if defined(VBOX_VMM_TARGET_ARMV8)
    622 # define VMCPU_FF_EXTERNAL_HALTED_MASK          (  VMCPU_FF_INTERRUPT_IRQ | VMCPU_FF_INTERRUPT_FIQ \
     638# if defined(VBOX_VMM_TARGET_ARMV8)
     639#  define VMCPU_FF_EXTERNAL_HALTED_MASK         (  VMCPU_FF_INTERRUPT_IRQ | VMCPU_FF_INTERRUPT_FIQ \
    623640                                                 | VMCPU_FF_REQUEST       | VMCPU_FF_INTERRUPT_NMI  | VMCPU_FF_INTERRUPT_SMI \
    624641                                                 | VMCPU_FF_UNHALT        | VMCPU_FF_TIMER          | VMCPU_FF_DBGF \
    625642                                                 | VMCPU_FF_VTIMER_ACTIVATED)
    626 #else
    627 # define VMCPU_FF_EXTERNAL_HALTED_MASK          (  VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC \
     643# else
     644#  define VMCPU_FF_EXTERNAL_HALTED_MASK         (  VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC \
    628645                                                 | VMCPU_FF_REQUEST     | VMCPU_FF_INTERRUPT_NMI  | VMCPU_FF_INTERRUPT_SMI \
    629646                                                 | VMCPU_FF_UNHALT      | VMCPU_FF_TIMER          | VMCPU_FF_DBGF \
    630647                                                 | VMCPU_FF_INTERRUPT_NESTED_GUEST)
     648# endif
    631649#endif
    632650
     
    635653                                                 | VM_FF_DEBUG_SUSPEND  | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY \
    636654                                                 | VM_FF_EMT_RENDEZVOUS )
     655#ifndef VBOX_VMM_TARGET_AGNOSTIC
    637656/** High priority VMCPU pre-execution actions. */
    638 #if defined(VBOX_VMM_TARGET_ARMV8)
    639 # define VMCPU_FF_HIGH_PRIORITY_PRE_MASK        (  VMCPU_FF_TIMER        | VMCPU_FF_INTERRUPT_IRQ     | VMCPU_FF_INTERRUPT_FIQ \
     657# if defined(VBOX_VMM_TARGET_ARMV8)
     658#  define VMCPU_FF_HIGH_PRIORITY_PRE_MASK       (  VMCPU_FF_TIMER        | VMCPU_FF_INTERRUPT_IRQ     | VMCPU_FF_INTERRUPT_FIQ \
    640659                                                 | VMCPU_FF_DBGF )
    641 #else
    642 # define VMCPU_FF_HIGH_PRIORITY_PRE_MASK        (  VMCPU_FF_TIMER        | VMCPU_FF_INTERRUPT_APIC     | VMCPU_FF_INTERRUPT_PIC \
     660# else
     661#  define VMCPU_FF_HIGH_PRIORITY_PRE_MASK       (  VMCPU_FF_TIMER        | VMCPU_FF_INTERRUPT_APIC     | VMCPU_FF_INTERRUPT_PIC \
    643662                                                 | VMCPU_FF_UPDATE_APIC  | VMCPU_FF_DBGF \
    644663                                                 | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL \
    645664                                                 | VMCPU_FF_INTERRUPT_NESTED_GUEST | VMCPU_FF_VMX_MTF  | VMCPU_FF_VMX_APIC_WRITE \
    646665                                                 | VMCPU_FF_VMX_PREEMPT_TIMER | VMCPU_FF_VMX_NMI_WINDOW | VMCPU_FF_VMX_INT_WINDOW )
     666# endif
    647667#endif
    648668
     
    685705#endif
    686706
    687 #if !defined(VBOX_VMM_TARGET_ARMV8)
     707#if defined(VBOX_VMM_TARGET_X86) || defined(VBOX_VMM_TARGET_AGNOSTIC)
    688708/** VMCPU flags that cause the REP[|NE|E] STRINS loops to yield, interrupts
    689709 *  enabled. */
     
    15041524    } gim;
    15051525
    1506 #if defined(VBOX_VMM_TARGET_ARMV8)
    1507     union
    1508     {
     1526    /** Interrupt controller, target specific. */
     1527    RT_GCC_EXTENSION
     1528    union
     1529    {
     1530#if defined(VBOX_VMM_TARGET_ARMV8) || defined(VBOX_VMM_TARGET_AGNOSTIC)
     1531        union
     1532        {
    15091533# ifdef VMM_INCLUDED_SRC_include_GICInternal_h
    1510         struct GIC  s;
     1534            struct GIC  s;
    15111535# endif
    1512         uint8_t     padding[128];       /* multiple of 8 */
    1513     } gic;
    1514 #else
    1515     union
    1516     {
     1536            uint8_t     padding[128];   /* multiple of 8 */
     1537        } gic;
     1538#endif
     1539#if defined(VBOX_VMM_TARGET_X86) || defined(VBOX_VMM_TARGET_AGNOSTIC)
     1540        union
     1541        {
    15171542# ifdef VMM_INCLUDED_SRC_include_APICInternal_h
    1518         struct APIC s;
     1543            struct APIC s;
    15191544# endif
    1520         uint8_t     padding[128];       /* multiple of 8 */
    1521     } apic;
    1522 #endif
     1545            uint8_t     padding[128];   /* multiple of 8 */
     1546        } apic;
     1547#endif
     1548    };
    15231549
    15241550    /* ---- begin small stuff ---- */
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