Commit Graph

437 Commits

Author SHA1 Message Date
Stanislav Shwartsman
928e20bd49 Changed some BX_INFO messages to BX_DEBUG 2003-05-15 18:32:27 +00:00
Stanislav Shwartsman
1d45167e5b Merged NEW-INSTRUCTIONS branch 2003-05-15 16:41:17 +00:00
Kevin Lawton
a17d06abcb Optimized the main cpu loop iCache checks to remove a redundant
check.

Commented out a number of instances of invalidate_prefetch_q(),
for branches which do not change CS since the EIP window mechanism
takes care of validating that EIP lands in the current page or not
in the main cpu loop anyways.

Fixed a couple cases (v8086 mode and real mode) of loading CS where
the EIP page window was not invalidated in segment_ctrl_pro.cc.
That may fix some aliasing problems reported before (OS2).
2003-05-10 22:25:55 +00:00
Christophe Bothamy
091052e199 - reverting to previous revision (xfer8 1.15, xfer16 1.21, xfer32 1.21)
as it breaks AMD64 support.
2003-05-08 17:56:48 +00:00
Christophe Bothamy
b3d16a48ef - apply another speedup patch from Conn Clark.
Notes from the author:
Here is another one of my speed up patches. Unlike my previous speedups
this one will help more platforms than just X86. It cleans up the Data
Xfer instructions. Since the Data Xfer instructions are the most often
executed instructions it gives a noticable boost in speed. The basic
optimization technique was to eliminate intermediate variables and pass
a pointer to the final destination or original source to the
read_virtual_whatever and the write_virtual_whatever functions.
2003-05-03 16:19:07 +00:00
Volker Ruppert
79b811f23f - fixed warnings in these files:
cpu/fetchdecode.cc
  cpu/mmx.cc
  cpu/proc_ctrl.cc
  iodev/virt_timer.cc
  plugin.cc
2003-05-02 12:22:48 +00:00
Christophe Bothamy
83b8bbedff - fix REX MOVB immediate for x86_64 (patch by Arnd Bergmann)
(bug [ 720776 ] REX MOVB immediate broken for x86_64)
2003-04-26 10:02:03 +00:00
Stanislav Shwartsman
fa623fda74 FPU tag word is 16bit only 2003-04-25 18:43:48 +00:00
Stanislav Shwartsman
88d433bb73 Implemented MASKMOVQ 2003-04-23 18:57:57 +00:00
Stanislav Shwartsman
3485368ead Ups, forgot smth ;) 2003-04-23 18:55:25 +00:00
Stanislav Shwartsman
ba2b84e604 Implemented MASKMOVQ and MASKMOVDQU instructions 2003-04-23 18:51:37 +00:00
Stanislav Shwartsman
446fca9ed0 Superfluous braces in initializers in fetchdecode.cc 2003-04-23 17:52:59 +00:00
Stanislav Shwartsman
d1d2fb34f0 Fixed number of compilation errors for FPU disabled case
Transfer fpu.cc from /fpu to /cpu
2003-04-22 20:21:34 +00:00
Stanislav Shwartsman
40bd4f138b Little style changes
Elliminated i387_t alimit field (not used in FPU)
2003-04-16 18:38:53 +00:00
Stanislav Shwartsman
aa9152129c Changes in i387 register file definition. Define common FPU/MMX register file. 2003-04-12 21:02:08 +00:00
Stanislav Shwartsman
1d54caca9b Fixed compilation error 2003-04-09 19:20:05 +00:00
Stanislav Shwartsman
7db893970c Read attributes bits even for BxSplit11b opcodes
Move lock prefix check later in fetchdecode function when all attributes is ready.
2003-04-06 19:08:31 +00:00
Stanislav Shwartsman
a050c1ac7d Reserved cpu attribute bit for 3DNOW instructions decoding 2003-04-05 16:40:55 +00:00
Stanislav Shwartsman
216124c6c3 Send #MF exception for MMX instructions if there is a pending FPU exception 2003-04-05 12:49:14 +00:00
Stanislav Shwartsman
1e71c9e56e Merged patch-unallowed-lock-cases patch.
According to the Intel manuals:

  The  LOCK  prefix  can be prepended only to the following instructions
  and  only  to  those  forms  of the instructions where the destination
  operand  is  a  memory operand: ADD, ADC, AND, BTC, BTR, BTS, CMPXCHG,
  CMPXCH8B,  DEC,  INC,  NEG, NOT, OR, SBB, SUB, XOR, XADD, and XCHG. If
  the  LOCK prefix is used with one of these instructions and the source
  operand  is a memory operand, an undefined opcode exception (#UD) will
  be  generated. An undefined opcode exception will also be generated if
  the  LOCK  prefix  is used with any instruction not in the above list.

 Checking of the LOCK prefix done in fetchDecode state and not overloads
 Bochs's execution.
2003-04-05 12:16:53 +00:00
Stanislav Shwartsman
8193a710ad Changed MMX/SSE/SSE2 diagnostic messages to be more informative 2003-03-21 20:33:23 +00:00
Stanislav Shwartsman
1224c2d307 #UD exception should be generated when using MOV_SwEw opcode for
loading CS register
2003-03-21 13:34:24 +00:00
Christophe Bothamy
1a518b81fe - add __attribute__((regparm(X))) performance trick with gcc on x86
on some cpu instructions (patch from Conn Clark)
- performance improvement is 1% on win95 boot
2003-03-17 00:41:01 +00:00
Peter Tattam
752caf8e21 x86-64 emulation
Fixed PUSHFW/POPFW for 64 bit mode. (was doing PUSHFQ/POPFQ)
2003-03-13 00:49:20 +00:00
Peter Tattam
2f9088a223 x86-64 emulation.
Fixed IRETD in 64 bit mode
2003-03-13 00:45:44 +00:00
Peter Tattam
530f482c79 x86-64 Update - Fixed bad JMP far indirect 2003-03-13 00:43:00 +00:00
Peter Tattam
cb492ae7b5 x86-64 emulation.
Perform Canonical Address Checking.

Only does basic checking (only offset, not offset+size-1)
2003-03-13 00:37:40 +00:00
Christophe Bothamy
50efc3b8c7 - apply Conn Clark's patch.perf-regparm-cclark :
- it works only on x86 with gcc2.95+
  - uses the GCC function atribute "regparm(n)" to declare that certain
    functions use the register calling convention
  - performance improvement is about 6%
2003-03-02 23:59:12 +00:00
Stanislav Shwartsman
8665979c87 * Fixed behavior of BX_INSTR_MEM_DATA callback for RMW memory accesses
See instrumentation.txt for details
2003-02-28 20:51:08 +00:00
Peter Tattam
94880d1412 Fix guest2host and related optimizations to work on 64 bit host.
1) fixed the type of "hostPageAddr" and associated typecasts.
2) fixed the type of "pages" and associated typecasts (overloaded variable)
3) patch to cpu.cc to calculate "eipPageBias" correctly in 64 bit mode
2003-02-28 02:37:18 +00:00
Peter Tattam
11a12142bc x64-64 emulation updates.
1) fixed some errors running 32 bit compat mode.  IMPORTANT FIX.
2) added IST processing (uses IST1-IST7 in 64 bit TSS)
3) cosmetic - debugging stuff to console.
2003-02-26 02:48:12 +00:00
Peter Tattam
70d752c8c2 external debugger only: fixed ask() to be virtual to let a panic trap into external debugger 2003-02-26 02:41:30 +00:00
Peter Tattam
0c39404940 cosmetic - extra console debugging for 64 bit mode. 2003-02-26 02:37:08 +00:00
Peter Tattam
4cc7139c3a fix for BX_CPU_LEVEL < 4 2003-02-26 02:35:11 +00:00
Peter Tattam
3aa1b591c1 add some debugging info for 64 bit mode. 2003-02-26 02:24:15 +00:00
Peter Tattam
0f94706c80 minor tweak to 64 bit stack push to ignore segmentation checks. Not required in 64 bit mode so is
a minor optimization.  Also in transition from compat mode to 64 bit mode (e.g. interrupt to inner
privelege with mode change), SS may not be properly defined - this avoids other messiness.
2003-02-26 00:59:31 +00:00
Peter Tattam
131bbb54c5 When external debugger enabled, change INT1 to be
transparent (i.e. not call the guest int1 ISR)
2003-02-26 00:53:38 +00:00
Stanislav Shwartsman
7fa75388a1 Added bx_cpuid value to the BX_CPU class to avoid any problems with BX_CPU_ID implementation 2003-02-13 15:51:22 +00:00
Stanislav Shwartsman
cdfc3cbce4 instrumentation enchancements:
* renamed CPU_ID to BX_CPU_ID.
  with this new name there is no possibility for name contentions and BX_CPU_ID
  definition could be moved out to NEED_CPU_REG_SHORTCUTS block

