Review Board 2.0.15


x86: Implements copyRegs() function

Review Request #759 - Created June 27, 2011 and submitted

Information
Nilay Vaish
gem5
default
Reviewers
Default
ali, gblack, nate, stever
x86: Implements copyRegs() function
The copyRegs() function for x86 is currently unimplemented. This patch
provides an implementation.

   
Review request changed
Updated (July 7, 2011, 12:59 a.m.)

Description:

   

x86: Implements copyRegs() function

    The copyRegs() function for x86 is currently unimplemented. This patch
    provides an implementation.

-  
-  

Apart from this patch, I have another question. In the function

-   copyMiscRegs(), a comment appears that 'it has been implemented naively.'
-   Why the comment? What would an accurate implementation look like?

Diff:

Revision 3 (+10 -5)

Show changes

Posted (July 7, 2011, 8:16 a.m.)



  
src/arch/x86/utility.cc (Diff revision 3)
 
 
This is not true. They are consistent among themselves, and there -happen- to not be any side effects that need to go along for the ride. If, for instance, the debug registers were set such that there was a hardware breakpoint somewhere, those would have to be set in such a way that the hardware breakpoint was installed in the new system as well, and that any existing breakpoint from it's own registers was removed. Future changes to what the miscregs do and how they work could definitely break this assumption without introducing any inconsistencies.
Posted (July 7, 2011, 12:26 p.m.)



  
src/arch/x86/utility.cc (Diff revision 3)
 
 
I can change the comment to --

// This function assumes that the registers are consistent amongst themselves. Hence, side effects affecting the registers themselves need not be taken care of. But any other side effects, like TLB invalidation, would need to be.
  1. How about
    
    // This function assumes no side effects other than TLB invalidation need to be considered while copying state. That will likely not be true in the future.