Commit Graph

70 Commits

Author SHA1 Message Date
Stefan Weil
4ff9786c67 Fix trivial "endianness bugs"
Replace endianess -> endianness.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-03 21:42:57 +02:00
Paolo Bonzini
eda48c344f inline cpu_halted into sole caller
All implementations are now the same, and there is only one caller,
so inline the function there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-13 14:44:21 +00:00
Michal Simek
c4374bb753 microblaze: Add PVR for writeback cache, endians
Specify PVR for writeback cache, endians and others.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-03-11 15:24:37 +01:00
Edgar E. Iglesias
6c5f738dae microblaze: Handle singlestepping over direct jmps
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-02-10 00:46:09 +01:00
Paolo Bonzini
c0c1dc9925 cris, microblaze: use cpu_has_work
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-02-08 20:37:39 +01:00
Edgar E. Iglesias
5d0bb8239d microblaze: cleanup helper_addkc
Remove unused addition and rename to helper_carry.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-23 03:52:20 +01:00
Edgar E. Iglesias
e0a42ebc08 microblaze: Improve subkc
Move code from the helper into the translator. The remaining
helper parts can reuse helper_addkc, making it possible to
remove helper_subkc entirely.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-22 12:39:16 +01:00
Edgar E. Iglesias
7e9e433008 microblaze: Fix 3rd addkc arg when rd is r0
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-22 12:35:48 +01:00
Edgar E. Iglesias
40cbf5b709 microblaze: Improve addkc
* Optimize handling when carry is not updated.
* Optimize handling for adds with nop semantics.
* Move code from helper_addkc to the translator making
  helper_addkc PURE and CONST.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-22 12:02:53 +01:00
Edgar E. Iglesias
2accfb5fa6 microblaze: Remove debug leftovers.
No functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-22 12:00:12 +01:00
Edgar E. Iglesias
ee8b246f82 microblaze: Reorganize for future patches
No functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-22 11:57:19 +01:00
Edgar E. Iglesias
9f8beb6636 microblaze: Add support for load/store reversed
Load/store reversed (lwr/swr) are insns that endian translate
the sub-word part of the address and byteswap the data lanes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-01-19 23:18:00 +01:00
Edgar E. Iglesias
9ef5535763 microblaze: Tweak comment, fast cases -> common cases
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-19 22:48:07 +01:00
Edgar E. Iglesias
844bab604b microblaze: Improve unconditional direct branching
Avoid emitting conditional tcg operations for uncoditional
direct branches.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-01-14 12:30:26 +01:00
Edgar E. Iglesias
23979dc541 microblaze: Use more TB chaining
For some workloads with tight loops this ~doubles the emulation
speed.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-01-05 02:23:09 +01:00
Peter Maydell
185698715d softfloat: Rename float*_is_nan() functions to float*_is_quiet_nan()
The softfloat functions float*_is_nan() were badly misnamed,
because they return true only for quiet NaNs, not for all NaNs.
Rename them to float*_is_quiet_nan() to more accurately reflect
what they do.

This change was produced by:
 perl -p -i -e 's/_is_nan/_is_quiet_nan/g' $(git grep -l is_nan)
