Comments (4)
If all the emitted code is messed around by the optimizer, it's difficult to do accurate signal handling -- how do we know the exact x86 register status in the guest sighandler when a signal is delivered?
But to my understanding, a peephole optimizer with accurate signal handling in mind is possible.
from box64.
If all the emitted code is messed around by the optimizer, it's difficult to do accurate signal handling -- how do we know the exact x86 register status in the guest sighandler when a signal is delivered?
But to my understanding, a peephole optimizer with accurate signal handling in mind is possible.
I think there is a trade-off for this situation, for some cases which doesn't care signal handling precision, user could get a performance improvement due to compiler optimization; otherwise one can disable the optimizations.
from box64.
The x86 cache behavior is another tricky thing. Box64 is designed to handle JIT inside Box64 JIT correctly. The x86 hardware automatically invalidates (instruction) cache line when corresponding memory location is written to without an explicit flush or fence instruction, which Box64 is trying to emulate. Therefore, Box64 protects the x86 code memory pages when generating its JIT code, so a SIGSEGV would be triggered when the x86 code mutates. This signal would be intercepted by Box64, and the JIT cache of the entire memory page where the signal emits will be marked as dirty. Current practice of generating one JIT code block for one continuous x86 code block leads to simpler integrity check.
from box64.
The x86 cache behavior is another tricky thing. Box64 is designed to handle JIT inside Box64 JIT correctly. The x86 hardware automatically invalidates (instruction) cache line when corresponding memory location is written to without an explicit flush or fence instruction, which Box64 is trying to emulate. Therefore, Box64 protects the x86 code memory pages when generating its JIT code, so a SIGSEGV would be triggered when the x86 code mutates. This signal would be intercepted by Box64, and the JIT cache of the entire memory page where the signal emits will be marked as dirty. Current practice of generating one JIT code block for one continuous x86 code block leads to simpler integrity check.
I think it's a common technique for SMC, in most DBT solutions, they also take it to handle SMC unless the hardware provides some supports, e.g. mmu could notify the BT when data cache changes to instr cache.
from box64.
Related Issues (20)
- Cannot allocate memory error HOT 8
- Box64 Seems Failing to Handle `.init_array` HOT 5
- Respondus Lockdown Browser - needs libgnutils.so.30 fixed HOT 3
- Error: PltResolver: Symbol cupsSetPasswordCB2 trying to wipe a drive with Active KillDisk HOT 6
- Support `sys_getpgrp` & `sys_getgpid` HOT 1
- Are there some ways to check the wrapped functions?
- Unimplemented 32bits Opcode (00 00 00 00) 64 66 8D 80 00 00 00 00 0F 10 04 08 0F 10 4C HOT 2
- Trying to run intune-portal for our ARM-based linux clients HOT 2
- `BOX64_DYNAREC_TEST` on RISC-V is Failing HOT 7
- DanserGo: need help with acquiring Shared Object files HOT 2
- Unexpected Behaviors when Using RISC-V Extension "zbs" HOT 1
- Trying to install dotnet8 with winetricks on PiOS Bookworm HOT 7
- Unexpected Dynarec-Interpreter Difference on `cmp` Instruction HOT 4
- Trying to run Windows version of Steam through wine new wow64 mode HOT 4
- Error while trying to install dotnet 8 HOT 2
- Wine AppImage Won't Run, Missing Syscall HOT 1
- How to Count the Number of Executions of Each Dynablock in Box64? HOT 8
- 8c5752de23ac421025032e405ca3168191ae7a33 dynarec breaks rkbin's boot_merger HOT 5
- vkMapMemory fails in wine vkcube.exe
- Failed to start wps-office HOT 27
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box64.