VirtualBox

Changeset 103636 in vbox


Ignore:
Timestamp:
Mar 1, 2024 2:56:49 PM (9 months ago)
Author:
vboxsync
Message:

VMM/IEM: Support iemNativeRecompFunc_BltIn_LogCpuState() on arm64, bugref:10371

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veHlpA-arm64.S

    r103377 r103636  
    3535
    3636BEGINCODE
     37
     38.extern NAME(iemThreadedFunc_BltIn_LogCpuStateWorker)
     39
    3740/**
    3841 * This does the epilogue of a TB, given the RBP for the frame and eax value to return.
     
    7578        brk #1
    7679
     80
     81
     82#define IEMNATIVE_HLP_FRAME_SIZE (11 * 16)
     83
     84;;
     85; This is wrapper function that saves and restores all volatile registers
     86; so the impact of inserting LogCpuState is minimal to the other TB code.
     87;
     88        .p2align        2
     89        .private_extern NAME(iemNativeHlpAsmSafeWrapLogCpuState)
     90        .globl          NAME(iemNativeHlpAsmSafeWrapLogCpuState)
     91NAME(iemNativeHlpAsmSafeWrapLogCpuState):
     92#ifdef RT_OS_DARWIN
     93        pacibsp
     94#endif
     95
     96        ;
     97        ; Save all volatile registers.
     98        ;
     99        stp     x29, x30, [sp, #-IEMNATIVE_HLP_FRAME_SIZE]!
     100        stp      x0,  x1, [sp, #( 1 * 16)]
     101        stp      x2,  x3, [sp, #( 2 * 16)]
     102        stp      x4,  x5, [sp, #( 3 * 16)]
     103        stp      x5,  x6, [sp, #( 4 * 16)]
     104        stp      x7,  x8, [sp, #( 5 * 16)]
     105        stp      x9, x10, [sp, #( 6 * 16)]
     106        stp     x11, x12, [sp, #( 7 * 16)]
     107        stp     x13, x14, [sp, #( 8 * 16)]
     108        stp     x15, x16, [sp, #( 9 * 16)]
     109        stp     x17, x18, [sp, #(10 * 16)]
     110
     111        ;
     112        ; Move the pVCpu pointer from the fixed register to the first argument.
     113        ; @todo This needs syncing with what we use in IEMN8veRecompiler.h
     114        ;       but we can't include that header right now, would need some #ifndef IN_ASM_CODE...
     115        ;       in the header or splitting up the header into a asm safe one and a one included from C/C++.
     116        ;
     117        mov      x0, x28
     118
     119        ;
     120        ; Call C function to do the actual work.
     121        ;
     122        bl      NAME(iemThreadedFunc_BltIn_LogCpuStateWorker)
     123
     124        ;
     125        ; Restore volatile registers and return to the TB code.
     126        ;
     127        ldp    x29, x30, [sp, #( 0 * 16)]
     128        ldp     x0,  x1, [sp, #( 1 * 16)]
     129        ldp     x2,  x3, [sp, #( 2 * 16)]
     130        ldp     x4,  x5, [sp, #( 3 * 16)]
     131        ldp     x5,  x6, [sp, #( 4 * 16)]
     132        ldp     x7,  x8, [sp, #( 5 * 16)]
     133        ldp     x9, x10, [sp, #( 6 * 16)]
     134        ldp    x11, x12, [sp, #( 7 * 16)]
     135        ldp    x13, x14, [sp, #( 8 * 16)]
     136        ldp    x15, x16, [sp, #( 9 * 16)]
     137        ldp    x17, x18, [sp, #(10 * 16)]
     138        add      sp, sp, #IEMNATIVE_HLP_FRAME_SIZE
     139
     140#ifdef RT_OS_DARWIN
     141        retab
     142#else
     143        ret
     144#endif
     145        brk #1
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompBltIn.cpp

    r103318 r103636  
    6262*   TB Helper Functions                                                                                                          *
    6363*********************************************************************************************************************************/
    64 #ifdef RT_ARCH_AMD64
     64#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_ARM64)
    6565DECLASM(void) iemNativeHlpAsmSafeWrapLogCpuState(void);
    6666#endif
     
    155155    /* pop rax */
    156156    pbCodeBuf[off++] = 0x58 + X86_GREG_xAX;
     157#else
     158    off = iemNativeEmitCallImm(pReNative, off, (uintptr_t)iemNativeHlpAsmSafeWrapLogCpuState);
     159    RT_NOREF(pCallEntry);
     160#endif
     161
    157162    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    158 
    159 #else
    160     /** @todo Implement this  */
    161     AssertFailed();
    162     RT_NOREF(pReNative, pCallEntry);
    163 #endif
    164163    return off;
    165164}
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