(with the results manually checked.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-02 11:15:25 +01:00
Stefan Weil
9a78eead0c target-xxx: Use fprintf_function (format checking)
fprintf_function uses format checking with GCC_FMT_ATTR.

Format errors were fixed in
* target-i386/helper.c
* target-mips/translate.c
* target-ppc/translate.c

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30 08:01:59 +00:00
Stefan Weil
e6aa0f11ed target-microblaze: Use %td for ptrdiff_t arguments in debug message
According to ISO/IEC 9899:1999 7.19.6.1,
the correct length modifier for ptrdiff_t is 't', not 'z'.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-10-02 13:12:21 +02:00
Edgar E. Iglesias
ef9d48da59 microblaze: Add support for fcmp.un
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-09-09 22:05:48 +02:00
Edgar E. Iglesias
97694c57d7 microblaze: Add basic FPU emulation
Missing:
* fcmp.un insn
* Denormalized exceptions
* Exception model is not accurate

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-09-09 10:20:17 +02:00
Edgar E. Iglesias
bdc0bf29c6 microblaze: Add definitions for FSR reg fields
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-09-09 09:58:35 +02:00
Edgar E. Iglesias
a5efa6441c microblaze: Remove unused members from the disas context
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-07-25 00:09:41 +02:00
Edgar E. Iglesias
4b5ef0b50d microblaze: Speed up base + index addressing mode
Speed up reg + reg addressing mode when any of the regs is r0.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-07-24 23:25:49 +02:00
Edgar E. Iglesias
b2565c694a microblaze: Use setcond for conditional branches
Use setcond for evaluating the condition for branches.
In the future, we could do better for branches without
delay slots.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-07-24 21:51:51 +02:00
Edgar E. Iglesias
61204ce8ec microblaze: Improve branch with small immediates
Slight improvements of conditional branches with small
immediate offsets.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-07-24 21:24:59 +02:00
Paolo Bonzini
a88790a14f remove exec-all.h inclusion from cpu.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03 09:48:24 +03:00
Paolo Bonzini
10eb0cc03c move cpu_pc_from_tb to target-*/exec.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03 09:48:12 +03:00
Paolo Bonzini
83dae09588 remove unused stuff from */exec.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03 06:47:13 +00:00
Edgar E. Iglesias
fd1dc85837 microblaze: Make MSR_UM and MSR_VM part of the tb flags
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-06-07 11:54:27 +02:00
Edgar E. Iglesias
0d5d469938 microblaze: Update elf machine nums.
189 was allocated in upstream binutils.

0xbaab was the old temporary value. Still used by some tools and the
linux kernel.

I've seen 115 in older gdb versions, but lets ignore that one.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-05-19 15:24:17 +02:00
Blue Swirl
183aa45407 microblaze: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 20:00:33 +00:00
Paul Brook
d4c430a80f Large page TLB flush
QEMU uses a fixed page size for the CPU TLB.  If the guest uses large
pages then we effectively split these into multiple smaller pages, and
populate the corresponding TLB entries on demand.

When the guest invalidates the TLB by virtual address we must invalidate
all entries covered by the large page.  However the address used to
invalidate the entry may not be present in the QEMU TLB, so we do not
know which regions to clear.

Implementing a full vaiable size TLB is hard and slow, so just keep a
simple address/mask pair to record which addresses may have been mapped by
large pages.  If the guest invalidates this region then flush the
whole TLB.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-17 02:44:41 +00:00
Paul Brook
3c7b48b74c Target specific usermode cleanup
Disable various target specific code that is only relevant to system emulation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-12 18:44:24 +00:00
Paul Brook
4fcc562bff Remove cpu_get_phys_page_debug from userspace emulation
cpu_get_phys_page_debug makes no sense for userspace emulation, so remove it.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-12 18:34:25 +00:00
Richard Henderson
5270589032 Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.
Removes a set of ifdefs from exec.c.

Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets other
than Alpha.  This will be used for page_find_alloc, which is
supposed to be using virtual addresses in the first place.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-12 16:28:24 +00:00
Edgar E. Iglesias
ff21f70afd microblaze: Improve brk emulation.
brk insns while in user mode raise priv insn exceptions.
This commit makes gdbserver work on linux guests.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-02-20 14:04:01 +01:00
Edgar E. Iglesias
e1aa325409 microblaze: Dont segfault when singlestepping first insn.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-02-20 14:03:14 +01:00
Paolo Bonzini
49a945a3c0 kill regs_to_env and env_to_regs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19 16:31:02 -06:00
Michal Simek
4c24aa0a69 microblaze: Print content of EAR register
I need to see EAR register in output because I need to parse irqsoff problem.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-16 12:54:26 +01:00
Edgar E. Iglesias
17c52a43b4 microblaze: Update debug logs.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-16 12:52:56 +01:00
Edgar E. Iglesias
f062a3c793 microblaze: Handle wdc flush and clear.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-13 09:10:08 +01:00
Paul Hartke
9d2dcce9a3 microblaze: Correct branch to registers.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-13 03:22:24 +01:00
Edgar E. Iglesias
95b279de95 microblaze: Restore env when raising unmapped bus access.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-11-12 02:14:45 +01:00
Edgar E. Iglesias
4898427ec8 microblaze: Unbreak reset.
Initialize synthesis config registers at reset to cope with the new
cpu_reset sequences.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-11-12 02:12:44 +01:00
Anthony Liguori
c227f0995e Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem.  Something
like this _must_ be presented on the list first so people can provide input
and cope with it.

This reverts commit 99a0949b72.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01 16:12:16 -05:00
malc
99a0949b72 Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the time
being.

Signed-off-by: malc <av1474@comtv.ru>
2009-10-01 22:45:02 +04:00
Juan Quintela
3897293825 gcc wants 1st static and then const
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-25 19:52:06 +00:00
Blue Swirl
72cf2d4f0e Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc923584,
f40d753718,
96555a96d7 and
3990d09adf but the fixes were fragile.

Solution: Avoid the conflict entirely by renaming the functions and the
file. Revert the previous hacks.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-12 07:36:22 +00:00
Edgar E. Iglesias
02b33596d0 microblaze: Trap if QEMU finds an unknown insns.
If PVR settings enable illegal insn trap, trap when QEMU finds an
insn it knows nothing about.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-09-11 10:38:31 +02:00
Edgar E. Iglesias
a12f650781 microblaze: Correct prio between MMU and unaligned exceptions.
The microblaze gives MMU faults priority. For stores we still
have a flaw that the value leaks to memory in the case of an
unaligned exception.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-09-11 10:35:27 +02:00