VirtualBox

Changeset 55899 in vbox for trunk/src/recompiler


Ignore:
Timestamp:
May 18, 2015 9:47:57 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
100356
Message:

PGM: Added an access origin to memory read & write calls that respects handlers. This will later be passed to the access handler, so that things like the page pool (and potentially others) can query IEM about instruction details when needed.

Location:
trunk/src/recompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r55493 r55899  
    832832    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    833833    { REMPARMDESC_FLAGS_INT,        sizeof(void *),             NULL },
    834     { REMPARMDESC_FLAGS_INT,        sizeof(size_t),             NULL }
     834    { REMPARMDESC_FLAGS_INT,        sizeof(size_t),             NULL },
     835    { REMPARMDESC_FLAGS_INT,        sizeof(PGMACCESSORIGIN),    NULL }
    835836};
    836837static const REMPARMDESC g_aArgsPGMPhysSimpleReadGCPtr[] =
     
    846847    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    847848    { REMPARMDESC_FLAGS_INT,        sizeof(const void *),       NULL },
    848     { REMPARMDESC_FLAGS_INT,        sizeof(size_t),             NULL }
     849    { REMPARMDESC_FLAGS_INT,        sizeof(size_t),             NULL },
     850    { REMPARMDESC_FLAGS_INT,        sizeof(PGMACCESSORIGIN),    NULL }
    849851};
    850852static const REMPARMDESC g_aArgsPGMChangeMode[] =
     
    864866{
    865867    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    866     { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL }
     868    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
     869    { REMPARMDESC_FLAGS_INT,        sizeof(PGMACCESSORIGIN),    NULL }
    867870};
    868871static const REMPARMDESC g_aArgsPGMR3PhysWriteU8[] =
     
    870873    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    871874    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    872     { REMPARMDESC_FLAGS_INT,        sizeof(uint8_t),            NULL }
     875    { REMPARMDESC_FLAGS_INT,        sizeof(uint8_t),            NULL },
     876    { REMPARMDESC_FLAGS_INT,        sizeof(PGMACCESSORIGIN),    NULL }
    873877};
    874878static const REMPARMDESC g_aArgsPGMR3PhysWriteU16[] =
     
    876880    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    877881    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    878     { REMPARMDESC_FLAGS_INT,        sizeof(uint16_t),           NULL }
     882    { REMPARMDESC_FLAGS_INT,        sizeof(uint16_t),           NULL },
     883    { REMPARMDESC_FLAGS_INT,        sizeof(PGMACCESSORIGIN),    NULL }
    879884};
    880885static const REMPARMDESC g_aArgsPGMR3PhysWriteU32[] =
     
    882887    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    883888    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    884     { REMPARMDESC_FLAGS_INT,        sizeof(uint32_t),           NULL }
     889    { REMPARMDESC_FLAGS_INT,        sizeof(uint32_t),           NULL },
     890    { REMPARMDESC_FLAGS_INT,        sizeof(PGMACCESSORIGIN),    NULL }
    885891};
    886892static const REMPARMDESC g_aArgsPGMR3PhysWriteU64[] =
     
    888894    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    889895    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    890     { REMPARMDESC_FLAGS_INT,        sizeof(uint64_t),           NULL }
     896    { REMPARMDESC_FLAGS_INT,        sizeof(uint64_t),           NULL },
     897    { REMPARMDESC_FLAGS_INT,        sizeof(PGMACCESSORIGIN),    NULL }
    891898};
    892899static const REMPARMDESC g_aArgsRTMemReallocTag[] =
  • trunk/src/recompiler/VBoxRecompiler.c

    r55493 r55899  
    35653565    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    35663566    VBOX_CHECK_ADDR(SrcGCPhys);
    3567     PGMPhysRead(cpu_single_env->pVM, SrcGCPhys, pvDst, cb);
     3567    PGMPhysRead(cpu_single_env->pVM, SrcGCPhys, pvDst, cb, PGMACCESSORIGIN_REM);
    35683568#ifdef VBOX_DEBUG_PHYS
    35693569    LogRel(("read(%d): %08x\n", cb, (uint32_t)SrcGCPhys));
     
    35833583    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    35843584    VBOX_CHECK_ADDR(SrcGCPhys);
    3585     val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys);
     3585    val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    35863586    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    35873587#ifdef VBOX_DEBUG_PHYS
     
    36023602    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    36033603    VBOX_CHECK_ADDR(SrcGCPhys);
    3604     val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys);
     3604    val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    36053605    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    36063606#ifdef VBOX_DEBUG_PHYS
     
    36213621    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    36223622    VBOX_CHECK_ADDR(SrcGCPhys);
    3623     val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys);
     3623    val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    36243624    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    36253625#ifdef VBOX_DEBUG_PHYS
     
    36403640    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    36413641    VBOX_CHECK_ADDR(SrcGCPhys);
    3642     val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys);
     3642    val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    36433643    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    36443644#ifdef VBOX_DEBUG_PHYS
     
    36593659    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    36603660    VBOX_CHECK_ADDR(SrcGCPhys);
    3661     val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys);
     3661    val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    36623662    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    36633663#ifdef VBOX_DEBUG_PHYS
     
    36783678    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    36793679    VBOX_CHECK_ADDR(SrcGCPhys);
    3680     val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys);
     3680    val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    36813681    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    36823682#ifdef VBOX_DEBUG_PHYS
     
    36973697    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    36983698    VBOX_CHECK_ADDR(SrcGCPhys);
    3699     val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys);
     3699    val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    37003700    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    37013701#ifdef VBOX_DEBUG_PHYS
     
    37163716    STAM_PROFILE_ADV_START(&gStatMemRead, a);
    37173717    VBOX_CHECK_ADDR(SrcGCPhys);
    3718     val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys);
     3718    val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM);
    37193719    STAM_PROFILE_ADV_STOP(&gStatMemRead, a);
    37203720#ifdef VBOX_DEBUG_PHYS
     
    37363736    STAM_PROFILE_ADV_START(&gStatMemWrite, a);
    37373737    VBOX_CHECK_ADDR(DstGCPhys);
    3738     PGMPhysWrite(cpu_single_env->pVM, DstGCPhys, pvSrc, cb);
     3738    PGMPhysWrite(cpu_single_env->pVM, DstGCPhys, pvSrc, cb, PGMACCESSORIGIN_REM);
    37393739    STAM_PROFILE_ADV_STOP(&gStatMemWrite, a);
    37403740#ifdef VBOX_DEBUG_PHYS
     
    37543754    STAM_PROFILE_ADV_START(&gStatMemWrite, a);
    37553755    VBOX_CHECK_ADDR(DstGCPhys);
    3756     PGMR3PhysWriteU8(cpu_single_env->pVM, DstGCPhys, val);
     3756    PGMR3PhysWriteU8(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM);
    37573757    STAM_PROFILE_ADV_STOP(&gStatMemWrite, a);
    37583758#ifdef VBOX_DEBUG_PHYS
     
    37723772    STAM_PROFILE_ADV_START(&gStatMemWrite, a);
    37733773    VBOX_CHECK_ADDR(DstGCPhys);
    3774     PGMR3PhysWriteU16(cpu_single_env->pVM, DstGCPhys, val);
     3774    PGMR3PhysWriteU16(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM);
    37753775    STAM_PROFILE_ADV_STOP(&gStatMemWrite, a);
    37763776#ifdef VBOX_DEBUG_PHYS
     
    37903790    STAM_PROFILE_ADV_START(&gStatMemWrite, a);
    37913791    VBOX_CHECK_ADDR(DstGCPhys);
    3792     PGMR3PhysWriteU32(cpu_single_env->pVM, DstGCPhys, val);
     3792    PGMR3PhysWriteU32(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM);
    37933793    STAM_PROFILE_ADV_STOP(&gStatMemWrite, a);
    37943794#ifdef VBOX_DEBUG_PHYS
     
    38083808    STAM_PROFILE_ADV_START(&gStatMemWrite, a);
    38093809    VBOX_CHECK_ADDR(DstGCPhys);
    3810     PGMR3PhysWriteU64(cpu_single_env->pVM, DstGCPhys, val);
     3810    PGMR3PhysWriteU64(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM);
    38113811    STAM_PROFILE_ADV_STOP(&gStatMemWrite, a);
    38123812#ifdef VBOX_DEBUG_PHYS
     
    38913891    uint8_t u8;
    38923892    Log2(("remR3HandlerReadU8: GCPhys=%RGp\n", (RTGCPHYS)GCPhys));
    3893     PGMPhysRead((PVM)pvVM, GCPhys, &u8, sizeof(u8));
     3893    PGMPhysRead((PVM)pvVM, GCPhys, &u8, sizeof(u8), PGMACCESSORIGIN_REM);
    38943894    return u8;
    38953895}
     
    38993899    uint16_t u16;
    39003900    Log2(("remR3HandlerReadU16: GCPhys=%RGp\n", (RTGCPHYS)GCPhys));
    3901     PGMPhysRead((PVM)pvVM, GCPhys, &u16, sizeof(u16));
     3901    PGMPhysRead((PVM)pvVM, GCPhys, &u16, sizeof(u16), PGMACCESSORIGIN_REM);
    39023902    return u16;
    39033903}
     
    39073907    uint32_t u32;
    39083908    Log2(("remR3HandlerReadU32: GCPhys=%RGp\n", (RTGCPHYS)GCPhys));
    3909     PGMPhysRead((PVM)pvVM, GCPhys, &u32, sizeof(u32));
     3909    PGMPhysRead((PVM)pvVM, GCPhys, &u32, sizeof(u32), PGMACCESSORIGIN_REM);
    39103910    return u32;
    39113911}
     
    39143914{
    39153915    Log2(("remR3HandlerWriteU8: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32));
    3916     PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint8_t));
     3916    PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint8_t), PGMACCESSORIGIN_REM);
    39173917}
    39183918
     
    39203920{
    39213921    Log2(("remR3HandlerWriteU16: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32));
    3922     PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint16_t));
     3922    PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint16_t), PGMACCESSORIGIN_REM);
    39233923}
    39243924
     
    39263926{
    39273927    Log2(("remR3HandlerWriteU32: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32));
    3928     PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint32_t));
     3928    PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint32_t), PGMACCESSORIGIN_REM);
    39293929}
    39303930
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