VirtualBox

Changeset 14974 in vbox


Ignore:
Timestamp:
Dec 4, 2008 12:45:43 PM (16 years ago)
Author:
vboxsync
Message:

reenabled VA in TLB code

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r14969 r14974  
    932932VMMDECL(int) PGMPhysGCPhys2R3PtrEx(PVM pVM, RTGCPHYS GCPhys, RTGCPTR GCPtr, uint32_t flags, PRTR3PTR pR3Ptr)
    933933{
    934   RTR3PTR va;
    935934  int rc;
    936935
    937   if (flags & PGMPHYS_TRANSLATION_FLAG_CHECK_PHYS_MONITORED)
     936  rc = PGMPhysGCPhys2R3Ptr(pVM, GCPhys, 1, pR3Ptr);
     937
     938  if (RT_SUCCESS(rc) && (flags & PGMPHYS_TRANSLATION_FLAG_CHECK_PHYS_MONITORED))
    938939  {
    939940    /* Check if there's a physical handler for PA */
    940941      if (PGMHandlerPhysicalIsRegistered(pVM, GCPhys))
    941         return VERR_PGM_PHYS_PAGE_RESERVED;
     942        rc = VERR_PGM_PHYS_PAGE_RESERVED;
    942943  }
    943944
    944   if (flags & PGMPHYS_TRANSLATION_FLAG_CHECK_VIRT_MONITORED)
     945  if (RT_SUCCESS(rc) && (flags & PGMPHYS_TRANSLATION_FLAG_CHECK_VIRT_MONITORED))
    945946  {
    946947    /* Check if there's a virtual handler for VA */
    947948    if (PGMHandlerVirtualIsRegistered(pVM, GCPtr))
    948         return VERR_PGM_PHYS_PAGE_RESERVED;
     949        rc = VERR_PGM_PHYS_PAGE_RESERVED;
    949950  }
    950 
    951   rc = PGMPhysGCPhys2R3Ptr(pVM, GCPhys, 1, &va);
    952  
    953   if (RT_FAILURE(rc))
    954       return rc;
    955 
    956   *pR3Ptr = va;
    957951
    958952  return rc;
  • trunk/src/recompiler_new/Makefile.kmk

    r14971 r14974  
    7070#
    7171$(REM_MOD)_DEFS             = IN_REM_R3 REM_INCLUDE_CPU_H
    72 $(REM_MOD)_DEFS            += REM_PHYS_ADDR_IN_TLB
     72#$(REM_MOD)_DEFS            += REM_PHYS_ADDR_IN_TLB
    7373$(REM_MOD)_DEFS            += VBOX_WITH_NEW_RECOMPILER
    7474#$(REM_MOD)_DEFS           += DEBUG_ALL_LOGGING DEBUG_DISAS DEBUG_PCALL DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB  # Enables huge amounts of debug logging.
  • trunk/src/recompiler_new/VBoxRecompiler.c

    r14969 r14974  
    638638    }
    639639    else
    640     {
    641         AssertMsgFailed(("Damn, this shouldn't happen! cpu_exec returned %d while singlestepping\n", rc));
     640    {       
    642641        switch (rc)
    643642        {
     
    14041403    if (rc == VERR_PGM_PHYS_PAGE_RESERVED)
    14051404    {
    1406       return (void*)-1;
     1405        rv = (void*)((uintptr_t)rv | 1);
     1406        rc = 0;
    14071407    }
    14081408    Assert (RT_SUCCESS(rc));
  • trunk/src/recompiler_new/exec.c

    r14969 r14974  
    19721972{
    19731973    unsigned long addr;
     1974
     1975#ifdef VBOX
     1976    if (start & 1)
     1977        return;
     1978#endif
    19741979    if ((tlb_entry->addr_write & ~TARGET_PAGE_MASK) == IO_MEM_RAM) {
    19751980        addr = (tlb_entry->addr_write & TARGET_PAGE_MASK) + tlb_entry->addend;
     
    21932198
    21942199    code_address = address;
     2200
     2201#ifdef VBOX
     2202#  if !defined(REM_PHYS_ADDR_IN_TLB)
     2203    if (addend & 0x1)
     2204    {
     2205        addend &= ~(target_ulong)0x1;
     2206        if ((pd & ~TARGET_PAGE_MASK) == IO_MEM_RAM)
     2207        {
     2208            address |= TLB_MMIO;
     2209            iotlb = (pd & ~TARGET_PAGE_MASK) + paddr +env->pVM->rem.s.iHandlerMemType;
     2210        }
     2211    }
     2212#  endif
     2213#endif
     2214
    21952215    /* Make accesses to pages with watchpoints go via the
    21962216       watchpoint trap routines.  */
     
    22032223        }
    22042224    }
    2205 
    2206 #ifdef VBOX
    2207 #  if !defined(REM_PHYS_ADDR_IN_TLB)
    2208     if (addend == (target_phys_addr_t)-1)
    2209     {
    2210          address |= TLB_MMIO;
    2211          iotlb = (pd & ~TARGET_PAGE_MASK) + paddr +env->pVM->rem.s.iHandlerMemType;
    2212     }
    2213 #  endif
    2214 #endif
    22152225
    22162226    index = (vaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
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