VirtualBox

Changeset 92523 in vbox


Ignore:
Timestamp:
Nov 20, 2021 11:35:37 PM (3 years ago)
Author:
vboxsync
Message:

VMMDev,ValKit/Bootsectors: Moved the VMMDevTesting MMIO page from 0x101000 to 0xdf000 so it doesn't cause trouble for KVM memory registrations (too simple at this point). This also simplifies access from real-mode a bit. bugref:9044

Location:
trunk
Files:
6 edited

Legend:

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

    r92258 r92523  
    4040
    4141/** The base address of the MMIO range used for testing.
    42  * This is intentionally put at the 2nd page above 1M so that it can be
    43  * accessed from both real (!A20) and protected mode. */
    44 #define VMMDEV_TESTING_MMIO_BASE        UINT32_C(0x00101000)
     42 * @remarks This used to be at 0x101000 but moved to 0xdf000 so that it would
     43 *          work better with prototype NEM code.  This also means enabling A20
     44 *          is not a requirement. */
     45#define VMMDEV_TESTING_MMIO_BASE        UINT32_C(0x000df000)
    4546/** The size of the MMIO range used for testing.  */
    4647#define VMMDEV_TESTING_MMIO_SIZE        UINT32_C(0x00001000)
     
    6667#define VMMDEV_TESTING_MMIO_READBACK_R3     (VMMDEV_TESTING_MMIO_BASE + VMMDEV_TESTING_MMIO_OFF_READBACK_R3)
    6768
    68 /** The real mode selector to use.
    69  * @remarks Requires that the A20 gate is enabled. */
    70 #define VMMDEV_TESTING_MMIO_RM_SEL       0xffff
     69/** The real mode selector to use. */
     70#define VMMDEV_TESTING_MMIO_RM_SEL          0xdf00
    7171/** Calculate the real mode offset of a MMIO register. */
    72 #define VMMDEV_TESTING_MMIO_RM_OFF(val)  ((val) - 0xffff0)
     72#define VMMDEV_TESTING_MMIO_RM_OFF(val)     ((val) - VMMDEV_TESTING_MMIO_BASE)
    7373/** Calculate the real mode offset of a MMIO register offset. */
    74 #define VMMDEV_TESTING_MMIO_RM_OFF2(off) ((off) + 16 + 0x1000)
     74#define VMMDEV_TESTING_MMIO_RM_OFF2(off)    (off)
    7575
    7676/** The base port of the I/O range used for testing. */
  • trunk/include/VBox/VMMDevTesting.mac

    r82968 r92523  
    2929%ifndef RT_WITHOUT_PRAGMA_ONCE
    3030%endif
    31 %define VMMDEV_TESTING_MMIO_BASE        0x00101000
     31%define VMMDEV_TESTING_MMIO_BASE        0x000df000
    3232%define VMMDEV_TESTING_MMIO_SIZE        0x00001000
    3333%define VMMDEV_TESTING_MMIO_OFF_NOP         (0x000)
     
    4040%define VMMDEV_TESTING_MMIO_READBACK        (VMMDEV_TESTING_MMIO_BASE + VMMDEV_TESTING_MMIO_OFF_READBACK)
    4141%define VMMDEV_TESTING_MMIO_READBACK_R3     (VMMDEV_TESTING_MMIO_BASE + VMMDEV_TESTING_MMIO_OFF_READBACK_R3)
    42 %define VMMDEV_TESTING_MMIO_RM_SEL       0xffff
    43 %define VMMDEV_TESTING_MMIO_RM_OFF(val)  ((val) - 0xffff0)
    44 %define VMMDEV_TESTING_MMIO_RM_OFF2(off) ((off) + 16 + 0x1000)
     42%define VMMDEV_TESTING_MMIO_RM_SEL       0xdf00
     43%define VMMDEV_TESTING_MMIO_RM_OFF(val)  ((val) - VMMDEV_TESTING_MMIO_BASE)
     44%define VMMDEV_TESTING_MMIO_RM_OFF2(off) (off)
    4545%define VMMDEV_TESTING_IOPORT_BASE      0x0510
    4646%define VMMDEV_TESTING_IOPORT_COUNT     0x0010
  • trunk/src/VBox/ValidationKit/bootsectors/bootsector2-cpu-a20-1-template.mac

    r82968 r92523  
    164164        mov     esi, 00000h
    165165        mov     ds, ax
    166         mov     ecx, 01000h             ; at 101000 there is a VMMDevTesting MMIO page.
     166        mov     ecx, 01000h             ; at 101000 there was a VMMDevTesting MMIO page.
    167167%elifdef TMPL_16BIT
    168168        ;; @todo need a selector we can modify.
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-fpustate-1-template.c

    r83329 r92523  
    165165    /* Figure out which MMIO region we'll be using so we can correctly initialize FPUDS. */
    166166# if BS3_MODE_IS_RM_OR_V86(TMPL_MODE)
    167     MmioReg.pv = BS3_FP_MAKE(0xffff, VMMDEV_TESTING_MMIO_BASE - _1M + 16);
     167    MmioReg.pv = BS3_FP_MAKE(VMMDEV_TESTING_MMIO_RM_SEL, VMMDEV_TESTING_MMIO_RM_OFF2(0));
    168168# elif BS3_MODE_IS_16BIT_CODE(TMPL_MODE)
    169     MmioReg.pv = BS3_FP_MAKE(BS3_SEL_VMMDEV_MMIO16, VMMDEV_TESTING_MMIO_BASE - _1M);
     169    MmioReg.pv = BS3_FP_MAKE(BS3_SEL_VMMDEV_MMIO16, 0);
    170170# else
    171171    MmioReg.pv = (uint8_t *)VMMDEV_TESTING_MMIO_BASE;
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-system-data.asm

    r82968 r92523  
    189189        dw  09f00h, 00000h
    190190BS3_GLOBAL_DATA Bs3Gdte_R0_MMIO16, 8            ; Entry 0f8h
    191         dw  0ffffh, 00000h, 09310h, 00000h      ; 16-bit VMMDev MMIO segment with base 0100000h.
     191        dw  0ffffh, 0f000h, 0930dh, 00000h      ; 16-bit VMMDev MMIO segment with base 0100000h.
    192192BS3GdtAssertOffset 0100h
    193193
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r92262 r92523  
    348348#define BS3_SEL_X0TEXT16_CS         0x00e8 /**< Conforming code selector for accessing the BS3X0TEXT16 segment. Runtime config. */
    349349#define BS3_SEL_X1TEXT16_CS         0x00f0 /**< Conforming code selector for accessing the BS3X1TEXT16 segment. Runtime config. */
    350 #define BS3_SEL_VMMDEV_MMIO16       0x00f8 /**< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. */
     350#define BS3_SEL_VMMDEV_MMIO16       0x00f8 /**< Selector for accessing the VMMDev MMIO segment at 00df000h from 16-bit code. */
    351351
    352352/** Checks if @a uSel is in the BS3_SEL_RX_XXX range. */
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