bochscpu's People
bochscpu's Issues
Simulate CPU with UIMP feature
During fuzzing a kernel driver via WTF fuzzer with bochscpu backend for one case I got #GP (--> nt!KiGeneralProtectionFault()
) on the instruction:
fffff8062804a378 0f22e0 mov cr4,rax
Inside nt!KiFlushCurrentTbWorker()
:
I caught the reason in the debug build of bochs: check_CR4(): write of 0x00350e78 not supported (allowMask=0x3727ff)
(https://sourceforge.net/p/bochs/code/HEAD/tree/trunk/bochs/cpu/crregs.cc#l1273)
Decoded:
001101110010011111111111 - allowed mask
001101010000111001111000 - new value
11 bit is important for now:
// [11] UMIP: User Mode Instruction Prevention R/W
(https://sourceforge.net/p/bochs/code/HEAD/tree/trunk/bochs/cpu/crregs.cc#l1172)
And this bit isn't set:
if (is_cpu_extension_supported(BX_ISA_UMIP))
allowMask |= BX_CR4_UMIP_MASK;
(https://sourceforge.net/p/bochs/code/HEAD/tree/trunk/bochs/cpu/crregs.cc#l1251)
The flag BX_ISA_UMIP is set (enable_cpu_extension(BX_ISA_UMIP);
) for 3 CPU profiles:
- corei3_cnl (https://sourceforge.net/p/bochs/code/HEAD/tree/trunk/bochs/cpu/cpudb/intel/corei3_cnl.cc#l116)
- corei7_icelake-u (https://sourceforge.net/p/bochs/code/HEAD/tree/trunk/bochs/cpu/cpudb/intel/corei7_icelake-u.cc#l130)
- tigerlake (https://sourceforge.net/p/bochs/code/HEAD/tree/trunk/bochs/cpu/cpudb/intel/tigerlake.cc#l134)
Inside this project the CPU profile selection is simulated in the sim_get_param_enum()
function, which uses PARAMS_ENUM with "cpu.model" key:
Lines 20 to 54 in 20f197b
According to this part, the hardcoded value of 24 always means "corei7_skylake_x", which does not support UMIP.
I think it would be nice to sync with the actual cpudb.h
and return the value 27 for the latest CPU profile (tigerlake):
https://sourceforge.net/p/bochs/code/HEAD/tree/trunk/bochs/cpudb.h#l55
unwind_attributes features has be removed
Hello,
I encountered this error with rust 1.54
error[E0557]: feature has been removed
--> vendor\bochscpu\src\lib.rs:1:12
|
1 | #![feature(unwind_attributes)]
| ^^^^^^^^^^^^^^^^^ feature has been removed
|
= note: use the C-unwind ABI instead
I guess it's related to rust-lang/rfcs#2945
bochscpu_set_state sets mxcsr_mask to mxcsr
While investigating 0vercl0k/wtf#140, I found that suspicious piece of code in mod.rs which seems like a bug..?:
pub unsafe fn set_state(&self, s: &State) {
// ...
self.set_mxcsr(s.mxcsr);
self.set_mxcsr_mask(s.mxcsr);
}
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.