VirtualBox

Changeset 12760 in vbox


Ignore:
Timestamp:
Sep 26, 2008 10:10:38 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37088
Message:

EMAll: Disabled the assertions reported in bug #2609, bug #1931 and on #innotek.

File:
1 edited

Legend:

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

    r12688 r12760  
    4646#include <iprt/asm.h>
    4747#include <iprt/string.h>
     48
     49
     50/*******************************************************************************
     51*   Defined Constants And Macros                                               *
     52*******************************************************************************/
     53/** @def EM_ASSERT_FAULT_RETURN
     54 * Safety check.
     55 *
     56 * Could in theory it misfire on a cross page boundary access...
     57 *
     58 * Currently disabled because the CSAM (+ PATM) patch monitoring occationally
     59 * turns up an alias page instead of the original faulting one and annoying the
     60 * heck out of anyone running a debug build. See @bugref{2609} and @bugref{1931}.
     61 */
     62#if 0
     63# define EM_ASSERT_FAULT_RETURN(expr, rc) AssertReturn(expr, rc)
     64#else
     65# define EM_ASSERT_FAULT_RETURN(expr, rc) do { } while (0)
     66#endif
    4867
    4968
     
    444463                pParam1 = (RTGCPTR)param1.val.val64;
    445464                pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1);
    446 #ifdef IN_GC
    447                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    448                 AssertReturn(pParam1 == pvFault, VERR_EM_INTERPRETER);
    449 #endif
     465                EM_ASSERT_FAULT_RETURN(pParam1 == pvFault, VERR_EM_INTERPRETER);
    450466                rc = emRamRead(pVM, &valpar1, pParam1, param1.size);
    451467                if (VBOX_FAILURE(rc))
     
    466482                pParam2 = (RTGCPTR)param2.val.val64;
    467483                pParam2 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param2, pParam2);
    468 #ifdef IN_GC
    469                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    470                 AssertReturn(pParam2 == pvFault, VERR_EM_INTERPRETER);
    471 #endif
     484                EM_ASSERT_FAULT_RETURN(pParam2 == pvFault, VERR_EM_INTERPRETER);
    472485                rc = emRamRead(pVM,  &valpar2, pParam2, param2.size);
    473486                if (VBOX_FAILURE(rc))
     
    667680
    668681                pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1);
    669 
    670 #ifdef IN_GC
    671                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    672                 AssertMsgReturn(pParam1 == pvFault || (RTGCPTR)pRegFrame->esp == pvFault, ("%VGv != %VGv ss:esp=%04X:%08x\n", pParam1, pvFault, pRegFrame->ss, pRegFrame->esp), VERR_EM_INTERPRETER);
    673 #endif
     682                EM_ASSERT_FAULT_RETURN(pParam1 == pvFault || (RTGCPTR)pRegFrame->esp == pvFault, VERR_EM_INTERPRETER);
    674683                rc = emRamWrite(pVM, pParam1, &valpar1, param1.size);
    675684                if (VBOX_FAILURE(rc))
     
    742751                pParam1 = (RTGCPTR)param1.val.val64;
    743752                pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1);
    744 
    745 #ifdef IN_GC
    746                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    747                 AssertMsgReturn(pParam1 == pvFault, ("eip=%VGv, pParam1=%VGv pvFault=%VGv\n", pRegFrame->rip, pParam1, pvFault), VERR_EM_INTERPRETER);
    748 #endif
     753                EM_ASSERT_FAULT_RETURN(pParam1 == pvFault, VERR_EM_INTERPRETER);
    749754                rc = emRamRead(pVM,  &valpar1, pParam1, param1.size);
    750755                if (VBOX_FAILURE(rc))
     
    843848#endif
    844849
    845 # ifdef IN_GC
     850#ifdef IN_GC
    846851    /* Safety check (in theory it could cross a page boundary and fault there though) */
    847852    Assert(   TRPMHasTrap(pVM)
    848853           && (TRPMGetErrorCode(pVM) & X86_TRAP_PF_RW));
    849     AssertMsgReturn(GCPtrPar1 == pvFault, ("eip=%VGv, GCPtrPar1=%VGv pvFault=%VGv\n", pRegFrame->rip, GCPtrPar1, pvFault), VERR_EM_INTERPRETER);
    850 # endif
     854    EM_ASSERT_FAULT_RETURN(GCPtrPar1 == pvFault, VERR_EM_INTERPRETER);
     855#endif
    851856
    852857    /* Register and immediate data == PARMTYPE_IMMEDIATE */
     
    921926                pParam1 = (RTGCPTR)param1.val.val64;
    922927                pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1);
    923 
    924 #ifdef IN_GC
    925                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    926                 AssertReturn(pParam1 == pvFault, VERR_EM_INTERPRETER);
    927 #endif
     928                EM_ASSERT_FAULT_RETURN(pParam1 == pvFault, VERR_EM_INTERPRETER);
    928929                rc = emRamRead(pVM,  &valpar1, pParam1, param1.size);
    929930                if (VBOX_FAILURE(rc))
     
    10341035            Log2(("emInterpret%s: pvFault=%VGv pParam1=%VGv val2=%x\n", emGetMnemonic(pCpu), pvFault, pParam1, valpar2));
    10351036            pParam1 = (RTGCPTR)((RTGCUINTPTR)pParam1 + valpar2/8);
    1036 #ifdef IN_GC
    1037             /* Safety check. */
    1038             AssertMsgReturn((RTGCPTR)((RTGCUINTPTR)pParam1 & ~3) == pvFault, ("pParam1=%VGv pvFault=%VGv\n", pParam1, pvFault), VERR_EM_INTERPRETER);
    1039 #endif
     1037            EM_ASSERT_FAULT_RETURN((RTGCPTR)((RTGCUINTPTR)pParam1 & ~3) == pvFault, VERR_EM_INTERPRETER);
    10401038            rc = emRamRead(pVM, &valpar1, pParam1, 1);
    10411039            if (VBOX_FAILURE(rc))
     
    11181116#ifdef IN_GC
    11191117    Assert(TRPMHasTrap(pVM));
    1120     AssertMsgReturn((RTGCPTR)((RTGCUINTPTR)GCPtrPar1 & ~(RTGCUINTPTR)3) == pvFault,
    1121                     ("GCPtrPar1=%VGv pvFault=%VGv\n", GCPtrPar1, pvFault),
    1122                     VERR_EM_INTERPRETER);
     1118    EM_ASSERT_FAULT_RETURN((RTGCPTR)((RTGCUINTPTR)GCPtrPar1 & ~(RTGCUINTPTR)3) == pvFault, VERR_EM_INTERPRETER);
    11231119#endif
    11241120
     
    12121208
    12131209            Assert(param2.size <= 8 && param2.size > 0);
    1214 
    1215 #if 0 /* CSAM/PATM translates aliases which causes this to incorrectly trigger. See #2609 and #1498. */
    1216 #ifdef IN_GC
    1217             /* Safety check (in theory it could cross a page boundary and fault there though) */
    1218             AssertMsgReturn(pDest == pvFault, ("eip=%VGv pDest=%VGv pvFault=%VGv\n", pRegFrame->rip, pDest, pvFault), VERR_EM_INTERPRETER);
    1219 #endif
    1220 #endif
     1210            EM_ASSERT_FAULT_RETURN(pDest == pvFault, VERR_EM_INTERPRETER);
    12211211            rc = emRamWrite(pVM, pDest, &val64, param2.size);
    12221212            if (VBOX_FAILURE(rc))
     
    12481238
    12491239            Assert(param1.size <= 8 && param1.size > 0);
    1250 #ifdef IN_GC
    1251             /* Safety check (in theory it could cross a page boundary and fault there though) */
    1252             AssertReturn(pSrc == pvFault, VERR_EM_INTERPRETER);
    1253 #endif
     1240            EM_ASSERT_FAULT_RETURN(pSrc == pvFault, VERR_EM_INTERPRETER);
    12541241            rc = emRamRead(pVM, &val64, pSrc, param1.size);
    12551242            if (VBOX_FAILURE(rc))
     
    15261513                pParam1 = (RTRCPTR)param1.val.val64;
    15271514                pParam1 = (RTRCPTR)emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, (RTGCPTR)(RTRCUINTPTR)pParam1);
    1528 
    1529                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    1530                 AssertMsgReturn(pParam1 == (RTRCPTR)pvFault, ("eip=%VGv pParam1=%VRv pvFault=%VGv\n", pRegFrame->rip, pParam1, pvFault), VERR_EM_INTERPRETER);
     1515                EM_ASSERT_FAULT_RETURN(pParam1 == (RTRCPTR)pvFault, VERR_EM_INTERPRETER);
    15311516                break;
    15321517
     
    15991584                pParam1 = (RTRCPTR)param1.val.val64;
    16001585                pParam1 = (RTRCPTR)emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, (RTGCPTR)(RTRCUINTPTR)pParam1);
    1601 
    1602                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    1603                 AssertMsgReturn(pParam1 == (RTRCPTR)pvFault, ("eip=%VGv pParam1=%VRv pvFault=%VGv\n", pRegFrame->rip, pParam1, pvFault), VERR_EM_INTERPRETER);
     1586                EM_ASSERT_FAULT_RETURN(pParam1 == (RTRCPTR)pvFault, VERR_EM_INTERPRETER);
    16041587                break;
    16051588
     
    16721655                pParam1 = (RTRCPTR)param1.val.val64;
    16731656                pParam1 = (RTRCPTR)emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, (RTGCPTR)(RTRCUINTPTR)pParam1);
    1674 
    1675                 /* Safety check (in theory it could cross a page boundary and fault there though) */
    1676                 AssertMsgReturn(pParam1 == (RTRCPTR)pvFault, ("eip=%VGv pParam1=%VRv pvFault=%VGv\n", pRegFrame->rip, pParam1, pvFault), VERR_EM_INTERPRETER);
     1657                EM_ASSERT_FAULT_RETURN(pParam1 == (RTRCPTR)pvFault, VERR_EM_INTERPRETER);
    16771658                break;
    16781659
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