Changeset 101250 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 25, 2023 12:54:00 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r101249 r101250 72 72 # include <iprt/formats/dwarf.h> 73 73 # if defined(RT_OS_DARWIN) 74 # include <libkern/OSCacheControl.h> 74 75 # define IEMNATIVE_USE_LIBUNWIND 75 76 extern "C" void __register_frame(const void *pvFde); … … 284 285 * expect the caller to call iemExecMemAllocatorReadyForUse when done 285 286 * writing to the allocation. 287 * 288 * See also https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon 289 * for details. 286 290 */ 287 291 /** @todo detect if this is necessary... it wasn't required on 10.15 or … … 445 449 #ifdef RT_OS_DARWIN 446 450 /* See iemExecMemAllocatorAllocTailCode for the explanation. */ 447 # if 0 /** @todo getting weird EXC_BAD_INSTRUCTION exceptions, trying to figure out / work around why... */448 int rc2 = RTMemProtect(pv, cb, RTMEM_PROT_NONE);449 AssertRC(rc2); RT_NOREF(pVCpu);450 # endif451 451 int rc = RTMemProtect(pv, cb, RTMEM_PROT_EXEC | RTMEM_PROT_READ); 452 452 AssertRC(rc); RT_NOREF(pVCpu); 453 # if 0 /** @todo getting weird EXC_BAD_INSTRUCTION exceptions, trying to figure out / work around why... */ 454 ASMProbeReadBuffer(pv, cb); 455 # ifdef RT_ARCH_ARM64 456 __asm__ __volatile__("dmb sy\n\t" 457 "dsb sy\n\t" 458 "isb\n\t" 459 ::: "memory"); 460 # endif 461 # endif 453 454 /* 455 * Flush the instruction cache: 456 * https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon 457 */ 458 /* sys_dcache_flush(pv, cb); - not necessary */ 459 sys_icache_invalidate(pv, cb); 462 460 #else 463 461 RT_NOREF(pVCpu, pv, cb); … … 837 835 838 836 /* Allocate a chunk. */ 839 #ifdef RT_OS_DARWIN /** @todo oh carp! This isn't going to work very well with the unpredictability of the simple heap... */837 #ifdef RT_OS_DARWIN 840 838 void *pvChunk = RTMemPageAllocEx(pExecMemAllocator->cbChunk, 0); 841 839 #else … … 1839 1837 iemTbAllocatorProcessDelayedFrees(pVCpu, pVCpu->iem.s.pTbAllocatorR3); 1840 1838 1841 #if 1 /** @todo getting weird EXC_BAD_INSTRUCTION exceptions, trying to figure out / work around why... */1842 1839 PIEMNATIVEINSTR const paFinalInstrBuf = (PIEMNATIVEINSTR)iemExecMemAllocatorAlloc(pVCpu, off * sizeof(IEMNATIVEINSTR)); 1843 1840 AssertReturn(paFinalInstrBuf, pTb); 1844 1841 memcpy(paFinalInstrBuf, pReNative->pInstrBuf, off * sizeof(paFinalInstrBuf[0])); 1845 #else1846 IEMNATIVEINSTR volatile * const paFinalInstrBuf1847 = (IEMNATIVEINSTR volatile *)iemExecMemAllocatorAlloc(pVCpu, off * sizeof(IEMNATIVEINSTR));1848 AssertReturn(paFinalInstrBuf, pTb);1849 for (uint32_t i = 0; i < off; i++)1850 paFinalInstrBuf[i] = pReNative->pInstrBuf[i];1851 __asm__ __volatile__("dmb sy\n\t" ::: "memory");1852 #endif1853 1842 1854 1843 /*
Note:
See TracChangeset
for help on using the changeset viewer.