* returned back `unsigned BX_CPU::which_cpu(void)` function

* added BX_CPU_ID parameter for
	BX_INSTR_PHY_READ(a20addr, len);
	BX_INSTR_PHY_WRITE(a20addr, len);
    now it will be
	BX_INSTR_PHY_READ(cpu_id, a20addr, len);
	BX_INSTR_PHY_WRITE(cpu_id, a20addr, len);
2003-02-13 15:04:11 +00:00
Bryce Denney
7336c891ee - CPU_ID fix from Shai Fultheim, who writes:
> CPU_ID is defined as
  > #define CPU_ID (BX_CPU_THIS_PTR local_apic.get_id())
  > This is not true when the APIC name is changed (true in Linux). Please
  > change this to:
  > #define CPU_ID (BX_CPU_THIS - BX_CPU(0))
2003-02-09 13:30:39 +00:00
Peter Tattam
22d855a6c0 Fixed wrong RETF instructions for 64 bit mode. 2003-02-08 05:51:38 +00:00
Peter Tattam
c4bf554432 Fixed wrong increment for enter where level > 0 2003-02-08 05:48:01 +00:00
Stanislav Shwartsman
5991599dca Added BX_INFO messages when execution FXSAVE/FXRSTOR instructions 2003-01-23 18:50:37 +00:00
Stanislav Shwartsman
5222261080 Save/Restore FPU TOP-OF-STACK in FXSAVE/FXRSTOR instructions 2003-01-23 18:33:35 +00:00
Stanislav Shwartsman
e1b8e5b9f9 Fixed FTW save/restore in FXSAVE/FXRSTOR opcodes 2003-01-23 17:53:11 +00:00
Christophe Bothamy
77e33ccf26 - fix a "too many arguments for format" warning 2003-01-22 21:43:34 +00:00
Christophe Bothamy
c6abf1d0d1 - fix old #if BX_SUPPORT_SYSENTEREXIT found by Stanislav. The sysenter/exit code was not called at all! 2003-01-20 21:30:00 +00:00
Christophe Bothamy
939b558fdf - apply patch.sysenterexit-mrieker:
- adds sysenter/sysexit support for cpu-level>=6
  - enabled by ./configure --enable-sep
2003-01-20 20:10:31 +00:00
Christophe Bothamy
ed57d3d45d - add changes requested by ams, sgdt and sidt in v8086 mode 2003-01-17 18:08:13 +00:00
Stanislav Shwartsman
d1edcde9ed Cleanup Peter's change in MOVNTI instruction 2003-01-14 14:58:56 +00:00