VirtualBox

Changeset 93593 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Feb 3, 2022 9:05:05 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149730
Message:

VMM: Embedded the zero and mmio-dummy pages into the VM structure and realigned it for a 16384 page size. bugref:9898

Location:
trunk/include/VBox/vmm
Files:
4 edited

Legend:

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

    r93115 r93593  
    133133    /** Padding the structure size to page boundrary. */
    134134#ifdef VBOX_WITH_NEM_R0
    135     uint8_t                 abPadding3[4096 - 64*2 - 256 - 1024 - 64 - 896 - 64];
     135    uint8_t                 abPadding3[16384 - 64*2 - 256 - 1024 - 64 - 896 - 64];
    136136#else
    137     uint8_t                 abPadding3[4096 - 64*2 - 256 - 1024 - 896 - 64];
     137    uint8_t                 abPadding3[16384 - 64*2 - 256 - 1024 - 896 - 64];
    138138#endif
    139139} GVMCPU;
     
    144144# pragma GCC diagnostic ignored "-Winvalid-offsetof"
    145145#endif
    146 AssertCompileMemberAlignment(GVMCPU, idCpu,  4096);
     146AssertCompileMemberAlignment(GVMCPU, idCpu,  16384);
    147147AssertCompileMemberAlignment(GVMCPU, gvmm,   64);
    148148#ifdef VBOX_WITH_NEM_R0
    149149AssertCompileMemberAlignment(GVMCPU, nemr0,  64);
    150150#endif
    151 AssertCompileSizeAlignment(GVMCPU,           4096);
     151AssertCompileSizeAlignment(GVMCPU,           16384);
    152152#if RT_GNUC_PREREQ(4, 6) && defined(__cplusplus)
    153153# pragma GCC diagnostic pop
     
    300300    /** Padding so aCpus starts on a page boundrary.  */
    301301#ifdef VBOX_WITH_NEM_R0
    302     uint8_t         abPadding2[4096*2 - 64 - 256 - 256 - 1024 - 256 - 64 - 2176 - 640 - 512 - 64 - 1024 - 128 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
     302    uint8_t         abPadding2[16384 - 64 - 4352 - 1024 - 256 - 256 - 64 - 2176 - 640 - 512 - 64 - 1024 - 128 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
    303303#else
    304     uint8_t         abPadding2[4096*2 - 64 - 256 - 256 - 1024       - 64 - 2176 - 640 - 512 - 64 - 1024 - 128 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
     304    uint8_t         abPadding2[16384 - 64 - 4352 - 1024 - 256 -     - 64 - 2176 - 640 - 512 - 64 - 1024 - 128 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
    305305#endif
    306306
     
    326326AssertCompileMemberAlignment(GVM, rawpci,   64);
    327327AssertCompileMemberAlignment(GVM, pdmr0,    64);
    328 AssertCompileMemberAlignment(GVM, aCpus,    4096);
    329 AssertCompileSizeAlignment(GVM,             4096);
     328AssertCompileMemberAlignment(GVM, aCpus,    16384);
     329AssertCompileSizeAlignment(GVM,             16384);
    330330#if RT_GNUC_PREREQ(4, 6) && defined(__cplusplus)
    331331# pragma GCC diagnostic pop
  • trunk/include/VBox/vmm/gvm.mac

    r93115 r93593  
    3131struc GVMCPU
    3232        .s                  resb VMCPU_size
     33
    3334        .idCpu              resd 1
    3435
     
    5455        alignb 64
    5556        .pgmr0              resb 64
    56         alignb 4096
     57        alignb 16384
    5758endstruc
    5859
     
    6061struc GVM
    6162        .s                  resb VM_size
     63
    6264        .u32Magic           resd 1
    6365        .hSelf              resd 1
     
    9395        .tmr0               resb 128
    9496
    95         times ((($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB + 4095) & ~4095) - ($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB)) resb 1
     97        times ((($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB + 16383) & ~16383) - ($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB)) resb 1
    9698        .apCpusR0           RTR0PTR_RES VMM_MAX_CPU_COUNT
    9799
    98         alignb 4096
     100        alignb 16384
    99101        .aCpus              resb GVMCPU_size
    100102endstruc
  • trunk/include/VBox/vmm/vm.h

    r93115 r93593  
    316316        uint8_t             padding[40960];      /* multiple of 4096 */
    317317    } em;
     318
     319    /** Align the structure size on 16384 boundrary for arm64 purposes. */
     320    uint8_t                 abStructPadding[4096];
    318321} VMCPU;
    319322
    320323
    321324#ifndef VBOX_FOR_DTRACE_LIB
    322 AssertCompileSizeAlignment(VMCPU, 4096);
     325AssertCompileSizeAlignment(VMCPU, 16384);
    323326
    324327/** @name Operations on VMCPU::enmState
     
    12561259        /** @todo this is rather bloated because of static MSR range allocation.
    12571260         *        Probably a good idea to move it to a separate R0 allocation... */
    1258         uint8_t     padding[8832 + 128*8192];    /* multiple of 64 */
     1261        uint8_t     padding[8832 + 128*8192 + 0x1d00]; /* multiple of 64 */
    12591262    } cpum;
     1263
     1264    /** PGM part.
     1265     * @note 16384 aligned for zero and mmio page storage. */
     1266    union
     1267    {
     1268#ifdef VMM_INCLUDED_SRC_include_PGMInternal_h
     1269        struct PGM  s;
     1270#endif
     1271        uint8_t     padding[53888];     /* multiple of 64 */
     1272    } pgm;
    12601273
    12611274    /** VMM part. */
     
    12671280        uint8_t     padding[1600];      /* multiple of 64 */
    12681281    } vmm;
    1269 
    1270     /** PGM part. */
    1271     union
    1272     {
    1273 #ifdef VMM_INCLUDED_SRC_include_PGMInternal_h
    1274         struct PGM  s;
    1275 #endif
    1276         uint8_t     padding[21120];     /* multiple of 64 */
    1277     } pgm;
    12781282
    12791283    /** HM part. */
     
    14541458
    14551459    /** Padding for aligning the structure size on a page boundrary. */
    1456     uint8_t         abAlignment2[1752 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
     1460    uint8_t         abAlignment2[6616 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    14571461
    14581462    /* ---- end small stuff ---- */
     
    14601464    /** Array of VMCPU ring-3 pointers. */
    14611465    PVMCPUR3        apCpusR3[VMM_MAX_CPU_COUNT];
     1466
     1467    /* This point is aligned on a 16384 boundrary (for arm64 purposes). */
    14621468} VM;
     1469#ifndef VBOX_FOR_DTRACE_LIB
     1470AssertCompileSizeAlignment(VM, 16384);
     1471#endif
    14631472
    14641473
  • trunk/include/VBox/vmm/vm.mac

    r93115 r93593  
    9595    alignb 4096
    9696    .em                     resb 40960
    97     alignb 4096
     97    alignb 16384
    9898endstruc
    9999
     
    130130    alignb 64
    131131    .cpum                   resb 8832 + 128*8192
     132    alignb 16384
     133    .pgm                    resb 53888
    132134    alignb 64
    133135    .vmm                    resb 1600
    134     alignb 64
    135     .pgm                    resb 21120
    136136    alignb 64
    137137    .hm                     resb 5504
     
    165165    .R0Stats                resb 64
    166166
    167     times ((($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB + 4095) & ~4095) - ($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB)) resb 1
     167    times ((($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB + 16383) & ~16383) - ($ + VMM_MAX_CPU_COUNT * RTR0PTR_CB)) resb 1
    168168    .apCpusR3               RTR3PTR_RES VMM_MAX_CPU_COUNT
    169     alignb 4096
     169    alignb 16384
    170170
    171171endstruc
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