Stanislav Shwartsman
8653095520
small optimization in cpu_loop with trace cache
2008-01-28 20:09:40 +00:00
Stanislav Shwartsman
9ec2c87aaa
cleanups and optimizations
2008-01-22 16:20:30 +00:00
Stanislav Shwartsman
192f398b46
removed --enable-magic-breakpoint configure option - it is enabled by default if Bochs internal debugger compiled in. Also it always possible to switch magic break off by .bochsrc option
2008-01-21 21:36:58 +00:00
Stanislav Shwartsman
88a4776244
taking all CPU icache/trace cache related stuff into separate source file from cpu.cc
2008-01-17 21:15:23 +00:00
Stanislav Shwartsman
77b4b70b9b
oops, revert incorrectly merged change
2008-01-10 20:32:23 +00:00
Stanislav Shwartsman
1f4608cd84
Fix for implemened 3dnow instuctions (most of them are not implemented)
2008-01-10 20:26:49 +00:00
Stanislav Shwartsman
d9984bb3a1
Eliminate BxResolve call from the heart of cpu loop and move into instructions that really require this calculation. Yes, it blows the code of EVERY CPU method but it has >15% speedup !
2008-01-10 19:37:56 +00:00
Stanislav Shwartsman
e7a45770fd
More optimization for short traces
2008-01-05 10:45:05 +00:00
Stanislav Shwartsman
a9e001bd30
Optimize short traces
2008-01-05 10:21:25 +00:00
Stanislav Shwartsman
d891f0d8ec
Fixed more VC2008 warnings - hopefully last ones
2007-12-30 17:53:12 +00:00
Stanislav Shwartsman
fc159e3bcf
small cleanup
2007-12-25 21:42:38 +00:00
Stanislav Shwartsman
838fb2a048
Fixing V2008 warnings - they found a bug in sse_pfp.cc !
2007-12-23 17:21:28 +00:00
Stanislav Shwartsman
c3c9c40674
Move MaxFetch calculation into fetchdecode - simplify the logic
2007-12-22 17:17:40 +00:00
Stanislav Shwartsman
0e5859302b
Avoid 64-bit calculations when checking remainingInPage bytes
2007-12-22 12:43:17 +00:00
Stanislav Shwartsman
46366b5064
Speedup simulation by eliminating CPL==3 check from read/write_virtual* functions
2007-12-16 21:03:46 +00:00
Stanislav Shwartsman
d9a59c7a1f
Added ability to merge traces cross JCC branch instructions
...
Makes traces longer -> emulation faster in average
2007-12-14 20:41:09 +00:00
Stanislav Shwartsman
db69a25c36
Trace cache instrumentation methods
...
Next step will be tracing cross non-taken branches
2007-12-14 11:27:44 +00:00
Stanislav Shwartsman
adda3befd3
Trace cache optimization merged
2007-12-09 18:36:05 +00:00
Stanislav Shwartsman
29267577f0
Fixed HLT problem in SMP binary which runs with single processor only
2007-12-08 09:26:13 +00:00
Stanislav Shwartsman
88899cf617
Changes for lazy flags handling -> 1st stap in transition to new lazy flags handling by Darek Mihocka (www.emulators.com)
2007-12-04 19:27:23 +00:00
Stanislav Shwartsman
91e0db63c4
no need to invalidate prefetch queue for RDMSR/WRMSR
2007-12-03 21:43:14 +00:00
Stanislav Shwartsman
8cfd17202a
some simple SSE code optimizations
2007-11-27 22:12:45 +00:00
Stanislav Shwartsman
e51184c8cf
Eliminate saving of RSP from heart of cpu_loop
...
Now save RSP only where it is really required
2007-11-24 14:22:34 +00:00
Stanislav Shwartsman
83f6eb6945
Changes copyrights for the files I wrote :)
...
Also split EqId G1 group for x86-64
2007-11-17 23:28:33 +00:00
Stanislav Shwartsman
0fa82afe1f
Bugfix and optimize BxResolve calls - bugfix in 64-bit mode
2007-11-13 17:30:54 +00:00
Stanislav Shwartsman
edfff23ca0
Split JCC methods to 16 different methods per branch condition
2007-11-12 18:20:15 +00:00
Stanislav Shwartsman
5a172541e2
Small cleanup
2007-11-01 20:43:53 +00:00
Stanislav Shwartsman
e137560b14
Complete MONITOR/MWAIT implemntation (including monitoring of memory range)
...
Fixed PANIC in read/write Cr/Dr - should #UD with unkown register used
2007-11-01 18:03:48 +00:00
Stanislav Shwartsman
ce0e0287fb
Naturally speedup repeat execution functions, fix TLB index calculations
2007-10-30 22:15:42 +00:00
Stanislav Shwartsman
e9801ef501
Support for restore cpu (and any other device from bochs root) from debugger
2007-10-14 19:04:51 +00:00
Stanislav Shwartsman
ac272e9383
Changes breakpoints configure time enable macroses - reduce amount of compile-time parameters
2007-10-12 22:11:25 +00:00
Stanislav Shwartsman
dcb0335ae9
Debug first instruction in exception handler after exception
2007-09-26 18:07:39 +00:00
Stanislav Shwartsman
e812f81e7b
Fixes in zero upper ECX
2007-09-25 16:11:32 +00:00
Stanislav Shwartsman
38d1f39c77
Converted CR0 bits to one register similar to CR4 - a bit slower but helps with other features implemntation
2007-07-09 15:16:14 +00:00
Stanislav Shwartsman
05ea111e1c
Clean CPU debug methods in main cpu_loop
2007-03-06 17:47:18 +00:00
Stanislav Shwartsman
c24627c00f
Implemented CLFLUSH instruction
...
Set of minor fixes for correctness
2007-01-28 21:27:31 +00:00
Stanislav Shwartsman
5c21f7821f
Speed simulation between 3 to 5% by eliminating several checks from cpu loop.
...
The checks were related to repeat instructions - handle them differently
2007-01-05 13:40:47 +00:00
Stanislav Shwartsman
925ae93e22
Reveer back changes for debug.h removal from bochs.h
2006-09-26 19:16:10 +00:00
Stanislav Shwartsman
aab3feb2e0
Fixed Makefile to compile with ACPI stub disabled
...
Remove bx_debug.h from bochs.h to reduce compilation dependencies
2006-09-25 20:13:52 +00:00
Stanislav Shwartsman
3ab94305a0
1. Fixed bug report
...
[ bochs-Bugs-1562172 ] TLB_init() fails to initialize priv_check array if USE_TLB 0
2. Paging is always exists for i386+
To disable paging it is better to use normal model without special code, only by setting cr0.pg=0
2006-09-20 17:02:20 +00:00
Stanislav Shwartsman
c7aa53d044
Fixed compilation error of extdb
2006-06-25 21:44:46 +00:00
Stanislav Shwartsman
f9754dadeb
Fix some code duplication
2006-06-24 18:27:11 +00:00
Stanislav Shwartsman
070d782ec8
Move paddr_valid param of dbg_xlate_linear2phy method to return value.
...
This is much easier to use.
2006-06-17 12:09:55 +00:00
Stanislav Shwartsman
f44190ed27
Comment most likely redundant invalid_prefetch_q
2006-06-16 20:08:03 +00:00
Stanislav Shwartsman
8ed8916ea9
Break to debugger on triple fault or panic (this time do it correctly)
...
Indent changes
2006-06-12 19:51:31 +00:00
Stanislav Shwartsman
308521e7ce
Fixes in SYSCALL/SYSRET instructions
...
Use parse_selector to avoid code duplication
2006-06-11 21:37:22 +00:00
Stanislav Shwartsman
1deddb9f0e
Fix linking problem with debugger enabled
2006-06-06 16:46:08 +00:00
Stanislav Shwartsman
fea15294b5
Fixed compilation error in init.cc
...
Move initialization of memory object to misc_mem.cc
2006-06-03 12:59:14 +00:00
Stanislav Shwartsman
286b89d763
Several x86-64 MSRs were not-initilized !
...
Fixed small save-restore bug in dma.cc
First step to make save-restore code look better (only several files processed for example)
2006-05-28 17:07:57 +00:00
Stanislav Shwartsman
65e0fea773
functionally nothing changed
2006-05-26 17:24:36 +00:00
Stanislav Shwartsman
1acdb7f274
Simplify CPU loop and fix compilation error
2006-05-24 16:46:57 +00:00
Stanislav Shwartsman
8db1de7124
- Fixed several issues, each cause to NullTimer function never be called, the method is required for icache correct functionalit
...
- Speed-up icache by correct purging of Icache entries
- Several new assertions for timers, to prevent bugs in future
2006-05-16 20:55:55 +00:00
Stanislav Shwartsman
7acb46cd3d
Small cleanup in cpu.cc
2006-05-16 16:47:00 +00:00
Stanislav Shwartsman
f4c7b4074e
Support for x86-64 in x86 debugger (DR0-DR7)
2006-05-13 12:49:45 +00:00
Stanislav Shwartsman
fe644dfcbf
- Code cleanup, remove x86-64 code from functions which cannot be called from x86-64
...
- Fix PANIC multiple SSE prefix decoding (fetchdecode and disasm)
- More Bit32u -> bx_phy_address convert
- Lazy flags optimization
2006-05-12 17:04:19 +00:00
Stanislav Shwartsman
767fb77ebd
Fully handle segment limits inside prefetch method.
...
1. Should speed up the simulation (eliminate seg.limit check per every instruction exec)
2. Should help for DT (h.johansson request)
2006-05-04 19:54:25 +00:00
Stanislav Shwartsman
199c987ee3
Return back (modified) dbg_is_end_instr_bpoint method in cpu.cc
2006-04-29 16:14:47 +00:00
Stanislav Shwartsman
2889ed190c
Removed icount guard for debugger. Implement STEPN debugger command using CPU_LOOP method capabilities
2006-04-29 09:27:49 +00:00
Stanislav Shwartsman
1a0b7ee1e3
I want to replace debugger ICOUNT guard by existent cpu_loop funtionality, first step to do that ...
2006-04-29 07:12:13 +00:00
Stanislav Shwartsman
510cbe02e2
Make fetchInstruction INLINE according to hjjhansson patch
2006-04-28 16:45:29 +00:00
Stanislav Shwartsman
ff02bc8ef0
Fixed:
...
With cvs snapshot 2006-04-09, --enable-debugger does not show the executed instructions anymore after being enabled via iodebug or "trace on".
2006-04-23 15:37:25 +00:00
Stanislav Shwartsman
d972e4a4b7
Fixed CR3 restore in RSM instruction
...
Added HALT state indication (actually make existant one working for single CPU)
2006-04-10 19:05:21 +00:00
Stanislav Shwartsman
45f30f0a4c
some code written to enter CPU to shutdown state.
...
finally the shutdown handling should be done exactly as in VmWare - the GUI should ask user if the CPU should reset and go to HLT/IF=0 if user choosed to stay in shutdown mode.
CPU configure option reset-on-triple-failt should be extended to shutdown-reset=0|1
small code cleanups and fixes
2006-04-07 20:47:32 +00:00
Stanislav Shwartsman
f8c3968d42
Changes list made after CVS service crash:
...
- Fixed critical bug in CPU code added with one of the prev commits
- Disasm support for SSE4
- Rename PNI->SSE3 everywhere in the code
- Correctly decode, disassemble and execute 'XCHG R8, rAX' x86-64 instruction
- Correctly decode, disassemble and execute multi-byte NOP 0F F1 opcode
- Fixed ENTER and LEAVE instructions in x86-64 mode
- Added ability to turn ON instruction trace, only GUI support is missed.
Instruction trace could be enabled if Bochs was compiled with disasm
- More changes Bit32u -> bx_phy_address
- Complete preliminary implementation of SMM in Bochs, SMI is still PANICs but if you press 'continue' everything should work OK
- Small code cleanup
- Update CHANGES and user docs
2006-04-05 17:31:35 +00:00
Stanislav Shwartsman
b8be848943
Use access_type param in getHostMemAddr, less efficient but no copy-paste at least
2006-03-26 19:39:37 +00:00
Stanislav Shwartsman
5c3fba4399
Support access to SMRAM in memory object
...
Cleanup in CPU code
2006-03-26 18:58:01 +00:00
Stanislav Shwartsman
d6f85c12f6
NMI support inside the CPU.
...
Added two functions to query NMI and SMI from Bochs debugger.
In future they could be used for generating NMI or SMI by user request using GUI button (could be implemented separatelly later and under configure-time or .bocshrc option)
2006-03-16 20:24:09 +00:00
Stanislav Shwartsman
e85a90a720
Remove cpu.h -> devices.cc dependancy, kill_bochs_request moved from CPU to bx_pc_system
...
Small Icache simplification and speedup
2006-03-14 18:11:22 +00:00
Stanislav Shwartsman
7b6c2587a9
Now devices could be compiled separatelly from CPU
...
Averything that required cpu.h include now has it explicitly and there are a lot of files not dependant by CPU at all which will compile a lot faster now ...
2006-03-06 22:03:16 +00:00
Stanislav Shwartsman
93898e11b2
Missed }
2006-03-04 09:24:31 +00:00
Stanislav Shwartsman
324d75e749
Fix another broking change
2006-03-04 09:22:55 +00:00
Stanislav Shwartsman
7cc8bc0836
Clean and optimize
2006-03-02 17:39:10 +00:00
Stanislav Shwartsman
55ceecf79b
Small optimization in icache page-write-stamp
2006-02-28 17:47:33 +00:00
Stanislav Shwartsman
79306b851c
Separate fetch/decode instruction block to stand-alone method.
...
The method could be reused when building instruction trace for DT
2006-02-23 18:23:31 +00:00
Stanislav Shwartsman
203a9caf31
SMM mode could leave together with pmode or any other (according to amd docs)
...
so we need separate bx_bool indicator in_smm instead
2006-02-14 20:03:14 +00:00
Stanislav Shwartsman
024ce249bf
Define SMM mode for future implementation.
...
I would like all next commits be aware of SMM mode.
It can't be implemented right now (too many questions w/o answers) but it will be done till next major release definitelly.
2006-02-14 19:00:08 +00:00
Stanislav Shwartsman
2646484dc1
Fix 'show' command in Boch debugger.
...
Fully supported show-interrupts, show-mode and show-call options
Enable toggling of show options (bug report from SF)
2006-02-12 20:21:36 +00:00
Stanislav Shwartsman
5a65e1065e
Decoding functionality for Bochs disassembler.
...
Fixed 'step over' debugger command using bx_dbg_read_linear method.
Small debugger fix in cpu.cc
2006-02-05 19:48:29 +00:00
Stanislav Shwartsman
6ca296de8b
Move --enable-reset-on-triple-fault option to runtime CPU::reste_on_triple-fault option in .bocshrc
...
Cleanup and optimize parser for debugger
2006-02-01 18:12:08 +00:00
Stanislav Shwartsman
37eb82c69c
Totally remove the cosimulation code from Bochs.
...
The Bochs anyway even doesn't compile if cosimulation configured enabled.
But in the same time the cosimulation code only disturbs to the future development of Bochs debugger, for example adding x86-64 functionality ...
For those of you who still may want to see the cosimulation code inside I put it in patch and upload it Bochs CVS patches folder. Read comments for the patch ! ----------------------------------------------------------------------
2006-01-25 22:20:00 +00:00
Stanislav Shwartsman
f9cad8d272
Remove debug printf
2006-01-24 19:07:45 +00:00
Stanislav Shwartsman
18afa9fd2d
This is cumulative patch for bochs debugger, it is only very first step towards working debugger supporting all new simulator functionalitieS.
...
- move crc.cc from debugger to bochs folder and make it projct-wide and not local for debugger
- added new 'info sse' command for debugger
- extend 'modebp' command to break on any mode change
- remove unimplemened 'info program' function, it is always printed fixed text
- move debugger help to parser, cleanup and simplify it
2006-01-24 19:03:55 +00:00
Stanislav Shwartsman
08c15c67c0
Don't know how much it helps ...
...
First step to make bx debugger supporting x86-64. guard_found object fields conerted to bx_address for x86-64 support.
2006-01-19 18:32:39 +00:00
Stanislav Shwartsman
2c8f6f7720
Merged patch: determine number of processors to emulate through .bochsrc
2006-01-18 18:35:38 +00:00
Stanislav Shwartsman
c92aba3776
Using back tracking in CVS I found the reason why CVS sources not compiled with configure --enable-debugger configuration (reported by Brendan).
...
Again it is andom change which cause to debugger not to compile ;(
This is definitelly GCC bug !
2006-01-17 07:58:11 +00:00
Stanislav Shwartsman
b07e698b3e
Initialize CPU and APIC after the bx_pc_system object
2006-01-05 21:39:11 +00:00
Stanislav Shwartsman
6ff8fccfc4
Fixed cross-segment boundary check, when instruction ends on the segment boundary it should generate GP(0)
2005-12-28 19:18:50 +00:00
Stanislav Shwartsman
70cc5a7fb0
Fix incorrect commit
2005-12-12 19:54:48 +00:00
Stanislav Shwartsman
f863d1e902
Generate #GP exception instead of #TS when TSS selector points to bad TSS
2005-12-12 19:44:06 +00:00
Stanislav Shwartsman
faff702f44
GP(0) on cross segment boundaryu instruction
2005-12-09 21:21:29 +00:00
Stanislav Shwartsman
8c91790680
Redefine registers accessors in cpu.h
...
Change BxSupportPAE and BxSupportGlobalPages macros to Bochs style names
Set bx_cpu_id in BX_CPU_C constructor (safe way)
Backup cpu-level check for paging features at compile time (already checked in configure)
Some warnings and indent fixes
speed up get_segment_base method for x86-64 case
2005-11-26 21:36:51 +00:00
Stanislav Shwartsman
3250edb8c5
Update instrumentation
2005-11-14 18:25:41 +00:00
Stanislav Shwartsman
732abe4b30
Move parity table from cpu.cc to lazy_flags.cc
2005-10-20 17:33:36 +00:00
Stanislav Shwartsman
64ba97210b
INVD/WBINVD should flush caches and TLB
2005-10-18 18:07:52 +00:00
Stanislav Shwartsman
086ee4c9aa
Fix code duplication in tas
2005-08-28 17:37:37 +00:00
Alexander Krisak
7be0d52cce
Added missing reinitialization of field time_tick in guard_found
2005-08-15 15:43:04 +00:00
Alexander Krisak
672ac67ff9
Fixed bug in bochs debugger caused breakpoints doesn't fires sometimes.
2005-08-15 05:32:36 +00:00
Stanislav Shwartsman
126069829d
Fixed compilation error when icache is disabled
2005-08-13 14:10:22 +00:00
Stanislav Shwartsman
b192b2af9b
Optimize pageWriteStamp checking
2005-08-10 18:18:57 +00:00
Stanislav Shwartsman
227fea6d77
do not check CS.limit in prefetch when in long64 mode
2005-08-05 18:23:36 +00:00