- 
                Notifications
    
You must be signed in to change notification settings  - Fork 600
 
i#5426: Mark instrs in AArch64 mangling epilogue and emulate them. #7692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
053bd90
              a2bf46d
              d1e9cdc
              43cf428
              1591369
              1ca1480
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -2149,12 +2149,14 @@ restore_tls_base_to_stolen_reg(dcontext_t *dcontext, instrlist_t *ilist, instr_t | |
| { | ||
| /* store app val back if it might be written */ | ||
| if (instr_writes_to_reg(instr, dr_reg_stolen, DR_QUERY_INCLUDE_COND_DSTS)) { | ||
| PRE(ilist, next_instr, | ||
| XINST_CREATE_store(dcontext, | ||
| opnd_create_base_disp(reg, REG_NULL, 0, | ||
| os_tls_offset(TLS_REG_STOLEN_SLOT), | ||
| OPSZ_PTR), | ||
| opnd_create_reg(dr_reg_stolen))); | ||
| instr_t *store = XINST_CREATE_store( | ||
| dcontext, | ||
| opnd_create_base_disp(reg, REG_NULL, 0, os_tls_offset(TLS_REG_STOLEN_SLOT), | ||
| OPSZ_PTR), | ||
| opnd_create_reg(dr_reg_stolen)); | ||
| instr_set_our_mangling(store, true); | ||
| instr_set_our_mangling_epilogue(store, true); | ||
                
      
                  egrimley-arm marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| PRE(ilist, next_instr, store); | ||
| } else { | ||
| DOLOG(4, LOG_INTERP, { | ||
| LOG(THREAD, LOG_INTERP, 4, "skip save stolen reg app value for: "); | ||
| 
        
          
        
         | 
    @@ -2164,9 +2166,11 @@ restore_tls_base_to_stolen_reg(dcontext_t *dcontext, instrlist_t *ilist, instr_t | |
| } | ||
| /* restore stolen reg from spill reg */ | ||
| /* This precise opcode (OP_orr) is checked for in instr_is_stolen_reg_move(). */ | ||
| PRE(ilist, next_instr, | ||
| XINST_CREATE_move(dcontext, opnd_create_reg(dr_reg_stolen), | ||
| opnd_create_reg(reg))); | ||
| instr_t *move = | ||
| XINST_CREATE_move(dcontext, opnd_create_reg(dr_reg_stolen), opnd_create_reg(reg)); | ||
| instr_set_our_mangling(move, true); | ||
                
      
                  egrimley-arm marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| instr_set_our_mangling_epilogue(move, true); | ||
                
      
                  egrimley-arm marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| PRE(ilist, next_instr, move); | ||
| } | ||
| 
     | 
||
| /* Mangle simple dr_reg_stolen access. | ||
| 
          
            
          
           | 
    @@ -2234,8 +2238,12 @@ mangle_stolen_reg(dcontext_t *dcontext, instrlist_t *ilist, instr_t *instr, | |
| /* restore tls_base back to dr_reg_stolen */ | ||
| restore_tls_base_to_stolen_reg(dcontext, ilist, instr, next_instr, tmp, slot); | ||
| /* restore tmp if necessary */ | ||
| if (should_restore) | ||
| PRE(ilist, next_instr, instr_create_restore_from_tls(dcontext, tmp, slot)); | ||
| if (should_restore) { | ||
| instr_t *restore = instr_create_restore_from_tls(dcontext, tmp, slot); | ||
| instr_set_our_mangling(restore, true); | ||
                
      
                  egrimley-arm marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| instr_set_our_mangling_epilogue(restore, true); | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A translation needs to be set as well: it's assumed by the epilogue handling code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the translation gets set later by  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current instr is incorrect for post-instr mangling: the translation PC is the PC to be re-started. It can't be a retired instr as it is incorrect to re-execute it.  | 
||
| PRE(ilist, next_instr, restore); | ||
| } | ||
| } | ||
| 
     | 
||
| /* replace thread register read instruction with a TLS load instr */ | ||
| 
          
            
          
           | 
    ||
Uh oh!
There was an error while loading. Please reload this page.