[vbox-dev] Recompiler:REMR3NotifyCodePageChanged seems to misplace result

Lars Johannsen vbox at lars-johannsen.dk
Mon Jan 17 02:02:21 GMT 2011


Hi

while scanning thru VBoxRecompiler.c, i came across this:

it seems that the return-val from call to PGMGstGetPage (in  REMR3NotifyCodePageChanged)
gets replaced by "VINF_SUCCESS"

typo or ?

Reg.
  Lars

 REMR3DECL(int) REMR3NotifyCodePageChanged(PVM pVM, PVMCPU pVCpu, RTGCPTR pvCodePage)
 {
 #ifdef VBOX_REM_PROTECT_PAGES_FROM_SMC
     int      rc;
     RTGCPHYS PhysGC;
     uint64_t flags;
 
     VM_ASSERT_EMT(pVM);
 
     /*
      * Get the physical page address.
      */
     rc = PGMGstGetPage(pVM, pvCodePage, &flags, &PhysGC);
     if (rc == VINF_SUCCESS)
     {
         /*
          * Sync the required registers and flush the whole page.
          * (Easier to do the whole page than notifying it about each physical
          * byte that was changed.
          */
         pVM->rem.s.Env.cr[0] = pVM->rem.s.pCtx->cr0;
         pVM->rem.s.Env.cr[2] = pVM->rem.s.pCtx->cr2;
         pVM->rem.s.Env.cr[3] = pVM->rem.s.pCtx->cr3;
         pVM->rem.s.Env.cr[4] = pVM->rem.s.pCtx->cr4;
 
         tb_invalidate_phys_page_range(PhysGC, PhysGC + PAGE_SIZE - 1, 0);
     }
-#endif
+   return rc;
+#else
     return VINF_SUCCESS;
+#endif
 }

against: http://www.virtualbox.org/svn/vbox//trunk@35437

----

diff --git a/src/recompiler/VBoxRecompiler.c b/src/recompiler/VBoxRecompiler.c
index 5e22d2f..d2fcc24 100644
--- a/src/recompiler/VBoxRecompiler.c
+++ b/src/recompiler/VBoxRecompiler.c
@@ -2884,8 +2884,10 @@ REMR3DECL(int) REMR3NotifyCodePageChanged(PVM pVM, PVMCPU pVCpu, RTGCPTR pvCodeP

         tb_invalidate_phys_page_range(PhysGC, PhysGC + PAGE_SIZE - 1, 0);
     }
-#endif
+    return rc;
+#else
     return VINF_SUCCESS;
+#endif
 }





More information about the vbox-dev mailing list